Modding discoveries

Irrationally excited. I think I've found a way to propagate a modifier to everyone if a certain civ is in the game.
Code:
 <RequirementSet id="REQSET_1A_NARRATIVE">
        <Requirement xref="REQ_STORY_CIVILIZATION_EGYPT"/>
        <Requirement xref="REQ_STORY_LEADER_HATSHEPSUT"/>
        <Requirement type="REQUIREMENT_COLLECTION_ANY_MET">
            <Argument name="CollectionType">COLLECTION_PLAYER_CAPITAL_CITY</Argument>
            <Argument name="RequirementSetId">SUBREQSET_1A_NARRATIVE</Argument>
        </Requirement>
    </RequirementSet>

(example from narrative-stories-gameeffects.xml). Interested primarily in the REQUIREMENT_COLLECTION_ANY_MET criteria here. Now, there's a COLLECTION_MAJOR_PLAYERS which as best I can surmise, refers to the players themselves, which is prominently used in religion and city-state elements:
Code:
<Modifier id="BONUS_18_NATURAL_WONDER_GOLD" collection="COLLECTION_MAJOR_PLAYERS" effect="EFFECT_ATTACH_MODIFIERS">
        <SubjectRequirements>
            <Requirement type="REQUIREMENT_PLAYER_IS_RELIGION_FOUNDER"/>
        </SubjectRequirements>
        <Argument name="ModifierId">ATTACH_NATURAL_WONDER_GOLD</Argument>
    </Modifier>

Thus, I think the two can be combined to achieve a modifier for someone if any player meets a criteria, specifically if any player is of a certain civilization (
REQUIREMENT_PLAYER_CIVILIZATION_TYPE_MATCHES, args are "CivilizationType").

I think - without testing - to achieve a modifier for all players in a game where Greece is active, this would look something like:
Code:
<Modifier ... collection="COLLECTION_MAJOR_PLAYERS">
     <SubjectRequirements>
         <Requirement type="REQUIREMENT_COLLECTION_ANY_MET">
            <Argument name="CollectionType">COLLECTION_MAJOR_PLAYERS</Argument>
            <Argument name="RequirementSetId">REQSET_CIV_IS_GREECE</Argument>
        </Requirement>
     </SubjectRequirements>
</Modifier>

(REQSET_CIV_IS_GREECE is a requirement set that does the type checking already)

My intended use case here is for a civ I'm experimenting with diverse culture tree mechanics - if this works like how I think it will, I plan to play with a civilization that has some sort of powerful civic tree, and grants a lesser civic tree to all other civs in the age. (just playing with mechanics for now, unsure how that'll flavor)


RE Legacy Paths: That seems to be a no-go. They seem to be fairly hardcoded in and difficult to change for just one player if that's even a possibility. (let alone for anyone - that seems more possible, but I couldn't find a clean way to do it)
 
GlobalParameters are no longer contained within a single XML file - looks like it's split out to the "relevant" files. Here's a dump of the Antiquity Global Parameters.

EDIT: Huh. There's definitely Civ6 artifacts in there.
I can't really find any of them in any of the xmls (using windows search in file contents, so that's not exactly reliable). Eg. I search for what's clearly a civ7 param "ARMY_COMMANDER_MOVEMENT_MODIFIER" in the Modules folder and all subfolders.
1739260198363.png


I can see there is obviously still the GlobalParameters table in the Gameplay DB Schema. Does Civ 7 create a local sqlite db on load? I haven't touched that stuff in years and can't remember if I need to be using debug tools for it or if I'm missing something.
 
I can't really find any of them in any of the xmls (using windows search in file contents, so that's not exactly reliable). Eg. I search for what's clearly a civ7 param "ARMY_COMMANDER_MOVEMENT_MODIFIER" in the Modules folder and all subfolders.
View attachment 719139

I can see there is obviously still the GlobalParameters table in the Gameplay DB Schema. Does Civ 7 create a local sqlite db on load? I haven't touched that stuff in years and can't remember if I need to be using debug tools for it or if I'm missing something.
There are SQLite dbs in the data folder, lending credence to this. It seems that the DB builds both on load and on game start - specifically whatever age you’re playing (that’s why there’s a folder for each age in the modules directory)
 
1739298664968.png

Units without assets have default assets (thank goodness) (same with districts)

EDIT: Apparently it disappears when it's not selected. Shame. Oh well.
 
So - digging into custom leaders as I screw around. Discovered that mementos, legacy paths, all of that each have a DnaId: "93b69f11-cb95-480f-8ead-c7e2feac05d6". My conjecture is that in *theory*, you can come up with whatever DnaID you want for your mods, and it'll propagate across all devices (the DnaId I imagine links to your Firaxis, is a UUID store, and makes sure your legacy paths and progress are synced across all your devices). This is mostly conjecture. I haven't tested omitting it to see if I can make legacy paths without it, but there's a lot of credence, because these DnaIDs aren't mentioned anywhere else, and I don't see any other validation elsewhere.
 
A small annoyance that's caught me off-guard more times than I care to admit:

If you want icons to show up in text strings when modding UI files, be sure to reference the text string via Locale.stylize("text") rather than Locale.compose("text").
 
While I was looking for the Golden age thresholds I was finding it weird that it was only an update statement in Exploration and Antiquity.
It was updating the GlobalParameters table which contains quite a lot of values not present in XML files (or anywhere in the civ7 files) as far as I can tell with a text search (around 10 updates in the data folder through XML).
But this table has 415 entries from the log dump. A few of them appear to be related to civ6 though. Note: this was also found out a few days ago by @thecrazyscot here https://forums.civfanatics.com/threads/modding-discoveries.694816/post-16765971

Here are some of the ones I found in it that look important
ARCHAEOLOGY_SITES_PER_CONTINENT 12
ARCHAEOLOGY_SITES_PERCENT_RURAL 70

For people wanting more spread but you probably will also need to increase the map size
CITY_MIN_RANGE 3

DIPLOMACY_PEACE_MIN_TURNS 10
DIPLOMACY_WAR_MIN_TURNS 10

GOLD_PURCHASE_MULTIPLIER 4

HAPPINESS_URBAN_POP_UPKEEP_BASE 0.0
HAPPINESS_RURAL_POP_UPKEEP_BASE 0.0

Could it be the mastery extra cost ?
PROGRESSION_TREE_NODE_DEPTH_COST_SCALAR 33

Curve values below are updated on exploration and modern
GOLDEN_AGE_HAPPINESS_CURVE_A -2.52999997138977
GOLDEN_AGE_HAPPINESS_CURVE_B 125.0
GOLDEN_AGE_HAPPINESS_CURVE_C -8.1899995803833
GOLDEN_AGE_HAPPINESS_CURVE_D 85.4000015258789
GOLDEN_AGE_PLATEAU_COUNT 7
GOLDEN_AGE_DURATION_IN_TURNS 10

UNIT_FLANKING_BONUS_60 2
UNIT_FLANKING_BONUS_120 3
UNIT_FLANKING_BONUS_180 5
UNIT_ABILITY_SHOCK_BONUS 10

Commander aura range ?
ARMY_BASE_COMMAND_RADIUS 1

(Probably treasure fleets generation)
TREASURE_RESOURCE_GOLD_VALUE 100
TREASURE_RESOURCE_GENERATION_TURNS 8

(specialists)
WORKER_BASE_SCIENCE 2.0
WORKER_BASE_CULTURE 2.0
WORKER_BASE_FOOD -2.0
WORKER_BASE_GOLD 0.0
WORKER_BASE_HAPPINESS -2.0
WORKER_BASE_PRODUCTION 0.0

(age length)
GAME_AGE_LENGTH_STANDARD 200
GAME_AGE_LENGTH_ABBREVIATED 160
GAME_AGE_LENGTH_LONG 240

(some AI stuff)
AI_BASE_LUXURY_VALUE 1.5
AI_CURRENT_TASK_BIAS 80
AI_DISCOUNT_RATE 2.0
AI_ISLAND_COAST_PERCENTAGE 20
AI_TURNS_BETWEEN_FRIENDSHIP_OFFERS 5
AI_TURNS_BETWEEN_PEACE_OFFERS 3
AI_TURNS_BETWEEN_TRADES 10
 
As a side-note, Golden Age in code often refers to Celebration, since it is based on Civ 5 Golden Ages
 
As a side-note, Golden Age in code often refers to Celebration, since it is based on Civ 5 Golden Ages
Also important to note that they seem to use the term Golden Age not just for celebrations, but also the Golden Age policies as well at age transition (if you're just searching the code base)
 
While I was looking for the Golden age thresholds I was finding it weird that it was only an update statement in Exploration and Antiquity.
It was updating the GlobalParameters table which contains quite a lot of values not present in XML files (or anywhere in the civ7 files) as far as I can tell with a text search (around 10 updates in the data folder through XML).
But this table has 415 entries from the log dump. A few of them appear to be related to civ6 though. Note: this was also found out a few days ago by @thecrazyscot here https://forums.civfanatics.com/threads/modding-discoveries.694816/post-16765971

Here are some of the ones I found in it that look important
ARCHAEOLOGY_SITES_PER_CONTINENT 12
ARCHAEOLOGY_SITES_PERCENT_RURAL 70

For people wanting more spread but you probably will also need to increase the map size
CITY_MIN_RANGE 3

DIPLOMACY_PEACE_MIN_TURNS 10
DIPLOMACY_WAR_MIN_TURNS 10

GOLD_PURCHASE_MULTIPLIER 4

HAPPINESS_URBAN_POP_UPKEEP_BASE 0.0
HAPPINESS_RURAL_POP_UPKEEP_BASE 0.0

Could it be the mastery extra cost ?
PROGRESSION_TREE_NODE_DEPTH_COST_SCALAR 33

Curve values below are updated on exploration and modern
GOLDEN_AGE_HAPPINESS_CURVE_A -2.52999997138977
GOLDEN_AGE_HAPPINESS_CURVE_B 125.0
GOLDEN_AGE_HAPPINESS_CURVE_C -8.1899995803833
GOLDEN_AGE_HAPPINESS_CURVE_D 85.4000015258789
GOLDEN_AGE_PLATEAU_COUNT 7
GOLDEN_AGE_DURATION_IN_TURNS 10

UNIT_FLANKING_BONUS_60 2
UNIT_FLANKING_BONUS_120 3
UNIT_FLANKING_BONUS_180 5
UNIT_ABILITY_SHOCK_BONUS 10

Commander aura range ?
ARMY_BASE_COMMAND_RADIUS 1

(Probably treasure fleets generation)
TREASURE_RESOURCE_GOLD_VALUE 100
TREASURE_RESOURCE_GENERATION_TURNS 8

(specialists)
WORKER_BASE_SCIENCE 2.0
WORKER_BASE_CULTURE 2.0
WORKER_BASE_FOOD -2.0
WORKER_BASE_GOLD 0.0
WORKER_BASE_HAPPINESS -2.0
WORKER_BASE_PRODUCTION 0.0

(age length)
GAME_AGE_LENGTH_STANDARD 200
GAME_AGE_LENGTH_ABBREVIATED 160
GAME_AGE_LENGTH_LONG 240

(some AI stuff)
AI_BASE_LUXURY_VALUE 1.5
AI_CURRENT_TASK_BIAS 80
AI_DISCOUNT_RATE 2.0
AI_ISLAND_COAST_PERCENTAGE 20
AI_TURNS_BETWEEN_FRIENDSHIP_OFFERS 5
AI_TURNS_BETWEEN_PEACE_OFFERS 3
AI_TURNS_BETWEEN_TRADES 10
Sorry, I didn't understand. Where are these values found? In which file? It is not an xml right?

Edit: I searched them into all xml files with notepad... but nothing...
 
Last edited:
Sorry, I didn't understand. Where are these values found? In which file? It is not an xml right?

Edit: I searched them into all xml files with notepad... but nothing...
They're in the sqlite debug database, see here. Not sure how globalparameters is populated without being in the xml. Very frustrating. But still moddable.
 
GlobalParameters are no longer contained within a single XML file - looks like it's split out to the "relevant" files. Here's a dump of the Antiquity Global Parameters.

EDIT: Huh. There's definitely Civ6 artifacts in there.
Looks like the GlobalParameter values change from Age to Age as well. Here's a quick list taken from Gedemon's export in https://forums.civfanatics.com/threads/how-to-get-the-gameplay-and-frontend-debug-database.694871/

I've tried searching xml folders specifically for ones that do change, but can't find anything...
 

Attachments

It looks like you can get overall yields of the player using the following javascript:

Code:
const player = Players.get(GameContext.localObserverID);
let yield = player.Stats.getNetYield(YieldTypes.YIELD_TYPE);

Where YIELD_TYPE is one of [YIELD_GOLD, YIELD_DIPLOMACY, YIELD_SCIENCE, YIELD_CULTURE, YIELD_HAPPINESS]

I am currently looking at seeing if I can add extended policy cards from civ 6 to the game but thought this might be useful to anyone looking to use yields.
 
looking for artdef, seems packed, no R.E.D. possible ATM
I'm desperate to see something like R.E.D!
Any idea what's containing artdef equivalent data for Civ7? I think the StandardAsset(_High/Low).blp might be the one we are looking for but they are encoded...
 
Back
Top Bottom