Resource icon

Community BugFix Mod 0.9.2

Another problem with the implementation of the Normanic coast bonus.
I am the one on the coast and the Normanic archer on the receiving end stands on very dry land, but still gets the bonus...
 

Attachments

  • Screenshot 2025-03-12 141547.png
    Screenshot 2025-03-12 141547.png
    2.3 MB · Views: 157
I believe that’s a function of how Combat location works in Civ VI and VII. Melee combat occurs in the tile of the defender, ranged combat occurs in the tile of the attacker. Since the attacker is adjacent to coast, it counts as coastal combat. Not sure how we could fix that actually
 
Not sure how we could fix that actually
It's specifically coded that way for the coast bonus of the Normans. Actually there are two effects, one for ranged and one for melee.

The code would need to check if the ranged attacker is actually the Norman and not its opponent, but does not. (The bugfix is more complicated though - because the Norman archer doesn't get the bonus from defending on the coast, as well..)

Spoiler :

<Modifier id="TRAIT_MOD_ADJACENT_TO_COAST_COMBAT" collection="COLLECTION_PLAYER_UNITS" effect="EFFECT_ATTACH_MODIFIERS">
<SubjectRequirements>
<Requirement type="REQUIREMENT_UNIT_DOMAIN_MATCHES">
<Argument name="UnitDomain">DOMAIN_LAND</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="ModifierId">TRAIT_MOD_ADJACENT_TO_MELEE_COMBAT, TRAIT_MOD_ADJACENT_TO_COAST_RANGED_COMBAT</Argument>
</Modifier>
<Modifier id="TRAIT_MOD_ADJACENT_TO_MELEE_COMBAT" collection="COLLECTION_UNIT_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
<SubjectRequirements>
<Requirement type="REQUIREMENT_PLOT_ADJACENT_TO_COAST"/>
<Requirement type="REQUIREMENT_COMBAT_TYPE_MATCHES">
<Argument name="CombatType">COMBAT_MELEE</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="Amount">5</Argument>
<String context="Preview">LOC_MOD_ADJACENT_TO_COAST_COMBAT_DESCRIPTION</String>
</Modifier>
<Modifier id="TRAIT_MOD_ADJACENT_TO_COAST_RANGED_COMBAT" collection="COLLECTION_UNIT_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
<SubjectRequirements>
<Requirement type="REQUIREMENT_ATTACKER_PLOT_ADJACENT_TO_COAST"/>
<Requirement type="REQUIREMENT_COMBAT_TYPE_MATCHES">
<Argument name="CombatType">COMBAT_RANGED</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="Amount">5</Argument>
<String context="Preview">LOC_MOD_ADJACENT_TO_COAST_COMBAT_DESCRIPTION</String>
</Modifier>
 
Hullo, have you looked into naval units losing their pillaging in Exploration? I managed to fix it, would be happy to contribute it to the bugfix mod. In short, when you get the ShipBuilding Mastery tech, you get a modifier that lets all units go into deep water. Including naval units, which already can, but whats the harm right? The harm is this, it stops pillaging working at all for naval units, except under some weird tile conditions. I found a way to fix it though, you just need to change that modifier so it applies to all units without the naval tag:

SQL:
UPDATE Modifiers SET SubjectRequirementSetId = 'MOD_SLTH_ISNT_NAVY_REQS' WHERE ModifierId = 'MOD_TECH_OCEAN_TRAVEL_EMBARKED';

INSERT INTO Requirements(RequirementId, Inverse, RequirementType) VALUES ('MOD_SLTH_ISNT_NAVY', '1', 'REQUIREMENT_UNIT_TAG_MATCHES');

INSERT INTO RequirementArguments(RequirementId, Name, "Value") VALUES ('MOD_SLTH_ISNT_NAVY', 'Tag', 'UNIT_CLASS_NAVAL');

INSERT INTO RequirementSetRequirements(RequirementId, RequirementSetId) VALUES ('MOD_SLTH_ISNT_NAVY', 'MOD_SLTH_ISNT_NAVY_REQS');
I was going crazy trying to understand what would cause this bug !
 
It's specifically coded that way for the coast bonus of the Normans. Actually there are two effects, one for ranged and one for melee.

The code would need to check if the ranged attacker is actually the Norman and not its opponent, but does not. (The bugfix is more complicated though - because the Norman archer doesn't get the bonus from defending on the coast, as well..)

Spoiler :

<Modifier id="TRAIT_MOD_ADJACENT_TO_COAST_COMBAT" collection="COLLECTION_PLAYER_UNITS" effect="EFFECT_ATTACH_MODIFIERS">
<SubjectRequirements>
<Requirement type="REQUIREMENT_UNIT_DOMAIN_MATCHES">
<Argument name="UnitDomain">DOMAIN_LAND</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="ModifierId">TRAIT_MOD_ADJACENT_TO_MELEE_COMBAT, TRAIT_MOD_ADJACENT_TO_COAST_RANGED_COMBAT</Argument>
</Modifier>
<Modifier id="TRAIT_MOD_ADJACENT_TO_MELEE_COMBAT" collection="COLLECTION_UNIT_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
<SubjectRequirements>
<Requirement type="REQUIREMENT_PLOT_ADJACENT_TO_COAST"/>
<Requirement type="REQUIREMENT_COMBAT_TYPE_MATCHES">
<Argument name="CombatType">COMBAT_MELEE</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="Amount">5</Argument>
<String context="Preview">LOC_MOD_ADJACENT_TO_COAST_COMBAT_DESCRIPTION</String>
</Modifier>
<Modifier id="TRAIT_MOD_ADJACENT_TO_COAST_RANGED_COMBAT" collection="COLLECTION_UNIT_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
<SubjectRequirements>
<Requirement type="REQUIREMENT_ATTACKER_PLOT_ADJACENT_TO_COAST"/>
<Requirement type="REQUIREMENT_COMBAT_TYPE_MATCHES">
<Argument name="CombatType">COMBAT_RANGED</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="Amount">5</Argument>
<String context="Preview">LOC_MOD_ADJACENT_TO_COAST_COMBAT_DESCRIPTION</String>
</Modifier>
So, in reply to myself, this code would be an improvement, taking out the Melee Requirement for the first one and adding the line below.
But that leaves a rather problematic, uhm, edge case.

<Modifier id="TRAIT_MOD_ADJACENT_TO_MELEE_COMBAT" collection="COLLECTION_UNIT_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
<SubjectRequirements>
<Requirement type="REQUIREMENT_PLOT_ADJACENT_TO_COAST"/>
</SubjectRequirements>
<Argument name="Amount">5</Argument>
<String context="Preview">LOC_MOD_ADJACENT_TO_COAST_COMBAT_DESCRIPTION</String>
</Modifier>
<Modifier id="TRAIT_MOD_ADJACENT_TO_COAST_RANGED_COMBAT" collection="COLLECTION_UNIT_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
<SubjectRequirements>
<Requirement type="REQUIREMENT_ATTACKER_PLOT_ADJACENT_TO_COAST"/>
<Requirement type="REQUIREMENT_PLAYER_IS_ATTACKING"/>
<Requirement type="REQUIREMENT_COMBAT_TYPE_MATCHES">
<Argument name="CombatType">COMBAT_RANGED</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="Amount">5</Argument>
<String context="Preview">LOC_MOD_ADJACENT_TO_COAST_COMBAT_DESCRIPTION</String>
</Modifier>

The edge case:
Screenshot 2025-03-13 160330.png
Since it's a coast-to-coast attack, both modifiers work now, and I don't know how to make it an either-or. The structure just allows adding them up.
The alternative would be: put the melee requirement back in, but the Normans would miss out on the defensive bonus for ranged units against melee. (This would be pretty much unnoticeable, at least - and it's already happening.)
 
Last edited:
I don't know if the XML supports it, but a common pattern in civ VI was using REQUIREMENT_REQUIREMENTSET_IS_MET. Basically what it does is reference another RequirementSet, to see if its met. In that way you can construct (Is_X AND Is_Y) OR Is_Z.

Was used for a similar case with the Norwegian Berserker, I think so ranged attacks didnt count for their malus on defense.
 
Oh I realised I didn't clarify, having multiple RequirementSets is good since then you can hve one TEST_ANY and another TEST_ALL
 
Managed to fix the Shawnee not getting Culture on Skotes per city state suzerain. Was a oneliner fix.

SQL:
UPDATE DynamicModifiers SET CollectionType='COLLECTION_PLAYER_CONSTRUCTIBLES' WHERE ModifierType= 'MOD_WYEHI_SIMEKOFI_MAWASKAWE_SKOTE_TYPE';

Sadly the problem with the Kespoko Unique infantry getting additional damage on war support applying to both sides, it seems the requirement from GameEffect is targeting the wrong thing with requirements, as even setting the requirement that the player is Shawnee doesn't do anything. This one is a firaxis only fix I suspect.
 
I came across a strange bug that seems like it should be an easy fix.

I noticed that the "Martial Law" and "Propaganda" policies (the second-tier fascist civics) don’t function as intended. As a result, I suspect the equivalent policies for Democracy and Communism might also be affected.

The second-tier civics for ideologies are supposed to provide effects like:
  • A reduction in one attribute across all cities (e.g., -5 Culture)
  • A boost in another attribute across all towns, based on a specific factor (e.g., +1 Production per town for every point invested in the Military attribute, or +1 gold for every point in Commercial attribute)
The problem is that the reduction work as intended, while the boost definitely doesn't; for some strange reason, it's WAY lower than expected (for example, I gained +2 gold while having 10 commercial points spent, or +1 production while I had 3 military point spent).

The possible problem could be that the civics takes the wrong attribute, but it's definitely hard to tell.

Is there someway I can help you to fix this? It would be great if this and previous reported bug could be fixed, I got a really basic skill in programming and would like to help but my main problem is that I've no idea how Civ code works :lol:
 
Brihadeeswara Temple and Machu Pichu only apply their adjacency bonuses to exploration age and ageless buildings (and their specialist yields, even into modern) but do not apply to Modern Age buildings/specialists despite being labeled as ageless wonders

Like the poster above me.. I have a bit of coding experience but no clue how Civ functions behind the scenes.. Searching through the files.. I found something of note in C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VII\Base\modules\age-exploration\data\constructibles.xml

In the <Adjacency_YieldChanges> element both Brihadeeswara and Machu are attributed as 'Age="AGE_EXPLORATION"'. Right underneath that the element <Constructible_WarehouseYields> can be found and the ageless buildings listed within do not contain that 'Age' attribute.

I will delete these attributes and report back.
 
Last edited:
Is there someway I can help you to fix this?
The problem is that there is an effect
EFFECT_CITY_ADJUST_YIELD_PER_ATTRIBUTE
that's used a few times in the files and that's it. What this actually does is "behind the curtain".

They are all structured like this, and there's no obvious mistake (like a typo or something) in it.

<Modifier id="PROPAGANDA_MOD_GOLD_EQUAL_TO_ECON_ATTRIBUTE" collection="COLLECTION_PLAYER_CITIES" effect="EFFECT_CITY_ADJUST_YIELD_PER_ATTRIBUTE">
<SubjectRequirements>
<Requirement type="REQUIREMENT_CITY_IS_TOWN"/>
</SubjectRequirements>
<Argument name="YieldType">YIELD_GOLD</Argument>
<Argument name="Amount">1</Argument>
<Argument name="AttributeType">ATTRIBUTE_ECONOMIC</Argument>
<String context="Description">LOC_TRADITION_PROPAGANDA_DESCRIPTION</String>
</Modifier>
 
Brihadeeswara Temple and Machu Pichu only apply their adjacency bonuses to exploration age and ageless buildings (and their specialist yields, even into modern) but do not apply to Modern Age buildings/specialists despite being labeled as ageless wonders

Like the poster above me.. I have a bit of coding experience but no clue how Civ functions behind the scenes.. Searching through the files.. I found something of note in C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VII\Base\modules\age-exploration\data\constructibles.xml

In the <Adjacency_YieldChanges> element both Brihadeeswara and Machu are attributed as 'Age="AGE_EXPLORATION"'. Right underneath that the element <Constructible_WarehouseYields> can be found and the ageless buildings listed within do not contain that 'Age' attribute.

I will delete these attributes and report back.
This seemed to work except Machu Piccu bonuses on the wharf and shipyard. Sorry for HDR weirdness on screenshot.
 

Attachments

  • civ7templeandmachufix.jpg
    civ7templeandmachufix.jpg
    1.2 MB · Views: 14
Last edited:
The problem is that there is an effect
EFFECT_CITY_ADJUST_YIELD_PER_ATTRIBUTE
that's used a few times in the files and that's it. What this actually does is "behind the curtain".

They are all structured like this, and there's no obvious mistake (like a typo or something) in it.

<Modifier id="PROPAGANDA_MOD_GOLD_EQUAL_TO_ECON_ATTRIBUTE" collection="COLLECTION_PLAYER_CITIES" effect="EFFECT_CITY_ADJUST_YIELD_PER_ATTRIBUTE">
<SubjectRequirements>
<Requirement type="REQUIREMENT_CITY_IS_TOWN"/>
</SubjectRequirements>
<Argument name="YieldType">YIELD_GOLD</Argument>
<Argument name="Amount">1</Argument>
<Argument name="AttributeType">ATTRIBUTE_ECONOMIC</Argument>
<String context="Description">LOC_TRADITION_PROPAGANDA_DESCRIPTION</String>
</Modifier>
I guess it's something behind that "Attribute_Economic" which is not working, like if it's taking something wrong. If I had any idea how to do it, I would try to change reloading the same file but changing everytime the attribute it's taking, to see if it's taking the correct one and how it changes if I change the attribute
 
@bumpyglint
You can try that - but it would likely take a dev one look in the function that does this (but we have no access to) to find the error - so it's a thankless task. Also it's not guaranteed that this is changed in a savegame if you change the file, you may have to start at least a new age for that.

If you'd want to see if this is behaving correctly - you could put the effect into a policy that's available from the start, so you can easily check on the value as it changes in a game.

But it's unlikely that you'd get enough info to fix this.
 
@bumpyglint
You can try that - but it would likely take a dev one look in the function that does this (but we have no access to) to find the error - so it's a thankless task. Also it's not guaranteed that this is changed in a savegame if you change the file, you may have to start at least a new age for that.

If you'd want to see if this is behaving correctly - you could put the effect into a policy that's available from the start, so you can easily check on the value as it changes in a game.

But it's unlikely that you'd get enough info to fix this.
The point is that I've no idea how to perform these fixes :lol: anyway yes,we must just hope a Dev will fix it I guess...so probably it will never work
 
I’ve been using this mod for a while now and love it. However in my last game during Exploration, the Evangelism policy stopped having an impact on civilian movement, eg scouts still only 2 MP.

(only other mod I use is the RHQ better AI mod, which hasn’t changed. Start and play thru with both mods, no changing mods mid game or anything like that)

When I click on load game, on right side on screen, both mods show as active. That’s my only way of verifying if the mod is on. But then if Evangelism change isn’t coming thru , that makes me question if the mod is indeed on… any ideas?

@PoundedChicken
 
Do any of the attributes into yields functions work as intended? if so I could have a dive and see whats the difference between that and the broken ones
 
Do any of the attributes into yields functions work as intended? if so I could have a dive and see whats the difference between that and the broken ones
I tried the 2 fascist ones and both didnt work (I should have had something like +10, received just something around +2).
I didnt try the other ones, also because obviously you can't unlock them in the same match
 
I had an idea and took a look into balance_identity.csv in the logs to see if the attribute values are read correctly.

And guess what - it resets the count at the start of the age, so I wouldn't be surprised if it wouldn't count them correctly in a game function either. (Assuming the game goes to the same source data.)

I've attached the file for anyone who can read those things - scroll down to the point where the turn resets to 0 (the transition point obviously) - it suddenly counts 0 attributes for all types and players.
 

Attachments

I had an idea and took a look into balance_identity.csv in the logs to see if the attribute values are read correctly.

And guess what - it resets the count at the start of the age, so I wouldn't be surprised if it wouldn't count them correctly in a game function either. (Assuming the game goes to the same source data.)

I've attached the file for anyone who can read those things - scroll down to the point where the turn resets to 0 (the transition point obviously) - it suddenly counts 0 attributes for all types and players.
..........I continue to find it incredible that they've never tested stuff like this, or that they tested it and completely ignored them....

Don't know if @PoundedChicken is still with us? If I can help studying how to fix these bugs I can try even if I don't know how to mod
 
Back
Top Bottom