MNAI-U: unofficial build & bugfixes

What do you mean?
The crime rate don't give real effects. It just triggers events but none of these have concrete effect, like unhappiness, destruction of improvements, spawning of barbarian units to represent bandits and / or militias. Would be nice to have the crime rate have more active effects in the game.

Some integration with CoE might be nice
That would be very nice, since the religion essence connect well with this mechanism.

I honestly think this is an acceptable abstraction. Actual units aren't an accurate representation of your population; we shouldn't assume the first adept unit you build is the first and only (at the time) person in your empire capable of magic.
I agree with you, but I really think that the event should be unlocked after discovery of Knowledge of the Ether. That can give the players some time to build nature mana nodes and have more chances to choose the positive option, instead of been forced to accept that the triggered tile lose 1 food.

This is not true in general, I've successfully made peace in my last game. The AI is usually overconfident in my experience, but that's hard to fix.
Understood. My observations about this is that even losing a considerable amount of units and territories, the AI still refuses to ask for peace. That explains why most of the games the AI declares war to other civilization and only the war only ends when one of the two is destroyed.
 
The crime rate don't give real effects. It just triggers events but none of these have concrete effect, like unhappiness, destruction of improvements, spawning of barbarian units to represent bandits and / or militias. Would be nice to have the crime rate have more active effects in the game.
Then you would suddenly have major downsides from several of the buildings. This is also not intended to be a big mechanic, Kael explicitely described it as "flavour" in his note, which you can read in the Civilopedia under Fall from Heaven Concepts -> Crime.
I agree with you, but I really think that the event should be unlocked after discovery of Knowledge of the Ether. That can give the players some time to build nature mana nodes and have more chances to choose the positive option, instead of been forced to accept that the triggered tile lose 1 food.
Probably Alteration, then - KotE doesn't allow building nature nodes just yet.
 
What exactly is the difference with between the "normal" map scripts and the _mst versions?

And do all maps support FfH2 content, actually? I just realised I have only really played Erebus, ErebusContinent and WorldOfErebus. (The latter two are found in the forums here)
 
Thanks so much for making that experimental AI change!
 
I was eliminated via conquest and was given control of the civ that destroyed me. Is this intentional?
 
Since the early game the civilizations doesn't have access to adepts, unless they find the tech in the tribal huts, I suggest this event be unlocked only after researching Knowledge of the Ether. Also, one of the options asks for an adept, but in the moment that the event triggered I have none. Nevertheless it doesn't need an adept but only to the player have Nature Mana, which doesn't relate well with the option.
I've accepted this as one of the intentionally-brutal aspects of Erebus. Similarly, you can have plenty of the constellation events well before you've researched the basic religions. In the latter case, it's an opportunity missed, in the former (i.e. your example), it's an unavoidable, but not severe, penalty. IIRC, there are events tied to the player having Enchantment, Body and Spirit as well, and none require the unlocking of KotE. BUT, if you happen to have one of those mana types as part of your starting civilization, LUCKY!
 
lfgr, I have been wondering about doing some minor local modmod-edits as well, and I was thinking if you could include two "moddability" functionalities in the dll: One would be allowing enslavement chance from promotions like in EMM (Slaver trait uses this), the other would be making it possible to have a reduced strength unhappy production (like 1 hammer per 2 unhappy faces) alongside the default 1:1 unhappy production. I don't know anything about how this game's dlls are coded and compiled, so I don't know how much effort this would be. But if it would be an easy inclusion, that would be great. :)

Also, what decides whether a leader is a "minor" or "major" leader? It seems to me that setting a civ to have access to a certain leader promotes that one from minor to major. But how are leaders linked while unavailable, e.g. for puppet states or revolutions?

On another note, is it intended that the peace caused by Seven Pines or Corlindale has no timer? This makes it almost worthless to use against people that will auto-declare like Basium vs. Ashen Veil or against a human. I see a possible Corlindale + resurrection exploit for infinite peace if it would give the timer again every time, but for Seven Pines this shouldn't be an issue due to the one-time nature of it - no? And perhaps the Corlindale spell could be adjusted to give the "force peace" timer as well when casted for the first time (but not anymore un successive resurrections and recasts).

Ah, one more thing! (sorry already)
Garrim Gyr of the Luchuirp has the perhaps least ever useful trait "Defender", but makes it even worse by not being able to apply it to the golems that usually make up most of the Luchuirp's army. Do you think this is fixable? I believe Golems have no Unitcombat while promotions from leader traits are assigned to specific unitcombats, but is there a way around this to fix the application of the trait for golems?
 
Ah, one more thing! (sorry already)
Garrim Gyr of the Luchuirp has the perhaps least ever useful trait "Defender", but makes it even worse by not being able to apply it to the golems that usually make up most of the Luchuirp's army. Do you think this is fixable? I believe Golems have no Unitcombat while promotions from leader traits are assigned to specific unitcombats, but is there a way around this to fix the application of the trait for golems?
Applying Homeland to Golems based on Garrim's Gyr's trait seems so obvious than I'm surprised I wasn't already doing it in my modmod.

I think your best bet here is to apply the promotion to Golems via python. Just add these three lines to Assets\python\CvEventManager.py under def onUnitCreated(self, argsList):

Code:
        if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_GOLEM')):
            if pPlayer.hasTrait(gc.getInfoTypeForString('TRAIT_DEFENDER')):
                unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_HOMELAND'), True)

edit: I used "if iRace == gc.getInfoTypeForString('PROMOTION_GOLEM'):" originally, but had to change it to "if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_GOLEM')):" when I checked the MNAI version and noticed its version of onUnitCreated does not define iRace like the version from my modmod does. In the MNAI version I think the logical place to put this code is line 1430 or 1438, just above or below applying the Strong promotion to Elementals/the Undead based on the Power of the Elements/Necromancy. I noticed that copying/pasting the code into the forum and back changed tabs to spaces. Make sure there are 2 tabs before the first line, 3 tabs before the second, and 4 tabs before the third.

You'll probably also want to document that the trait applies to golems. To do that, add a Help tab in Assets\XML\Civilizations\CIV4TraitInfos.xml
Code:
        <TraitInfo>
            <Type>TRAIT_DEFENDER</Type>
            <Description>TXT_KEY_TRAIT_DEFENDER</Description>
            <ShortDescription>TXT_KEY_TRAIT_DEFENDER_SHORT</ShortDescription>
            <Help>TXT_KEY_TRAIT_DEFENDER_HELP</Help>
and define such a tag like so in Assets\XML\Text\CIV4GameText_FFH2.xml (or really any xml file in the Text folder)
Code:
    <TEXT>
        <Tag>TXT_KEY_TRAIT_DEFENDER_HELP</Tag>
        <English>[NEWLINE][SPACE][SPACE][ICON_BULLET]Free Promotion ([LINK=PROMOTION_HOMELAND]Homeland[\LINK])[NEWLINE][TAB][ICON_BULLET][LINK=PROMOTION_GOLEM]Golem Units[\LINK]</English>
    </TEXT>

That matches the format automatically used for other traits applying promotions to unitcombats, but since help tags are listed before the automatically generated help info it will be listed separately from the list of applicable unitcombats.
1699706353107.png




Another option is to create a new UNITCOMBAT_GOLEM to give to golems but not add it to any promotions so it wouldn't let them purchase promotions but would let you give them free promotions from traits.
 
Last edited:
And do all maps support FfH2 content, actually? I just realised I have only really played Erebus, ErebusContinent and WorldOfErebus. (The latter two are found in the forums here)
Most mapscripts (iirc boreal and/or arboreal crash on generation, presumably due to a sufficiently different terrain generator. great plains doesn't generate any mana nodes) will run with the mod and will generate all of ffh's resources, but none of them will generate the mod specific terrain (like marsh) unless specifically made to do so, which is one of the benefits of the mst versions.
 
Very nice, thank you @MagisterCultuum ! The python code works perfectly. :) (I decided to omit the help text, since it'd be superfluous for all but one leader).

While looking at the golems I noticed another issue, which is perhaps also interesting for lfgr to fix in MNAI: Barnaxus-induced empowering promotions are not gained when a golem is created, meaning it has to spend one turn on its base power before receiving the powerups after the turn end. Not sure when they are gained exactly; if it is at the end of your turn but before the AI's, or at the start of your next.

Edit: So many things, I feel bad for posting/asking so much. I have noticed (a long time ago, in fact, but always forgot to post about it) that there is a cap on 8 trade routes. Other mods such as Ashes of Erebus or Realism Invictus (if memory serves correctly) have removed that cap, or moved it so high I haven't been able to reach it yet. In FfH2 vanilla/MNAI, it is reached fairly easy, however, which can cause some buildings to miss a large effect they would otherwise have.
For example: You get 3 base trade routes after Trade and Currency are researched. A lighthouse, inn, tavern and obsidian gate all give +1 trade route. Foreign Trade gives +1 in the inland and +2 in coastal cities. The Great Lighthouse gives +2 in each coastal city. This is 8 max for inland cities, which is fine, but 11 out of 8 for coastal cities. For a player having the Great lighthouse (without even Foreign Trade), one of the trade route buildings will not give an additional trade route anymore. If you do have Foreign Trade, 3 of them, or the Great Lighthouse +1 other won't. Is this a deliberate design choice, or a vanilla Civ4 holdover that was never looked at in FfH2?
 
Last edited:
Very nice, thank you @MagisterCultuum ! The python code works perfectly. :) (I decided to omit the help text, since it'd be superfluous for all but one leader).

While looking at the golems I noticed another issue, which is perhaps also interesting for lfgr to fix in MNAI: Barnaxus-induced empowering promotions are not gained when a golem is created, meaning it has to spend one turn on its base power before receiving the powerups after the turn end. Not sure when they are gained exactly; if it is at the end of your turn but before the AI's, or at the start of your next.

It happens at the start of the player's turn for the Luchuirp, or at the start of the game turn for Falamar in the Black Tower scenario where he can have cities of different civilizations types and get unique units of other civs).

Spoiler :
Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Fall from Heaven 2\Assets\python\CvEventManager.py
Code:
    def onBeginPlayerTurn(self, argsList):
        'Called at the beginning of a players turn'
        iGameTurn, iPlayer = argsList
        pPlayer = gc.getPlayer(iPlayer)
        player = PyPlayer(iPlayer)        

        if pPlayer.getStateReligion() == gc.getInfoTypeForString('RELIGION_THE_ASHEN_VEIL'):
            if pPlayer.getCurrentEra() != gc.getInfoTypeForString('ERA_VEIL'):
                pPlayer.setCurrentEra(gc.getInfoTypeForString('ERA_VEIL'))

        if pPlayer.getStateReligion() == gc.getInfoTypeForString('RELIGION_THE_ORDER'):
            if pPlayer.getCurrentEra() != gc.getInfoTypeForString('ERA_ORDE'):
                pPlayer.setCurrentEra(gc.getInfoTypeForString('ERA_ORDE'))

        if pPlayer.getStateReligion() == gc.getInfoTypeForString('RELIGION_FELLOWSHIP_OF_LEAVES'):
            if pPlayer.getCurrentEra() != gc.getInfoTypeForString('ERA_LEAF'):
                pPlayer.setCurrentEra(gc.getInfoTypeForString('ERA_LEAF'))

        if pPlayer.getStateReligion() == gc.getInfoTypeForString('RELIGION_RUNES_OF_KILMORPH'):
            if pPlayer.getCurrentEra() != gc.getInfoTypeForString('ERA_RUNE'):
                pPlayer.setCurrentEra(gc.getInfoTypeForString('ERA_RUNE'))

        if pPlayer.getStateReligion() == gc.getInfoTypeForString('RELIGION_OCTOPUS_OVERLORDS'):
            if pPlayer.getCurrentEra() != gc.getInfoTypeForString('ERA_OCTO'):
                pPlayer.setCurrentEra(gc.getInfoTypeForString('ERA_OCTO'))

        if pPlayer.getStateReligion() == gc.getInfoTypeForString('RELIGION_THE_EMPYREAN'):
            if pPlayer.getCurrentEra() != gc.getInfoTypeForString('ERA_EMPY'):
                pPlayer.setCurrentEra(gc.getInfoTypeForString('ERA_EMPY'))

        if pPlayer.getStateReligion() == gc.getInfoTypeForString('RELIGION_COUNCIL_OF_ESUS'):
            if pPlayer.getCurrentEra() != gc.getInfoTypeForString('ERA_COUN'):
                pPlayer.setCurrentEra(gc.getInfoTypeForString('ERA_COUN'))

        if not pPlayer.isHuman():
            if not CyGame().getWBMapScript():
                cf.warScript(iPlayer)

        if pPlayer.getCivics(gc.getInfoTypeForString('CIVICOPTION_CULTURAL_VALUES')) == gc.getInfoTypeForString('CIVIC_CRUSADE'):
            cf.doCrusade(iPlayer)
        
        if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_KHAZAD'):
            cf.doTurnKhazad(iPlayer)

        if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_LUCHUIRP'):
            cf.doTurnLuchuirp(iPlayer)

Code:
    def onBeginGameTurn(self, argsList):
        'Called at the beginning of the end of each turn'
        iGameTurn = argsList[0]

        iOrthusTurn = 75
        if not CyGame().isUnitClassMaxedOut(gc.getInfoTypeForString('UNITCLASS_ORTHUS'), 0):
            if not CyGame().isOption(gc.getInfoTypeForString('GAMEOPTION_NO_ORTHUS')):
                bOrthus = False
                if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_QUICK'):
                    if iGameTurn >= iOrthusTurn / 3 * 2:
                        bOrthus = True
                if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_NORMAL'):
                    if iGameTurn >= iOrthusTurn:
                        bOrthus = True
                if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_EPIC'):
                    if iGameTurn >= iOrthusTurn * 3 / 2:
                        bOrthus = True
                if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_MARATHON'):
                    if iGameTurn >= iOrthusTurn * 3:
                        bOrthus = True
                if bOrthus:
                    iUnit = gc.getInfoTypeForString('UNIT_ORTHUS')
                    cf.addUnit(iUnit)
                    cf.addPopup(CyTranslator().getText("TXT_KEY_POPUP_ORTHUS_CREATION",()), str(gc.getUnitInfo(iUnit).getImage()))

        if not CyGame().isOption(gc.getInfoTypeForString('GAMEOPTION_NO_PLOT_COUNTER')):
            cf.doHellTerrain()

        if CyGame().getWBMapScript():
            sf.doTurn()
C:\Users\jonmi\AppData\Roaming\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Fall from Heaven 2\Assets\python\ScenarioFunctions.py
Code:
    def doTurnTheBlackTower(self):
        bSanctuary = False
        if gc.getPlayer(2).isAlive():
            bSanctuary = True
        if gc.getPlayer(3).isAlive():
            bSanctuary = True
        if gc.getPlayer(4).isAlive():
            bSanctuary = True
        if bSanctuary:
            gc.getPlayer(1).changeSanctuaryTimer(1)
        iPlayer = 0 #Falamar
        pPlayer = gc.getPlayer(iPlayer)
        lTechs = ['TECH_FANATICISM', 'TECH_WARHORSES', 'TECH_IRON_WORKING', 'TECH_CONSTRUCTION', 'TECH_ARCHERY', 'TECH_POISONS']
        lUnits = ['UNIT_DONAL', 'UNIT_MAGNADINE', 'UNIT_GUYBRUSH', 'UNIT_BARNAXUS', 'UNIT_GILDEN', 'UNIT_ALAZKAN']
        lCivs = ['CIVILIZATION_BANNOR', 'CIVILIZATION_HIPPUS', 'CIVILIZATION_LANUN', 'CIVILIZATION_LUCHUIRP', 'CIVILIZATION_LJOSALFAR', 'CIVILIZATION_SVARTALFAR']
        for i in range(len(lUnits)):
            iUnit = gc.getInfoTypeForString(lUnits[i])
            if CyGame().getUnitCreatedCount(iUnit) == 0:
                if gc.getTeam(pPlayer.getTeam()).isHasTech(gc.getInfoTypeForString(lTechs[i])):
                    bValid = True
                    for pyCity in PyPlayer(iPlayer).getCityList():
                        pCity = pyCity.GetCy()
                        if (bValid and pCity.getCivilizationType() == gc.getInfoTypeForString(lCivs[i])):
                            pPlayer.initUnit(iUnit, pCity.getX(), pCity.getY(), UnitAITypes.UNITAI_ATTACK, DirectionTypes.DIRECTION_SOUTH)
                            CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_WB_THE_BLACK_TOWER_HERO",()),'',1,gc.getUnitInfo(iUnit).getButton(),ColorTypes(8),pCity.getX(),pCity.getY(),True,True)
                            bValid = False
        cf.doTurnLuchuirp(iPlayer)
Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Fall from Heaven 2\Assets\python\CustomFunctions.py
Code:
    def doTurnLuchuirp(self, iPlayer):
        if gc.getPlayer(iPlayer).getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_BARNAXUS')) > 0:
            py = PyPlayer(iPlayer)
            pBarnaxus = -1
            bEmp1 = False
            bEmp2 = False
            bEmp3 = False
            bEmp4 = False
            bEmp5 = False
            iBarnaxus = gc.getInfoTypeForString('UNITCLASS_BARNAXUS')
            iCombat1 = gc.getInfoTypeForString('PROMOTION_COMBAT1')
            iCombat2 = gc.getInfoTypeForString('PROMOTION_COMBAT2')
            iCombat3 = gc.getInfoTypeForString('PROMOTION_COMBAT3')
            iCombat4 = gc.getInfoTypeForString('PROMOTION_COMBAT4')
            iCombat5 = gc.getInfoTypeForString('PROMOTION_COMBAT5')
            iEmpower1 = gc.getInfoTypeForString('PROMOTION_EMPOWER1')
            iEmpower2 = gc.getInfoTypeForString('PROMOTION_EMPOWER2')
            iEmpower3 = gc.getInfoTypeForString('PROMOTION_EMPOWER3')
            iEmpower4 = gc.getInfoTypeForString('PROMOTION_EMPOWER4')
            iEmpower5 = gc.getInfoTypeForString('PROMOTION_EMPOWER5')
            iGolem = gc.getInfoTypeForString('PROMOTION_GOLEM')

            lGolems = []
            for pUnit in py.getUnitList():
                if pUnit.getUnitClassType() == iBarnaxus :
                    pBarnaxus = pUnit
                elif pUnit.isHasPromotion(iGolem) :
                    lGolems.append(pUnit)
            if pBarnaxus != -1 :
                bEmp1 = bool(pBarnaxus.isHasPromotion(iCombat1))
                bEmp2 = bool(pBarnaxus.isHasPromotion(iCombat2))
                bEmp3 = bool(pBarnaxus.isHasPromotion(iCombat3))
                bEmp4 = bool(pBarnaxus.isHasPromotion(iCombat4))
                bEmp5 = bool(pBarnaxus.isHasPromotion(iCombat5))
            for pUnit in lGolems :
                pUnit.setHasPromotion(iEmpower1, False)
                pUnit.setHasPromotion(iEmpower2, False)
                pUnit.setHasPromotion(iEmpower3, False)
                pUnit.setHasPromotion(iEmpower4, False)
                pUnit.setHasPromotion(iEmpower5, False)
                if bEmp1:
                    pUnit.setHasPromotion(iEmpower1, True)
                if bEmp2:
                    pUnit.setHasPromotion(iEmpower2, True)
                if bEmp3:
                    pUnit.setHasPromotion(iEmpower3, True)
                if bEmp4:
                    pUnit.setHasPromotion(iEmpower4, True)
                if bEmp5:
                    pUnit.setHasPromotion(iEmpower5, True)


Edit: So many things, I feel bad for posting/asking so much. I have noticed (a long time ago, in fact, but always forgot to post about it) that there is a cap on 8 trade routes. Other mods such as Ashes of Erebus or Realism Invictus (if memory serves correctly) have removed that cap, or moved it so high I haven't been able to reach it yet. In FfH2 vanilla/MNAI, it is reached fairly easy, however, which can cause some buildings to miss a large effect they would otherwise have.
For example: You get 3 base trade routes after Trade and Currency are researched. A lighthouse, inn, tavern and obsidian gate all give +1 trade route. Foreign Trade gives +1 in the inland and +2 in coastal cities. The Great Lighthouse gives +2 in each coastal city. This is 8 max for inland cities, which is fine, but 11 out of 8 for coastal cities. For a player having the Great lighthouse (without even Foreign Trade), one of the trade route buildings will not give an additional trade route anymore. If you do have Foreign Trade, 3 of them, or the Great Lighthouse +1 other won't. Is this a deliberate design choice, or a vanilla Civ4 holdover that was never looked at in FfH2?

I am guessing it is a vanilla Civ4 holdover that was never looked at in FfH2.

It looks like that is controlled by this define in Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Assets\XML\GlobalDefines.xml
Code:
    <Define>
        <DefineName>MAX_TRADE_ROUTES</DefineName>
        <iDefineIntVal>8</iDefineIntVal>
    </Define>

The only mods on my computer that include that tag are Rhye's and Fall of Civilization and The Road to War, which both still leave the number at 8. I think those mods copy the whole GlobalDefines.xml whether changing the entries or not, while FfH2 mods instead only include altered tags in a separate GlobalDefinesAlt.xml file.


It should be trivially easy to copy that into Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\More Naval AI\Assets\XML\GlobalDefinesAlt.xml with a higher number like
Code:
    <Define>
        <DefineName>MAX_TRADE_ROUTES</DefineName>
        <iDefineIntVal>100</iDefineIntVal>
    </Define>

You don't even have to worry about consistent tabs/spaces in xml files.
 
Last edited:
I was eliminated via conquest and was given control of the civ that destroyed me. Is this intentional?
No. It does not happen always, I believe. There is commented-out code to open a popup when you're defeated, so that's probably the intended behavior.

lfgr, I have been wondering about doing some minor local modmod-edits as well, and I was thinking if you could include two "moddability" functionalities in the dll: One would be allowing enslavement chance from promotions like in EMM (Slaver trait uses this),
I put this on the TODO list, porting these kind of features from EMM is something I want to do more generally.
the other would be making it possible to have a reduced strength unhappy production (like 1 hammer per 2 unhappy faces) alongside the default 1:1 unhappy production
I'll also put this on the list. Out of curiosity, what do you intend to do? Nerf Calabim?
Also, what decides whether a leader is a "minor" or "major" leader? It seems to me that setting a civ to have access to a certain leader promotes that one from minor to major. But how are leaders linked while unavailable, e.g. for puppet states or revolutions?
It depends. As far as Revolutions and Puppet States are concerned, the game prefers picking "minor" leaders as defined in python/Revolution/RevCivUtils.py. In the pedia, minor leaders are those which are not defined as leaders of any civilization (i.e., selectable by default).
On another note, is it intended that the peace caused by Seven Pines or Corlindale has no timer? This makes it almost worthless to use against people that will auto-declare like Basium vs. Ashen Veil or against a human. I see a possible Corlindale + resurrection exploit for infinite peace if it would give the timer again every time, but for Seven Pines this shouldn't be an issue due to the one-time nature of it - no? And perhaps the Corlindale spell could be adjusted to give the "force peace" timer as well when casted for the first time (but not anymore un successive resurrections and recasts).
I'm not sure if it's intended to allow peace with Basium etc. I'm unsure what the intended gameplay is and hesitant to change it.
Garrim Gyr of the Luchuirp has the perhaps least ever useful trait "Defender", but makes it even worse by not being able to apply it to the golems that usually make up most of the Luchuirp's army. Do you think this is fixable? I believe Golems have no Unitcombat while promotions from leader traits are assigned to specific unitcombats, but is there a way around this to fix the application of the trait for golems?
I agree this is stupid enough to warrant a change; I'll probably use Magister's code.
 
making it possible to have a reduced strength unhappy production (like 1 hammer per 2 unhappy faces) alongside the default 1:1 unhappy production. I don't know anything about how this game's dlls are coded and compiled, so I don't know how much effort this would be. But if it would be an easy inclusion, that would be great. :)

I'll also put this on the list. Out of curiosity, what do you intend to do? Nerf Calabim?
When you do so, can you make sure that such unhappy production bonuses from multiple buildings stack together?

I tried making the temple of the Annointed grant unhappy production (really thinking half a hammer for unhappy would be better), but then found that the Calabim (who are thematically the best fit for that faith) did not get much benefit from it as once the Governor's Manor already granted unhappy production then no other building would grant further unhappy production.

I then realized that bonuses from the Governor's Mannor and Pillar of Chains also don't stack. I think they probably should.


It might also be nice if the unhappy production modifer could be negative, or if you could get such modifiers based on other things like health unhealthiness, or even the revolution index. (I haven't thought that through a lot, but it might be interesting if the Sons of Discord, the religion of Chaos, got bonuses from being less stable.)
 
Last edited:
I put this on the TODO list, porting these kind of features from EMM is something I want to do more generally.
Sounds cool, thanks! :D I have been playing a bit of EMM again lately and while I don't necessarily like all the features it has (like the changed tech tree or some shuffled traits on leaders), which makes me prefer MNAI for the more original FfH2 experience, I think it definitely has some cool ideas as well.
I'll also put this on the list. Out of curiosity, what do you intend to do? Nerf Calabim?
Yeah, that. I always thought it is a pretty cool feature, but Pillar of Chains is a really nice wonder and they basically get that in every city, which I think is a bit much. Plus having Manors at half unhappy production and Pillar of Chains at full makes that wonder more appealing for Calabim themselves, too.
I then realized that bonuses from the Governor's Mannor and Pillar of Chains also don't stack. I think they probably should.
Mechanics-wise I'd be inclined to agree, but I also think that would be really broken when both of them give the full 1 hammer per unhappy.
It depends. As far as Revolutions and Puppet States are concerned, the game prefers picking "minor" leaders as defined in python/Revolution/RevCivUtils.py. In the pedia, minor leaders are those which are not defined as leaders of any civilization (i.e., selectable by default).
I found that code earlier, forgot to update my post since, sorry for that - but thanks for the answer. :D I feel bad for asking for so many things, but do you think the following two things would be possible?
  • Add a new XML tag for "MinorLeader": if that is at 0, have leaders behave as normal, if it is at 1 (and they are assigned to a civ, so it would only take place in modmods, since in FfH2/MNAI they aren't), have them separated from the normal leaders by a slash in the civ list, as it is the case with religious world units vs generic units in the religion overviews:
    1700922915143.png

    Mockup:
    1700923267522.png
  • I don't know how possible or how much work this is at all, since all my searches on CFC or google yielded nothing regarding the topic at all, not even a discussion, but would it be possible to also assign weights to leaders, for being picked in the random selection? So you could have something like (using the Svartalfar above again) Faeryl Viconia leading the Svarts 80% of the time, but 10% of the time it is Rivanna or Volanna each? Or likewise for Sheaim, 45% Tebryn, 40% Os-Gabella and 5% the other three each... you get the idea. :)
I'm not sure if it's intended to allow peace with Basium etc. I'm unsure what the intended gameplay is and hesitant to change it.
Makes sense, no worries :)
I agree this is stupid enough to warrant a change; I'll probably use Magister's code.
Nice! I can confirm that the code works perfectly fine.
 
I feel bad for asking for so many things, but do you think the following two things would be possible?
Don't worry, ask away. Just don't expect to always get a satisfying answer, of course. :)

Add a new XML tag for "MinorLeader": if that is at 0, have leaders behave as normal, if it is at 1 (and they are assigned to a civ, so it would only take place in modmods, since in FfH2/MNAI they aren't), have them separated from the normal leaders by a slash in the civ list
I will have to figure out how to exactly handle minor leaders in XML when I get to the next stage of developing revolutions; so that's not something I want to determine now already.
I'm unsure if showing minor leaders in the pedia is worth the confusion. Maybe as a BUG option.
I don't know how possible or how much work this is at all, since all my searches on CFC or google yielded nothing regarding the topic at all, not even a discussion, but would it be possible to also assign weights to leaders, for being picked in the random selection? So you could have something like (using the Svartalfar above again) Faeryl Viconia leading the Svarts 80% of the time, but 10% of the time it is Rivanna or Volanna each? Or likewise for Sheaim, 45% Tebryn, 40% Os-Gabella and 5% the other three each... you get the idea. :)
This is certainly possible with C++, but too niche to include in MNAI, in my opinion.
 
Don't worry, ask away. Just don't expect to always get a satisfying answer, of course. :)
Understood, and of course :D
I will have to figure out how to exactly handle minor leaders in XML when I get to the next stage of developing revolutions; so that's not something I want to determine now already.
I'm unsure if showing minor leaders in the pedia is worth the confusion. Maybe as a BUG option.
Ah, I was thinking of only adding that functionality for use in modmods (such as EMM), and keeping the vanilla Civilopedia (where the leaders are not playable in the first place) the same.
This is certainly possible with C++, but too niche to include in MNAI, in my opinion.
Alright, thanks for the insight nonetheless! :)
 
Ah, I was thinking of only adding that functionality for use in modmods (such as EMM), and keeping the vanilla Civilopedia (where the leaders are not playable in the first place) the same.
I see, I misread that, sorry. So what you want is simply a marker for otherwise normal leaders, so that these leaders are shown behind a slash in the pedia?
That is something that can easily be done in python, without the hassle of adding a new tag. The leader buttons are drawn in the placeLeader() method in python/Contrib/Sevopedia/SevopediaCivilization.py. You could hard-code your minor leaders there. Let me know if you need help.
 
Top Bottom