Fixing production of Ancient and Classical units

Lion King

Chieftain
Joined
May 24, 2015
Messages
74
Location
UK
Hi,
During several games people noticed unexplained increase in the speed of producing ancient and classical era units (please see full thread here: http://forums.civfanatics.com/threads/reversed-difficulty-bonuses.602274/). It usually happens when you are close to reaching medieval age.

The boost is huge - on epic speed I experienced about 100% increase. Swordsman cost about 4-5 turns to produce, while crossbowman was 16 turns. For some reason my city production was almost doubled for swordsman - city showed 21 ppt, while every turn my production changed by 42ppt

First I thought there is something wrong with policies - maybe agoge policy was applied even if you don't select it. But then I found the following in log files:

[876417.983] [Turn: 95] Applying effect from <1247:GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER> to <City (65536), Owner: 0, Name: LOC_CITY_NAME_LONDON>.
[876417.983] [Turn: 95] Applying effect from <1247:GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER> to <City (65536), Owner: 1, Name: LOC_CITY_NAME_ATHENS>.
[876417.983] [Turn: 95] Applying effect from <1247:GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER> to <City (65536), Owner: 2, Name: LOC_CITY_NAME_ROME>.
[876417.983] [Turn: 95] Applying effect from <1247:GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER> to <City (65536), Owner: 3, Name: LOC_CITY_NAME_POKROVKA>.

I.e. looks like when somebody selects god of the forge pantheon, it applies to everybody in the game, massively decreasing production costs for everybody.

I checked beliefs.xml and found there are two sets of code for each pantheon, each of them usually contains modifier type, modifier id and requirement id. In case of the god of the forge pantheon second set of code was missing requirement id. So it was:

<ModifierId>GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION</ModifierId>
<ModifierType>MODIFIER_ALL_CITIES_ATTACH_MODIFIER</ModifierType>
<SubjectRequirementSetId>CITY_FOLLOWS_PANTHEON_REQUIREMENTS</SubjectRequirementSetId>
</Row>
<Row>
<ModifierId>GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER</ModifierId>
<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_MILITARY_UNITS_PRODUCTION</ModifierType>
</Row>

I changed it to the following:
<ModifierId>GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION</ModifierId>
<ModifierType>MODIFIER_ALL_CITIES_ATTACH_MODIFIER</ModifierType>
<SubjectRequirementSetId>CITY_FOLLOWS_PANTHEON_REQUIREMENTS</SubjectRequirementSetId>
</Row>
<Row>
<ModifierId>GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER</ModifierId>
<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_MILITARY_UNITS_PRODUCTION</ModifierType>
<SubjectRequirementSetId>CITY_FOLLOWS_PANTHEON_REQUIREMENTS</SubjectRequirementSetId>
</Row>

After this ancient and classical units are no longer extremely cheap. Moreover, you won't see hordes of city-states slingers or catapults just because they are not that cheap anymore - it makes game much more balanced.

I would be grateful if someone can create a mod from it - I am really novice with mod writing and don't want to change manually game files. Also it would be interesting to check the effect of the god of the forge pantheon when it is selected. If I was right, boost is not 25% but about 100%.
 
just posted one, but was just an sql update to address that issue, you may want to do more

Oops didn't see you had already posted one. I did the same in SQL. I can't open .rar files but I assume we both did the same thing. Here's the SQL statement I used:


Code:
UPDATE Modifiers SET SubjectRequirementSetId='CITY_FOLLOWS_PANTHEON_REQUIREMENTS' WHERE ModifierID='GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER' AND ModifierType='MODIFIER_PLAYER_CITIES_ADJUST_MILITARY_UNITS_PRODUCTION' ;
 

Attachments

That's a really great find. Will definitely need to play some games with the fix active and see how it changes the early dynamics.
 
Wow I thought this was some kind of "comeback" mechanic for civs way behind on tech. Guess not ^ ^
 
*Professor voice* Good news, everyone!

I found out that it wasn't just low maintenance cost that caused the AI to spam warriors and slingers. It turns out that almost no military land units had their pseudoflavors set up to point to "combat unit", and builders didn't have their pseudoflavors set up either. The instant I set them, the AI stopped spamming Warriors and Slingers and actually diversified their army! v8 will include the fix, as.

Siesta Guru said:
I hope the allow disband can be made to work and does something interesting. They may have just forgotten to add the UserData thing, with actual code ready in the dll. A simple update of the definitions could do enough.
Way ahead of you, I changed this in v2 of my mod.

Siesta Guru said:
So some good news here, you can at least add items to the operationtypes enum, and I've been able to succesfully use that to create different types of attacks and behaviors. I'm experimenting with a small 'firestarter' operation that basically just declares war with a neighbour if a strategy sets the limit for that operation to 1. Other enums that have no clear meaning may also work.
It would be awesome if we could create pseudoyields, and just slap unique pseudoyields on all combat units.
The problem with this is that there's no inheritence system for pseudoyields, so e.g. if a new pseudoyield is introduced that's meant to be a subcategory of an existing pseudoyield (e.g. combat unit -> unique combat unit), then the only way to get the parent pseudoyield modifiers to trickle down to the child is to manually add them in for the child for every case, possibly breaking compatibility with other mods that alter pseudoyields (e.g. they might alter all combat pseudoyields to renormalize them, but because they haven't accounted for your new pseudoyields, so your new pseudoyields that aren't renormalized will mess with the old pseudoyields that are).
 
Those two mods differ...

  • UPDATE Modifiers SET SubjectRequirementSetId="CITY_FOLLOWS_PANTHEON_REQUIREMENTS" WHERE ModifierId='GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER';
  • UPDATE Modifiers SET SubjectRequirementSetId='CITY_FOLLOWS_PANTHEON_REQUIREMENTS' WHERE ModifierID='GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER' AND ModifierType='MODIFIER_PLAYER_CITIES_ADJUST_MILITARY_UNITS_PRODUCTION' ;


What is the difference?
 
Just tested this in my game. It does delay the unit spam but unfortunately it doesn't stop it in longer games. I think it's a combination of factors. Almost all of the ai's take the policy that allows you to make land units fast. And then once their economy reaches critical mass their territory seems to fill with units overnight. I've been using a trainer to watch exactly what happens. And after a while the ai is literally producing a unit in each of it's cities almost every turn.
 
Does the patch fix this?
Looks like not, I checked the code for GoF pantheon - it was the same as before, so I amended it before having moral suffer of seeing this cheat in my actual game. Although I have a hope that mb Firaxis implemented some additional mechanism which would prevent GoF from spreading to everybody.

Can anybody who played patched version (without mods) confirm if that's still an issue in the game?
 
Code:
UPDATE Modifiers SET SubjectRequirementSetId='CITY_FOLLOWS_PANTHEON_REQUIREMENTS' WHERE ModifierID='GOD_OF_THE_FORGE_UNIT_ANCIENT_CLASSICAL_PRODUCTION_MODIFIER' AND ModifierType='MODIFIER_PLAYER_CITIES_ADJUST_MILITARY_UNITS_PRODUCTION' ;
This line disables production bonus even for cities that follow the pantheon. Maybe they fixed it in dll? From patch notes:
  • Fixed some production Social Policies, Great People, and Pantheon bonuses that were not applying correctly.
 
Last edited:
Back
Top Bottom