Thanks, you've got everything right, I'll just do some more clarification and try to explain a bit more the relation between the database and the code.
But first I'll start by an important entry I've forgotten in the table for Culture Groups that your post has reminded me of (you'll see why it did just after)
Code:
Ethnicity = 'ETHNICITY_SOUTHAM'
Where
Ethnicity can be one of those:
- ETHNICITY_SOUTHAM
- ETHNICITY_EURO
- ETHNICITY_MEDIT
- ETHNICITY_ASIAN
- ETHNICITY_AFRICAN
This is required to allow the mod's code to pick an unused Civilization (I'll reserve some "blank" CS and Major Civilization slots at the start of the game) that has an ArtStyle that will fit the Culture Group if it spawn a city.
All historical CGs and Civs requires an Earth map
Yes, that was the initial plan (with the requirement of YnAMP for its database) but I'm also thinking of possible solution for other (default or custom) map scripts. The Ethnicity entry in the Civilizations table allow to group all of them on any map (as per the option already available in YnAMP), and that could be used in the same way to spawn the CG-related features near Civilization of the same Ethnicity.
Note that we could add a few more entries, but not many.
The Affinity table can also be used to group Civilization and CG locations by affinities.
All CG's would be scripted
... to spawn in a date intervall, in a defined region (or near specific Civilization)
but they could be triggered by certain conditions (like conquest or religion)
not with the current organization of the CG tables.
About the way the data is presented in the mod, I'm trying to do it in a way that would allow modmod (and easier data management for the development)
For example, there are a few tables related to the relation between units, their equipment and their "PromotionClass", ie the "upgrade path"
Those tables can be edited by another mod using a higher load order than this mod, which could allow, for example, anyone to make a compatibility mod between this one and Allein's "Relive World Wars" mod or any of the mods adding more units to integrate them in this mod's units tree or completly replace it, and use the equipment/upgrade mechanism of this mod.
The rules to apply upgrade/downgrade based on equipment are relatively easy to formulate, and there are not many, so the organization of the tables is also relatively simple (see
https://github.com/Gedemon/Civ6-GCO/blob/master/Data/Equipment.xml), but the code to use that data is so complex that I've trouble to understand it myself (search "equipment" in
https://github.com/Gedemon/Civ6-GCO/blob/master/Scripts/GCO_UnitScript.lua)
And that's for a few simple rules.
Last time I tried to add a (seemingly simple) modification like allowing the Tercio to have two different weapons, because my current code fails at handling that, I've almost burnt myself out struggling to find a solution.
The current organization of the table related to CG give the code the following information: date, location, affinities, and ethnicity
We can add more information, we may have to, but it can become extremly complex very quickly, even more if the rules start to be complex.
I've tried to put some thoughts on it, but I still don't see how to organize the data in XML to allow the checks and calls in the code for renaming "Egypt" to "Ptolemaic Kingdom" with the proposed rules.
The very first step would be to determine what conditions we'll have to check for all cases we want to handle, then how many column/table we need to store the related data.
Civilizations wouldn't have their own CG, but rather a Civ's "culture" would indicate the control over plots, meaning political/military power. The point is to allow multi-cultural Civs.
I suppose we could call it "national identity", but it will be represented and act as the other CG on the map. Owning a plot will be determined by the Civilization that has the bigger value for its own CG on it (or maybe its affinities with the other CG on the plot not related to another Civilization, when they are dominant, which should always be the case at the beginning of the game)
Civilizations would initially be linked to one CG, its dominant culture.
Multiples CG, using affinities values.
Its own CG, the "National Identity" as I see it, won't be dominant until later eras and Nationalism. We may have to code something to limit it in earlier Eras BTW.
Cities in your Civ, where the Civ's (dominant) CG is in minority, are more likely to break free. Such cities would spawn their own Civilization.
Yes, but the major factor is the Civilization relations with the dominant CGs in the city, that are initially set by Affinity, but will change based on actions, diplomatic relations in case of other Civilizations CG and the "happiness" level in the city (based on fulfilling population needs), knowing that the Civilization own CG could trigger a revolt in case of unhappiness, and that a special CG called "independantist" will be generated in cities far from the Empire capital, with higher requirements for "hapiness".
Fulfilling some scripted conditions, would allow spawning of historical Civs
yes, conditions being based on date/location ATM...
In order to spawn USA, there would need to be a majority of English/English-American CG on the North American continent.
... so not with the current design, but I've not looked at how to differentiate post-colonial Civilizations from the others in the spawning mechanism (meaning that at this moment it's just date/location for them too)
If you want to keep abstract Civs (like Greece) without having us/me spend time coming up with historical names and conditions, then I could still link the Civ to the CGs that I've already defined.
Linking the civs to the CGs is one of the roles of the Affinity table, using positive values.
The role of the <SpawnCivilization> tag in the CultureGroups table is very specific: to force a CG-related feature to be placed on the exact Civilization's Starting Position some time before this Civilization spawning date.
The Affinity table would be presented this way (slightly edited since the previous examples)
Code:
<CultureGroupAffinities>
<Row CultureGroup="CULTURE_BALTS"AffinityWith="CULTURE_GERMANS" Value="15"/>
<Row CultureGroup="CULTURE_BALTS"AffinityWith="CIVILIZATION_GERMANY" Value="15"/>
</CultureGroupAffinities>