1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

MagisterModmod

Discussion in 'FfH2 Modmods, Scenarios, and Maps' started by MagisterCultuum, Feb 27, 2012.

  1. TrippedOnACloud

    TrippedOnACloud Warlord

    Joined:
    Jun 28, 2012
    Messages:
    294
    They are capable of attacking without declaring war, though they're not Hidden Nationality. I'm not certain at the moment as this machine doesn't have Civ4 installed, but I believe they use AlwaysHostile? Although, now that I think about it, the cities they were stationed in might have also had a Ring of Warding up. However, none of the stuck units were summons or summoners. I don't recall having any issues with normal Hidden Nationality units causing WoCs, even when a Ring of Warding is involved, so chances are this particular lockup is due to AlwaysHostile or whatever flag/attribute is used on Dragon Fanatics and Wyvern Riders.
     
  2. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,174
    Location:
    Kael's head
    Dragon Fanatics and Wyvern Riders a have the bAlwaysHostile tag in my modmod. Unless you have recently dealt with the C++ end of that tag, handling requests I made a long time ago, then they can cause all sorts of issues.

    The big problem seems to be that bAlwaysHostile units don't count as enemies when in non-enemy cities as far as actually attacking them goes, but they do seem to count when it comes to being able to plan an attack. The attacking unit may keep trying to attack the unit in the city but never be able to complete the attack.

    bAlwaysHostile units are also able to conquer rival cities and superforts without war. (I blocked this in python and gave the units the bNoCapture tag to handle it, but would prefer a more permanent solution in the DLL.)


    I also made the various equipment units count as bAlwaysHostile, so that rivals could capture the equipment that has been dropped and so pick it up themselves. I have noticed that this can cause the equipment to be destroyed if it was dropped in a city and if the city was handed over to another player (usually a puppet state) upon being captured.

    I already added a spell to let a unit player convert a teammate's equipment to his control so he can take it. I could easily add a similar spell to let players take unguarded equipment from their rivals.

    (Honestly I'm thinking bAlwaysHostile is not the best way to handle the equipment though. I just probably just change it on my own.)

    I would prefer it if the <UnitInStackPrereq> and <PromotionInStackPrereq> did not only check the player's own units, but if tags like bImmuneTeam/bImmuneNeutral/bImmuneEnemy limited what units it checked.



    I'll look into this.

    I already added code to remove the Immoral and Life III promotions during the "And now for Something Completely Different) effect, but changing promotions for upgrading units is not something the game makes easy.


    It looks like the code that removes immortal-granting promotions stops looking after finding the first one.
    Spoiler :

    Code:
    void CvUnit::doImmortalRebirth()
    {
        joinGroup(NULL);
        setDamage(75, NO_PLAYER);
        bool bFromProm = false;
       	for (int iI = 0; iI < GC.getNumPromotionInfos(); iI++)
    	{
            if (isHasPromotion((PromotionTypes)iI))
            {
                if (GC.getPromotionInfo((PromotionTypes)iI).isImmortal())
                {
                    setHasPromotion(((PromotionTypes)iI), false);
                    bFromProm = true;
                  [COLOR="Red"]  break;[/COLOR]
                }
    		}
    	}
    
    	if (!bFromProm)
    	{
            changeImmortal(-1);
    	}
    
        doEscape();
    
    	// Sephi AI (Immortal Units heal)
        if (!isHuman())
        {
            getGroup()->pushMission(MISSION_HEAL);
        }
    	// Sephi AI End

    If worst comes to worse, I could make it so that Life III does not itself make a unit immortal but rather grants the immortal promotion too whenever it is granted, and so that the resurrection spells remove that promotion too.

    I used the Lair Guardian promotion for this, mostly so that the unit would not remain held if something kicked it out of the city. This promotion grants a permanent HN status because it is also used for barbarian units generated from lairs which should not be friendly to Barbarian trait civs.

    Since the promotion already uses python to remove itself when the unit leaves a city or permanent improvement, I think I'll try making it apply the normal HN promotion to barbarian units instead of having HN status built in to itself.
    I'm not sure I'd consider that a problem any more than Black Mirror-ed combat units being able to attack. It would be a problem if they were able to hurry wonders, found buildings, or start golden ages, but I'm pretty sure they cannot.
    This appears to be handled around like 15775 of CvCity.cpp
    Code:
    //FfH: Added by Kael 09/21/2008 (so setting a buildingclass without a change number will make the event require that building to be in the city)
    		if (kEvent.getBuildingChange() == 0)
    		{
    			if (getNumRealBuilding(eBuilding) == 0)
    			{
    			    return false;
    			}
    		}
    //FfH: End Add
    I'm not sure why Kael chose to use "Real" there, but it would cause the effect you describe. I'd suggest Tholal change this.
     
  3. CainStar

    CainStar Warlord

    Joined:
    Aug 15, 2007
    Messages:
    200
    Because of a typo in my previous reply, even thou I did edit it just now, I would like say I CAN PROVIDE/UPLOAD my savegame if somebody wants to take look at it. How in the h**l I managed to write "can't" instead of "can" in my previos reply is beyond me..........:D:confused::hmm::dunno:
     
  4. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,174
    Location:
    Kael's head
    I'm thinking of changing the Werewolf mechanic a little bit. How does this sound?

    The Werewolf promotion would no longer block the ability to cast spells, but Ravenous Werewolves would start with a new promotion that does so. This would still prevent the exploit of having infinite lycantropic archmages or high priests, which was the point of giving the werewolf promotion that effect. It would however not stop Baron Duin Halfmorn himself from using abilities, picking up/dropping equipment, becoming a Vampire, etc.

    Duin would gain a new ability to Dominate Werewolves, very similar to Magnadine's Mesmerize Mercenary ability but of course for Werewolves instead of Mercenaries.

    Duin would be changed from UNITCOMBAT_BEAST to UNITCOMBAT_MELEE, so I wouldn't have to worry about issues related to this hero being captured by Beastmasters. (I believe that that sometimes threw off the Sluagh mechanic that should make sure he is resurrected with the right promotions.) Other Werewolves would remain Beasts.

    (Note that in the lore, Duin does most of his fighting in his human form, using a cudgel rather than teeth or claws and wearing expensive armor. It is easier to keep his wits about him to devise tactics and command his followers in this form, although he will quickly shift to his bestial form in order to remind the new werewolves that he is the Alpha of their pack.)

    Ravenous Werewolves would start not only be Enraged but also Rebellious, unless their owner also controls the Baron himself.

    Lycanthropy would not only spread when a werewolf wins a battle, but would also have a (smaller, perhaps 10% as much) chance of spreading when the werewolf is defeated (unless the winner remains uninjured, has the Werewolf Slaying promotion, or is Immune to Disease). The unit would remain under its own owner's control, unless its Rebellious nature makes it turn barbarian or if Duin dominates it.
     
  5. zldrago1000

    zldrago1000 Chieftain

    Joined:
    Feb 8, 2013
    Messages:
    78
    I like it. The fact that the werewolf promotion blocked spellcasting always bugged me.
     
  6. Cutlass

    Cutlass The Man Who Wasn't There.

    Joined:
    Jan 13, 2008
    Messages:
    46,235
    Location:
    US of A
    As it is the werewolf can't use the portals. Which means he can't go with the armies. So that'd be good.

    Also, on the subject of portals, can you think of a way to make the AI use them? I've never seen one use them. Which means they're a freebie for the player, who doesn't need a freebie.

    On a different subject, is there a reason stone is not a resource in FFH?
     
  7. Auric

    Auric Chieftain

    Joined:
    Dec 20, 2013
    Messages:
    64
    Gender:
    Male
    Can I get one of the older versions? Like July or older. It looks like the archive on moddb only stores the last version.
     
  8. David12596

    David12596 Warlord

    Joined:
    Jul 15, 2014
    Messages:
    149
    So it seems like i found an issue with the Doviello, at least when playing online. If I use the Issue Challenge ability it causes our game to go out of sync. And here I was wanting a lot of units to fight each other so that I can see who comes out the strongest. :(
     
  9. Imp. Knoedel

    Imp. Knoedel Properly Paranoid Proletarian

    Joined:
    Nov 11, 2011
    Messages:
    8,698
    Location:
    The cooler Germany
    Multiplayer really is this mod's biggest flaw imo. Just way too much stuff going on at once. In the midgame already it becomes unplayable due to out of sync, and that's just with two players!
     
  10. David12596

    David12596 Warlord

    Joined:
    Jul 15, 2014
    Messages:
    149
    Is it possible to use some modules with this mod? I would really love to use the khazad: the next generation module with this mod.
     
  11. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,174
    Location:
    Kael's head
    I'm not a big fan of modular modmods and am unfamiliar with that one, but suspect it would likely overwrite some important files. You could go through and make it compatible, but I don't intend to do so.
     
  12. black_imperator

    black_imperator Emperor

    Joined:
    Dec 4, 2005
    Messages:
    1,666
    The point of having them modular is that they do not overwrite files.

    To answer at David's question, i don't think NavalAi's dll allows for modular modmods.
     
  13. David12596

    David12596 Warlord

    Joined:
    Jul 15, 2014
    Messages:
    149
    ok, it was worth asking though. Thanks for the replies. :p
     
  14. Tholal

    Tholal Emperor

    Joined:
    May 19, 2009
    Messages:
    1,676
    I would recommend that you discontinue use of the <bAlwaysHostile> tag since it is resulting in endless loop lockups.

    I have decided that it is not worth trying to fix. More info can be found in this post
     
  15. Tholal

    Tholal Emperor

    Joined:
    May 19, 2009
    Messages:
    1,676
    You are correct. More Naval AI does not support Modular mods. It is something I have wanted to add, but it seems like a major project.
     
  16. black_imperator

    black_imperator Emperor

    Joined:
    Dec 4, 2005
    Messages:
    1,666
    yeah it's quite large, but FF/Rife's implem of it is well commented, so you should be able to merge it without too much difficulty, it'll just be a long work
     
  17. David12596

    David12596 Warlord

    Joined:
    Jul 15, 2014
    Messages:
    149
    I do have another question cause I know little to nothing about coding, etc, but why is the turns times in some mods much longer then compared to others. For example me and a friend do see a pretty big wait between turns using Magister Modmod compared to some other mods. I also have had an increase in wait time with the turns with the SNV version for Ashes of Erebus, but the normal version (I guess we can call it that) is fast. My only guess it it has something to do with the optimization of the mod in question.
     
  18. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,174
    Location:
    Kael's head
    Turn times can depend on many factors.

    Spells, especially those with with python prereqs, are a common culprit. There are many more of those in this modmod than the main mod.

    In this modmod I think the CvGameUtils.py function unitCannotMoveInto(self,argsList) slows things down the most. The code placed here must run whenever a unit is going to move and whenever an AI considers moving any unit anywhere. It may not be a big deal in when the total number of units is small, but because huge once armies grow large enough. Disabling this callback by default was responsible for most of the speed improvement between vanilla CivIV and the BtS expansion.

    Kael and Tholal don't use that callback due to its inefficiency, but this modmod needs it in order to make the Ring of Warding function properly to block hostile summons from attacking the city. I also use it to stop undead units from attacking Shrines of Arawn, and to block the demon lords and Balors from entering non-hell terrain outside their team's territory (until the last Armegeddon event removes the Bound by Compact promotion).

    It was also used to stop bAlwaysHostile units from going where they shouldn't (capturing superforts without war, or entering rival cities without war and then stopping other rival units from being able to go there), but in response to Tholal's recent post I just switched all those units to Hidden Nationality (not the HN promotion, but the inherent HN status for the unit) instead and deleted the superfluous code. That should make things a bit faster.

    AI issues also slow things down, and removing bAlwaysHostile should help with that too.

    Hopefully Tholal will soon address the other AI issue caused by groups containing some units that can move through peaks.
     
  19. black_imperator

    black_imperator Emperor

    Joined:
    Dec 4, 2005
    Messages:
    1,666
    answering for AoE (though i'll only do this once, after that we can get to our own thread if we want to continue discussing this)

    there shouldn't be anything that causes a noticeable difference in turn time between AoE Normal Version and SVN Version, so if you can repeatedly see an important difference on similar settings, please mention it in our thread, possibly with a save file so that we can take a look, thanks
     
  20. David12596

    David12596 Warlord

    Joined:
    Jul 15, 2014
    Messages:
    149
    Oh yeah I should mention something I found slightly strange when playing a game online. Now I don't have the save for this (I saved over it by mistake) and I am not really sure if it was a bug or not, but what is the chances of the AI founding Ashen Veil on turn 17 on prince difficultly. I found it to be rather fast for something that should take quite a few techs to get.
     

Share This Page