• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

Tweak Mod for Xtended + Master of Mana Updates

Hiho,
first, it is great to see that Development on this wonderful mod continues! Thank you for that.

For your Survey:
1) I go with Sephi. The player should be able to remove it if they want, but the AI should better not do that. If that is not possible, then better let it stay non-removable :)
2) Similar to 1. The player should be able to I would say. Dumb Decisions should be possible as well, haha. But I never played the map, so I cant give a bigger insight.
3) Sounds like a bug. If it is in the city radius, it should give the bonus. Even if the city is on top of it :)

Here are some loose "wishes" from me.
I play the most mostly with a friend in team on super high difficulties for context.
a) I would find it very cool if global Enchantments and the Rituals etc of faith are bound to the player and not the team. At the moment, if one player activates one, both have it and must pay for it. Also makes for example Illians impossible to play in a Team, asthe other player automatically cancels all Illian Enchantments :)
b) It would be cool if the AI is a bit more aggressive with the Babarian camps. At the moment, they just most often feed them and let them get to ridiculous strengths like over 70 base xD
c) Well, Varity is always awesome. Dont know how easy it would be to add new Leaders to existing factions. But thats just very low on the list.
d) I once made 2 Modules for the mod, posted in this forum. If you want, you can use them and modify them. One is a animal focussed one, the other is a slave focussed one. The slaver one seems to have a bug with the "Settle" Slave mechanic that I was never able to resolve...

Thanks again for the awesome work!
About a)
No cant do... Code is too much bound to the team and as such I am not willing to make the huge work into redesigning completely at player level. On the other hand, I tested a match in team with illians who can cast samhain and the white hand with no issue... Which enchantment are you referring to?
 
About a)
No cant do... Code is too much bound to the team and as such I am not willing to make the huge work into redesigning completely at player level. On the other hand, I tested a match in team with illians who can cast samhain and the white hand with no issue... Which enchantment are you referring to?
It's a bit since I last played Illians, but as far as I remember, the Enchantment Rituals of the Illians were castable but automatically were canceled after some turns. That only happened when we played as a team.
 
Hi all!
V0.5 has been released, thank you all for your contributions!

We are eager to hear your feeling about AI! Still there are some strange behavior on the stack used to attack, but it seems that AI can expand quicker and have more tech research then before.
Collateral issue is related to the city revolt that from time to time can happen, maybe something can be done on v0.6 ....

Save Game are not compatible with previous version, and also note that now:
- Aggressive AI option will tell the AI to start a warplan to the nearest weakest civ, regardless of attitude
- Climate map allow to found city everywhere, if you want to revert please set CLIMATE_MAP_ALLOW_FOUND_NO_FOOD to 0 in GlobalDefinesAlt.xml
- You can now destroy / found city over lost temple, mana shrine etc... (AI cannot)
- Plot wilderness is shown while hoovering the mouse on the plot, for who does not like it,set SHOW_WILDERNESS_INFO to 0 in GlobalDefinesAlt.xml
 
I seem to be seeing more frequent crashes to desktop on v0.5 than in v0.4. I have yet to narrow it down to anything and it never happens again after reloading. I will play my next game without "reloading random seed" each time which makes it easier to test.

It may be because the game is better and kinda my own fault for map setup. I have a Giant map w/ lots of space and 25 civs. There are definitely more cities/units around so it could just be memory limits as it seems to crash with increasing frequency after turn ~200 and then after playing a bit again.

No new bugs so far! Been playing with the forts a bit and they seem to be working, too.
 
There may be a bug in Enchanted Forest. Casting without selection a location seems to not do anything. I know it was working in the past. Unsure if this applies to any other spells beyond this and Mystical Forest. Will test out when I get that far.

Selecting a location still works. However, this only applies to one tile and I think it would target a 3-5 otherwise. It also doesn't seem to subtract any Faith. Uncertain if this is on purpose because it is targeted or also related to any bug in the spell.
 
Last edited:
(v0.5)
Getting a constant crash-to-desktop, when the next turn is being calculated in my current Khazak Game. New random seed on reload is on.

I have added the save to this post. Gonna go into worldbuilder to find out what causes it. If i find anything, ill report it.

edit 1: When i remove the Mercurian Civilization with Basium from the world via Worldbuilder, the CTD does not happen.
 

Attachments

Last edited:
Playing now second game of v0.5.
AIs are doing well. They found more than three cities before turn 150 unless surrounded by other civs or badlands(dark moor, hell terrains...). I feel they capture barbarian cities and lairs way more earlier and easier than before. Their units are promoted more diversely and it's good to see Defense discipline Firebows, Seekers or Brutes ;)
No crash at all so far. I usually play with Human size map and 11~12 civs.

Summon: allow summon only if are Tier 3 or 4 or are greater Tier then other available unit
I felt Ljosalfar summoned too many wolves previously but I think I have not seen them having Dire Wolf in these two games of v0.5.
 
While at war with Balseraphs, they casted GE Frenzy. I casted minor disjunction twice and disjunction three times but all failed in dispelling. Just bad luck or a bug...:confused:
Then after I capitulated them, the hostile GE disappeared immediately.
 
The AI is definitely expanding which is good. At times I see them expanding too fast and losing cities to revolts from a lack of gold. There may need to be a rule/adjustment to avoid them expanding when their gold income is starting to fall. For example, a civ had 9 cities and has lost two of them to revolt. So it probably isn't part of the first X cities but more about expanding after growing the economy.
 
Have a consistent crash to desktop with the attached save. I am at war with the Clan of Embers just south of my lands.

Narrowing Down w/ World Builder:
  • Destroy all Clan units - crashes
  • Destroy all Clan cities except capital - crashes
  • Destroy Clan capital - crashes
  • Removed both forts on border - crashes
  • Destroy all Clan cities - Works
  • Make peace with Clan - Works
I enabled debug logging but did not see anything obviously wrong but I am by no means an expert in reading the logs of this application.

Only interesting events is that the Clan immediately declares war on another Civ right after making peace. No idea if this is related.
 

Attachments

Hello.I stumbled upon weird bug - barbarian stacks have different STR for same units i.e. stack of goblin archers in a lair (goblin fort iirc) have 7 str per unit and some random wandering goblin archers have 48. I got roamed by basic frostlings with 23 str and in early stages of the game these stacks are hard to beat.During barbarian events when a lot of savages spawn they have about 9 str and totally a pushover stacks compared to some random barb stacks that put down empires coz overpowered for some reason.Is this issue with "raging barbarians" or "agressive ai"?
Sshots are from the same turn but different place like waaaat
 

Attachments

  • 11.jpg
    11.jpg
    126.3 KB · Views: 20
  • 22.jpg
    22.jpg
    234.3 KB · Views: 19
Last edited:
Hello.I stumbled upon weird bug - barbarian stacks have different STR for same units i.e. stack of goblin archers in a lair (goblin fort iirc) have 7 str per unit and some random wandering goblin archers have 48. I got roamed by basic frostlings with 23 str and in early stages of the game these stacks are hard to beat.During barbarian events when a lot of savages spawn they have about 9 str and totally a pushover stacks compared to some random barb stacks that put down empires coz overpowered for some reason.Is this issue with "raging barbarians" or "agressive ai"?
Sshots are from the same turn but different place like waaaat

I believe the general growth is by design. I have found parts of the code but have not looked through it in any depth to know all of the rules. Below are two of the key snippets if you want to dig around in there yourself. Others may have documentation on the behaviors.

That said, I have seen a but where a barbarian ends up with a crazy promotion, like +10000% vs. recon units, and have no idea where it came from so not sure if that is related to your issue.

The following in CvDungeon.cpp seems to look at the attitude at change strength of the units. Not sure why having a positive attitude would increase the strength nor where getPowerChange() is set as part of the event. The XML files track the types of responses you make, like taunting, so I assume it effects the strength/attitude.

C++:
void CvDungeon::ResolveDeal(PlayerTypes ePlayer, DungeonEventTypes eEvent)
{
    CvDungeonEventInfo& kEvent = GC.getDungeonEventInfo(eEvent);
    CvPlayer& kPlayer = GET_PLAYER(ePlayer);
    int iGold, iMetal, iLeather;

    if(kEvent.isPositive()) {
        IncreaseAttitude(ePlayer);
        changePowerTimes1000(200); // 0.2 in Unitstrength increase
        kPlayer.displayText(gDLL->getText("TXT_KEY_DUNGEONEVENT_ATTITUDE_INCREASE", GC.getAttitudeInfo(getAttitude(ePlayer)).getDescription()));
    }
    else {
        DecreaseAttitude(ePlayer);
        kPlayer.displayText(gDLL->getText("TXT_KEY_DUNGEONEVENT_ATTITUDE_DECREASE", GC.getAttitudeInfo(getAttitude(ePlayer)).getDescription()));
    }

    if(kEvent.getPowerChange() != 0) {
        changePowerTimes1000(kEvent.getPowerChange());
    }
   
    ...

This is the setting function. You can see it uses the game speed/turns to change the strength too. Then it goes through all of the units/nodes to change the combat strength. I think this applies to each Dungeon separately so you can end up with similar units of varying strength. It could also depend on how long the units have been wandering around based on game length.

C++:
void CvDungeon::changePowerTimes1000(int iChange)
{
    if(iChange != 0) {
        int m_iOld = m_iPower;
        m_iPower += iChange * 100 / std::max(1, GC.getGameSpeedInfo(GC.getGame().getGameSpeedType()).getBarbPercent());

        m_iPower = range(m_iPower, 0, 10000);

        int iUnitPowerChange = (m_iPower / 1000) - (m_iOld / 1000);
        //Update Power of Units on Plot
        if(iUnitPowerChange != 0) {
            if(isOOSLogging())
            {
                oosLog("Dungeon"
                    ,"Turn:%d,Dungeon:%S,ID:%d,X:%d,Y:%d,Attitude:%d,OldPower:%d,NewPower:%d"
                    ,GC.getGameINLINE().getElapsedGameTurns()
                    ,GC.getImprovementInfo(plot()->getImprovementType()).getDescription()
                    ,getID()
                    ,getX()
                    ,getY()
                    ,getAttitude((PlayerTypes)0)
                    ,m_iOld / 1000
                    ,m_iPower / 1000
                );
            }
            CLLNode<IDInfo>* pUnitNode = plot()->headUnitNode();
            while (pUnitNode != NULL)
            {
                CvUnit* pLoopUnit = ::getUnit(pUnitNode->m_data);
                pUnitNode = plot()->nextUnitNode(pUnitNode);
               
                pLoopUnit->setBaseCombatStr(pLoopUnit->baseCombatStr() + getPower());
                pLoopUnit->setBaseCombatStrDefense(pLoopUnit->baseCombatStrDefense() + getPower());
            }
        }
    }
}
 
I believe the general growth is by design. I have found parts of the code but have not looked through it in any depth to know all of the rules. Below are two of the key snippets if you want to dig around in there yourself. Others may have documentation on the behaviors.

That said, I have seen a but where a barbarian ends up with a crazy promotion, like +10000% vs. recon units, and have no idea where it came from so not sure if that is related to your issue.

The following in CvDungeon.cpp seems to look at the attitude at change strength of the units. Not sure why having a positive attitude would increase the strength nor where getPowerChange() is set as part of the event. The XML files track the types of responses you make, like taunting, so I assume it effects the strength/attitude.

C++:
void CvDungeon::ResolveDeal(PlayerTypes ePlayer, DungeonEventTypes eEvent)
{
    CvDungeonEventInfo& kEvent = GC.getDungeonEventInfo(eEvent);
    CvPlayer& kPlayer = GET_PLAYER(ePlayer);
    int iGold, iMetal, iLeather;

    if(kEvent.isPositive()) {
        IncreaseAttitude(ePlayer);
        changePowerTimes1000(200); // 0.2 in Unitstrength increase
        kPlayer.displayText(gDLL->getText("TXT_KEY_DUNGEONEVENT_ATTITUDE_INCREASE", GC.getAttitudeInfo(getAttitude(ePlayer)).getDescription()));
    }
    else {
        DecreaseAttitude(ePlayer);
        kPlayer.displayText(gDLL->getText("TXT_KEY_DUNGEONEVENT_ATTITUDE_DECREASE", GC.getAttitudeInfo(getAttitude(ePlayer)).getDescription()));
    }

    if(kEvent.getPowerChange() != 0) {
        changePowerTimes1000(kEvent.getPowerChange());
    }
  
    ...

This is the setting function. You can see it uses the game speed/turns to change the strength too. Then it goes through all of the units/nodes to change the combat strength. I think this applies to each Dungeon separately so you can end up with similar units of varying strength. It could also depend on how long the units have been wandering around based on game length.

C++:
void CvDungeon::changePowerTimes1000(int iChange)
{
    if(iChange != 0) {
        int m_iOld = m_iPower;
        m_iPower += iChange * 100 / std::max(1, GC.getGameSpeedInfo(GC.getGame().getGameSpeedType()).getBarbPercent());

        m_iPower = range(m_iPower, 0, 10000);

        int iUnitPowerChange = (m_iPower / 1000) - (m_iOld / 1000);
        //Update Power of Units on Plot
        if(iUnitPowerChange != 0) {
            if(isOOSLogging())
            {
                oosLog("Dungeon"
                    ,"Turn:%d,Dungeon:%S,ID:%d,X:%d,Y:%d,Attitude:%d,OldPower:%d,NewPower:%d"
                    ,GC.getGameINLINE().getElapsedGameTurns()
                    ,GC.getImprovementInfo(plot()->getImprovementType()).getDescription()
                    ,getID()
                    ,getX()
                    ,getY()
                    ,getAttitude((PlayerTypes)0)
                    ,m_iOld / 1000
                    ,m_iPower / 1000
                );
            }
            CLLNode<IDInfo>* pUnitNode = plot()->headUnitNode();
            while (pUnitNode != NULL)
            {
                CvUnit* pLoopUnit = ::getUnit(pUnitNode->m_data);
                pUnitNode = plot()->nextUnitNode(pUnitNode);
              
                pLoopUnit->setBaseCombatStr(pLoopUnit->baseCombatStr() + getPower());
                pLoopUnit->setBaseCombatStrDefense(pLoopUnit->baseCombatStrDefense() + getPower());
            }
        }
    }
}
Ah so that was intentional feature not a bug. Good to know. I'll check this out. Thanks for detailed explanation ☺️
 
Thanks for the wondeful
Have a consistent crash to desktop with the attached save. I am at war with the Clan of Embers just south of my lands.

Narrowing Down w/ World Builder:
  • Destroy all Clan units - crashes
  • Destroy all Clan cities except capital - crashes
  • Destroy Clan capital - crashes
  • Removed both forts on border - crashes
  • Destroy all Clan cities - Works
  • Make peace with Clan - Works
I enabled debug logging but did not see anything obviously wrong but I am by no means an expert in reading the logs of this application.

Only interesting events is that the Clan immediately declares war on another Civ right after making peace. No idea if this is related.
Load the attached save, pass turn... no crash happening...
Strange... can anyone else confirm if they can reproduce the crash?
 
(v0.5)
Getting a constant crash-to-desktop, when the next turn is being calculated in my current Khazak Game. New random seed on reload is on.

I have added the save to this post. Gonna go into worldbuilder to find out what causes it. If i find anything, ill report it.

edit 1: When i remove the Mercurian Civilization with Basium from the world via Worldbuilder, the CTD does not happen.
That was tough... But it has been fixed, you can find a dll here for you to resume your game ;-)
https://sourceforge.net/projects/masterofmanatweaks/files/CvGameCoreDLL.dll/download
 
Thanks for the wondeful

Load the attached save, pass turn... no crash happening...
Strange... can anyone else confirm if they can reproduce the crash?
I made a clean install of 0.5, then loaded save. after pressing end turn it crashed after about 5 seconds. Maybe you already fixed problem in your local version? Or maybe not happening always. Or maybe memory problem, save has map size giant after all. But memory problem should not appear that fast after loading the save, it would be extremly bad luck.
 
Load the attached save, pass turn... no crash happening...
Strange... can anyone else confirm if they can reproduce the crash?
I made a clean install of 0.5, then loaded save. after pressing end turn it crashed after about 5 seconds.
No crash here. Proceeded to the next turn...

Hmm weird that it happens to some and not others. 2GB memory limit on clean install? Although I guess everyone is using prepatched Steam and GoG copies these days so that shouldn't be an issue.. Might be worth checking what OS's the crash people have and the no crash people have.

I just tried the save with a freshly downloaded MoM 0.5 on my Steam copy of Civ4 on Win 7.. no crash.. went to next to turn and asked me about some Barbarians.
.
 
Last edited:
Back
Top Bottom