XML data files for Standard Civilizations (inc DLC)

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,713
Location
Near Portsmouth, UK
Creating a new Civilization is the first thing most budding modders wish to do, but it is probably one of the hardest things to actually achieve (as there are so many parts that have to be done exactly right). A single error will cause the entire new Civilization to just not work - which can be very disheartening.

One of the most common mistakes is to not give your new civilization (at least) two uniques (units, buildings and/or improvements) - failing to do so will cause the game setup screens to crash. Also, new to G&K are spy names and failing to allocate these to your civilization will cause the game to crash as you enter the Renaissance era.

While there is a guide to adding a new civilization, it is now out-of-date and inaccurate, so a lot of responses to the question "How do I create a civ" tend to include the sage advice "Download one and use that as a template"

But which one? The obvious ones are those in the standard game or DLC - as surely they must be correct. But they are not arranged by civilization (ie civ data, leader, trait, uniques, etc) but all leaders are lumped together in one file, all units in another, and with all the various supporting tables it is far from obvious what you need to copy to get "the complete civ".

This zip file address those issues. Within it you will find one sub-folder per civ (eg America, Arabia, Austria, Aztec, Babylon, etc) and within each civ specific sub-folder you will find (up to) six files - Civilization.xml, Leader.xml, Trait.xml, Units.xml, Buildings.xml and Improvements.xml

  • Civilization.xml - The main <Civilizations> table entry, all associated secondary tables (eg Civilization_CityNames, Civilization_FreeTechs, Civilization_FreeBuildingClasses, etc), PlayerColors and Colors table entries and all associated text strings
  • Leader.xml - The main <Leaders> table entry, all associated secondary tables (eg Leader_MajorCivApproachBiases, Leader_Flavors, etc) and all associated text strings
  • Trait.xml - The main <Traits> table entry, all associated secondary tables (eg Trait_YieldChanges, Trait_FreePromotions, etc) and all associated text strings
  • Units.xml - The main <Units> table entry, all associated secondary tables (eg Unit_FreePromotions, Unit_Flavors, etc) and all associated text strings. If a civ has two UUs they will appear one after the other in this file (making it easier to split them apart).
  • Buildings.xml - The main <Buildings> table entry, all associated secondary tables (eg Building_ClassesNeededInCity, Building_Flavors, etc) and all associated text strings. (Only present if the civ has a UB)
  • Improvements.xml - The main <Improvements> table entry, all associated secondary tables (eg Improvement_Yields, Improvement_ValidFeatures, etc) and all associated text strings. (Only present if the civ has a UI)

IMPORTANT NOTES:
  1. If a secondary table is not used by the civilization a comment placeholder has been added for it.
  2. Every column is included, even if it just contains the default value
  3. Text strings are en_us only and main body text from the Civilopedia has been replaced by placeholders
  4. The zip does NOT contain any artwork

(These files were generated by a Java program directly accessing the SQLite database, and so are very easy to regenerate if needed.)

Download Civilizations (GK)
Download Civilizations (BNW)
Download Units
Download Buildings
Download Improvements
 
So how do I use these files?

We will create an outline civ using them

  • Civilization: Wales - based on Celts
  • Leader: Owain Glyndwr - based on Boudicca
  • Trait: Land of our Fathers - bonus in hills, a bit like the Incan "Great Andean Road" trait
  • Unique Unit: Welsh Bowman (replaces Archer) - based on the Babylonian Bowman
  • Unique Building: Eisteddfod (replaces Amphitheater) - based on the Ceilidh Hall
IMPORTANT NOTE:Every civilization MUST have (at least) TWO UNIQUES (units, buildings or improvements) otherwise the game setup screens will crash.

Using ModBuddy, create a new mod called "Civilization - Wales"
Add a sub-folder called "XML"
To the XML sub-folder add
  • from the Celts sub-directory the Civilization.xml, Leader.xml and Buildings.xml files
  • from the Inca sub-directory the Trait.xml file
  • from the Babylon sub-directory the Units.xml file
For each XML file add an OnModActivated->UpdateDatabase action

We now need to do some case-sensitive search and replace operations,
  • "CELTS" with "WELSH" (search all the xml files but it should only be in Civilization.xml)
  • "LEADER_BOUDICCA" with "LEADER_GLYNDWR" (should only be in Civilization.xml and Leader.xml)
  • "LEADERS_BOUDICCA" with "LEADERS_GLYNDWR" (should only be in Leader.xml)
  • "TRAIT_FAITH_FROM_NATURE" with "TRAIT_LAND_OF_OUR_FATHERS" (should only be in Leader.xml)
  • "TRAIT_GREAT_ANDEAN_ROAD" with "TRAIT_LAND_OF_OUR_FATHERS" (should only be in Trait.xml)
  • "CELT_PICTISH_WARRIOR" with "WELSH_BOWMAN" (should only be in Civilization.xml)
  • "BABYLON_BOWMAN" with "WELSH_BOWMAN" (should only be in Units.xml)
  • "BABYLONIAN_BOWMAN" with "WELSH_BOWMAN", but do NOT replace the <UnitArtInfo> entry (should only be in Units.xml)
  • "CEILIDH_HALL" with "EISTEDDFOD" (should only be in Civilization.xml and Buildings.xml)

In Civilization.xml change
  • Civilization_UnitClassOverrides for the Welsh Bowman to UNITCLASS_ARCHER
  • Civilization_BuildingClassOverrides for the Eisteddfod to BUILDINGCLASS_AMPHITHEATER
  • Civilization_Start_Region_Priority to REGION_HILLS
  • Change the first (capital) city name to Machynlleth
  • COLOR_PLAYER_WELSH_ICON to (RGB) 0.996, 0.0, 0.0 (bright red)
  • COLOR_PLAYER_WELSH_BACKGROUND to (RGB) 0.0, 0.427, 0.0 (darkish green)
NOTE: The RGB values are not the usual 0 to 255 values, but 0.0 to 1.0 values. To convert from the more usual values divide by 255 and round to 3 decimal places, eg 218 is 218/255 = 0.8549019607843137 so use the value 0.855

In each of the XML files, correct any "short" text strings (eg change "Leader of the Celts" to "Prince of Wales") (At this point you're just trying to get enough basic text correct to be able to verify the civ in game, don't worry about getting the exact born/died years just yet, you can come back and change those later, once you know the civ is functioning.)


Build the mod and start Civ5
Enable the mod and start a new game as the civ
  1. Check the database.log and xml.log files for errors - see http://forums.civfanatics.com/showthread.php?t=487482 (and please don't bother asking questions if you haven't done this and checked the log files!!!)
  2. In the Civilopedia check that the following are present and (basically) correct
    • Welsh Civilization
    • Owain Glyndwr
    • Welsh Bowman
    • Eisteddfod
  3. Make sure the colours of your units are correct
  4. Settle your capital (check it's name) and check that units have the movement advantage for hills



You (should) now have a working base civ that you can play test as you add features/functionality.
 

Attachments

  • WelshCiv.jpg
    WelshCiv.jpg
    89.3 KB · Views: 45,241
You now have a working outline civ. It needs a lot more work, but at least it works :D

Add features/functionality bit by bit (and not in one huge lump) as it's far easier to trouble shoot small focused changes than large wide-sweeping ones!

You still need to
  • Write the DawnOfMan text (and remove the donor DoM sound reference)
  • Set appropriate approach/bias/flavour values for the leader
  • Complete the trait
  • Complete the definitions of the unique units, buildings and/or improvements
  • Provide a list a city names
  • Provide a list of spy names
  • Write all the Civilopedia entries
  • Create icon atlas graphics (sizes) for the Civilization (256, 128, 80, 64, 45, 32), Civilization Alpha (128, 64, 48, 32, 24, 16), Leader (256, 128, 64), Buildings (256, 128, 64, 45), Improvements (256, 64, 45), Units (256, 128, 80, 64, 45) and Unit Flags (32)
  • Create 2D art (dimensions) for the Leader Scene (1600x900), DoM Image (1024x768) and Map (360x412)
  • Create 3D Art for Improvements and Unit Animations (also)
  • Create SV icons (size) for Improvements (128) and Unit Flags (128)
  • Diplomatic responses (ie RESPONSE_FIRST_GREETING, RESPONSE_DEFEATED, RESPONSE_LUXURY_TRADE, et al) - a generic template for the standard ten responses is attached
  • Anything else I've forgotten!
 

Attachments

  • DiplomacyResponses.xml.txt
    4.8 KB · Views: 1,358
So, you've followed the steps in post #2 and "it doesn't work"

IMPORTANT: Enable logging (see http://forums.civfanatics.com/showthread.php?t=487482) and actually check the database.log and xml.log files!!!

Make sure your civilization has two uniques.

Please don't post here (either on the end of this post or in the "Tutorials and Reference" sub-forum), but start a new thread in the main "Creation & Customization" forum for your civ

In that thread, please don't make us second guess what you may or may not have done, zip your actual mod (the one in the MODS sub-directory, not the ModBuddy project) and attach it to your post. It is far, far easier to trouble-shoot the mod than a written description of what you think the problem is.

:D
 
Post #1 updated with zip for BNW civs (including G&K and all DLC civs)
 
Might you post XML data files for the full set of buildings/wonders and units also?

Do you mean each building/wonder/unit with all its associated tables (BuildingClass/UnitClass, Unit_FreePromotions, etc) in a file of it's own? So you could quickly see everything about Building X or Unit Y?
 
Exactly :)
If files are too many, it's also ok a single file with all buildings/wonders and another with units
 
Great tutorial, nice to read.
 
Thanks!!! I attempted Civ5 modding about three or four times without any success... but then I found this thread. Really helpful stuff!
 
These files were really helpful for me, but the text tags for the city names are wrong, at least for Austria. They should be VIENNA, SALZBURG, GRAZ, etc. and not AUSTRIA_0, AUSTRIA_1, AUSTRIA_2, etc.
 
These files were really helpful for me, but the text tags for the city names are wrong, at least for Austria. They should be VIENNA, SALZBURG, GRAZ, etc. and not AUSTRIA_0, AUSTRIA_1, AUSTRIA_2, etc.

This is because the city names (and a lot of other text) is defined in the <Language_en_US> section usually at the end of the file.
 
These files were really helpful for me, but the text tags for the city names are wrong, at least for Austria. They should be VIENNA, SALZBURG, GRAZ, etc. and not AUSTRIA_0, AUSTRIA_1, AUSTRIA_2, etc.

The AUSTRIA_0 and so on will work just fine for the tags. The city name as it appears on the screen is defined separately:

Code:
<Row Tag="TXT_KEY_CITY_NAME_AUSTRIA_0">
	<Text>Vienna</Text>
</Row>
 
These files were really helpful for me, but the text tags for the city names are wrong, at least for Austria. They should be VIENNA, SALZBURG, GRAZ, etc. and not AUSTRIA_0, AUSTRIA_1, AUSTRIA_2, etc.
I think you have a basic misunderstanding of what this reference/tutorial is meant to do. It is not structured or intended as a model for changing an existing civilization*. It is structured and intended to be a template you can use to create your own new civilization by using an existing one as a model. This allows you to get your new civilization up and running with the minimum of code-creation on your part, while having everything required for a new civilization properly-formatted to function within the game.

The individual existing Firaxis-made civs and all their attendant 'stuff' are presented so you can start with the existing Firaxis-made civ most like the one you want to create.

.......................................................................................................................................................................

*you can use these templates to change an existing Firaxis-made civilization but you have to bear in mind that you'll need to re-vamp a lot of the code to use <Updates> instead of <Row> commands where you want to change specific 'pieces' of the civilization. In such a case, you'd want to delete from your mod all the code relating to city-names (unless you wanted to change a city-name to something else) so that it wouldn't interfere with what the game already has.

If I wanted what the player sees as the name of the city Vienna to change to Sturmberg, this is what I would code:

Code:
<Language_en_US>
	<Update>
		<Where Tag="TXT_KEY_CITY_NAME_VIENNA"/>
		<Set Text="Sturmberg"/>
	</Update>
</Language_en_US>
And I would probably delete entirely from my mod this table:
Code:
<Civilization_CityNames>
	<Row>
		<CivilizationType>CIVILIZATION_AUSTRIA</CivilizationType>
		<CityName>TXT_KEY_CITY_NAME_AUSTRIA_0</CityName>
	</Row>
	<Row>
		<CivilizationType>CIVILIZATION_AUSTRIA</CivilizationType>
		<CityName>TXT_KEY_CITY_NAME_AUSTRIA_1</CityName>
	</Row>

	etc..........

</Civilization_CityNames>
 
Hi all, I've been really inspired, by reading the countless hours of work and development produced by members in this forum, I wanted to create something myself.

So I go about making a new civ. I follow this fantastic guide on this forum, but somewhere along the line I may have messed up. I was wondering if someone would be so kind as to have a quick gander at my build, through modbuddy to see if anything jumps out at them that shows where it has gone wrong?
Thanks all!

View attachment WoW Civ - MURLOCs.rar

Much appricaited
Aaron
 
Ok, I appreciate you are excellent at what you do, and know this stuff like the back of your hand.
Im not sure why you are abrupt or angry, I'd be chuff with enthusiastic people.

I have followed your steps, as much as I could, but some of the language isn't second nature to me like you.

Wow, I thought this would be the right place to gather intellect from...
 
By far the best resource for any new Modder. It really allows me to get a good grasp on what I can and cannot do. Thank you.
 

(These files were generated by a Java program directly accessing the SQLite database, and so are very easy to regenerate if needed.)
:goodjob:

Thank you very much for making these files for everyone! They are so helpful in learning and advancing in modding civ. I made a special icon for each folder.:goodjob:
 
Top Bottom