MAIN PAGE
PREVIOUS TUTORIAL - IN THE BEGINNING
HOW TO CREATE A NEW CIVILIZATION
NOTE: This tutorial assumes you are already familiar with the material covered in the previous tutorial IN THE BEGINNING. If you have not already done so, you should read through that tutorial first.
Since the first thing most new modders want to create is a new civilization, we will start there. Follow along as I guide you through the MyNewMod project. The MyNewMod project more or less follows the same file structure that Kael gave in his guide on Page 16. Ultimately, it comes down to your particular preferences. There really isn't a "right" or "wrong" file structure, as long as everything is properly referenced and works. Right click on the MyNewCivilization.xml file under the XML folder. Rename the file to your desired filename, (for example, America.xml). Change only the MyNewCivilization part. If you delete the .xml part, you won’t be able to point to it in Actions later. Actions will be covered in more detail later in the guide, so don’t worry about it now.
DO NOT rename files or folders from outside your ModBuddy project. You are asking for trouble if you do. DO NOT delete a file from your ModBuddy project that you do not intend to delete permanently. Any time you change the name of a file or folder within the project, that change will be reflected in the file structure of your mod folder in ...\Firaxis ModBuddy\MyNewMod. If you need to temporarily remove a file from the project, but do not want it to be permanently deleted, make a copy first somewhere outside of the mod folder. Then, delete the file from the ModBuddy project and re-import it using Add-->Existing Item. Don't worry, we will cover that in more detail later.
Now, double click on the newly renamed MyNewCivilization.xml file. For the purpose of this tutorial, I will continue to refer to it in this manner, so don’t let that confuse you. In this file, you will find all of the tags that can be modified via XML to create a new civilization. This file is based on whoward69's XML data files for Standard Civilizations (BNW version). I create my new civilizations this way because it is much easier to find things like the civilization’s unique color scheme, TXT_KEY tags, and other such peripheral attributes if they are all in the same file. Firaxis separated all of these tags out into separate XML files which makes it difficult to find all of the relevant tags that you might want to change.
At this point, you should highlight the MYNEWCIV portion of COLOR_PLAYER_MYNEWCIV_ICON and hit CTRL-H. Type the name of your civilization in the Replace with: box. MYNEWCIV should already be in the Find what: box. Make sure the text in the Replace with: box is in all caps! If your civilization name is more than one word, be sure to use an underscore instead of a space to separate the words. Click the Replace All button and voila!
At the top of the file, you will find the new civilization’s color scheme. If you plan to use an existing color scheme, you can delete all of the code below. However, I would recommend leaving this portion in so that you can come back later and give your civilization a custom color.
Code:
<Colors> <Row> <Type>COLOR_PLAYER_MYNEWCIV_ICON</Type> <Red>1.000</Red> <Green>1.000</Green> <Blue>1.000</Blue> <Alpha>1.0</Alpha> </Row> <Row> <Type>COLOR_PLAYER_MYNEWCIV_BACKGROUND</Type> <Red>0.000</Red> <Green>0.000</Green> <Blue>0.000</Blue> <Alpha>1.0</Alpha> </Row></Colors><PlayerColors> <Row> <Type>PLAYERCOLOR_MYNEWCIV</Type> <PrimaryColor>COLOR_PLAYER_MYNEWCIV_ICON</PrimaryColor> <SecondaryColor>COLOR_PLAYER_MYNEWCIV_BACKGROUND</SecondaryColor> <TextColor>COLOR_PLAYER_WHITE_TEXT</TextColor> </Row></PlayerColors>
If you are familiar with RGB color values, then you can probably guess that the red, green, and blue tags are used to set these values. You cannot use the more traditional integer value for each of these tags directly. You will need to convert each of the integers to decimal numbers with a precision of three decimal places. This is because Civ5 uses a proportional value to determine how much of each color to “mix” with the other colors to create your desired color. To do this, first determine the integer value you want to use, then divide that number by 255. Round it to three decimal places and place the number in between the start and end tags for that color, preceded by a 0 as in 0.000. Don’t be too concerned about whether you should round up or down. Round it whichever way you prefer. It won’t matter that much when you look at the color in game. If you want either of your custom colors to be white, use 1.000 for all three RGB values. Black would be 0.000 for all three RGB values. If you don’t know what color you might want, go to a paint program like Paint that comes with Windows. Go to Edit Colors or whatever equivalent method your program has for viewing different RGB combinations. Find a color you like and then take note of the Red, Green, and Blue integer values displayed for that color. These are the numbers that you will need to divide by 255 in order to get your custom color.
The following section defines the main information for your civilization.
Code:
<Civilizations> <Row> <Type>CIVILIZATION_MYNEWCIV</Type> <Description>TXT_KEY_CIV_MYNEWCIV_DESC</Description> <ShortDescription>TXT_KEY_CIV_MYNEWCIV_SHORT_DESC</ShortDescription> <Adjective>TXT_KEY_CIV_MYNEWCIV_ADJECTIVE</Adjective> <CivilopediaTag>TXT_KEY_CIV5_MYNEWCIV</CivilopediaTag> <Playable>1</Playable> <AIPlayable>1</AIPlayable> <DefaultPlayerColor>PLAYERCOLOR_MYNEWCIV</DefaultPlayerColor> <ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType> <ArtStylePrefix>EUROPEAN</ArtStylePrefix> <ArtStyleSuffix>_EURO</ArtStyleSuffix> <IconAtlas>MYNEWCIV_COLOR_ICON_ATLAS</IconAtlas> <PortraitIndex>0</PortraitIndex> <AlphaIconAtlas>MYNEWCIV_ALPHA_ATLAS</AlphaIconAtlas> <MapImage>MyNewCivMap.dds</MapImage> <DawnOfManImage>MyNewLeader_DOM.dds</DawnOfManImage> <DawnOfManQuote>TXT_KEY_CIV5_DAWN_MYNEWCIV_TEXT</DawnOfManQuote> <DawnOfManAudio></DawnOfManAudio> <SoundtrackTag></SoundtrackTag> </Row></Civilizations>
We will skip over the TXT_KEY entries for now. They will be covered later in the tutorial HOW TO ADD CUSTOM TEXT. The TXT_KEYs for US English are included at the bottom of the file for convenience.
You should delete the lines <Playable> and <AIPlayable> if you plan for your civilization to be playable by both the human player and the AI. These are already set to true by default. If you want your new civilization to be playable by the human only, then delete <Playable> and change <AIPlayable> to false (Not False or FALSE. Don't get creative. Syntax is important.). If you want this new civilization to be playable by the AI only, then delete <AIPlayable> and change <Playable> to false. Do not include both of these and set them both to false. Your civilization will not show up when you go to test your mod for what should be an obvious reason. You told it nobody can play this civilization.
If you deleted the XML code for a custom color scheme, you need to replace PLAYERCOLOR_MYNEWCIV in
Code:
<DefaultPlayerColor>[COLOR="blue"][B]PLAYERCOLOR_MYNEWCIV[/B][/COLOR]</DefaultPlayerColor>
with an existing PLAYERCOLOR_ found in any one of the following files:
VersionFilenamePath
VanillaCIV5PlayerColors.xml...\Sid Meier's Civilization V\assets\Gameplay\XML\Interface
G&KCIV5PlayerColors_Expansion.xml...\Sid Meier's Civilization V\assets\DLC\Expansion\Gameplay\XML\Interface
BNWCIV5Civilizations_Expansion2.xml...\Sid Meier's Civilization V\assets\DLC\Expansion2\Gameplay\XML\Civilizations
The <ArtStyleType> tag specifies the type of building art that will be used for your civilization’s cities. Browse through the CIV5ArtStyleTypes.xml file located in ...\assets\Gameplay\XML\GameInfo to see the different options available. The <ArtStylePrefix> tag and <ArtStyleSuffix> tag are used for ethnic unit art related to the generic units that all civilizations can build. They allow your mod to add ethnic diversity without creating unique units for all of the units that a civilization can build. These three tags together control how your civilization’s generic artwork will look in game. There are five different ethnic types used in the game:
Code:
<ArtStylePrefix>_AFRI</ArtStylePrefix><ArtStyleSuffix>AFRICAN</ArtStyleSuffix>----------------------------------------------------<ArtStylePrefix>_AMER</ArtStylePrefix><ArtStyleSuffix>AMERICAN</ArtStyleSuffix>----------------------------------------------------<ArtStylePrefix>_ASIA</ArtStylePrefix><ArtStyleSuffix>ASIAN</ArtStyleSuffix>----------------------------------------------------<ArtStylePrefix>_EURO</ArtStylePrefix><ArtStyleSuffix>EUROPEAN</ArtStyleSuffix>----------------------------------------------------<ArtStylePrefix>_MED</ArtStylePrefix><ArtStyleSuffix>MEDITERRANEAN</ArtStyleSuffix>
We will skip the rest of these tags for now. We will come back to them later after we have created some new artwork for our civilization and leader.
The following code assigns a specific leader to this civilization. At this point, we will leave the LeaderheadType as LEADER_MYNEWLEADER. We will come back and change this later after we have created our new leader in the MyNewLeader.xml file.
Code:
<Civilization_Leaders> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <LeaderheadType>LEADER_MYNEWLEADER</LeaderheadType> </Row></Civilization_Leaders>
Next we come to the code for setting a preferred religion for your new civilization. If you plan to add a new religion, you can leave this code just as it is for now, then come back later and assign your new religion. If you are creating a mod for the original version of the game, you must delete this section of code. The original version of Civilization 5 does not have religion, so this section of code will generate one or more XML errors.
Code:
<Civilization_Religions> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <ReligionType>RELIGION_[COLOR="blue"][B]MYNEWRELIGION[/B][/COLOR]</ReligionType> </Row></Civilization_Religions>
If you want to add a religion here that already exists, you can do that now by replacing MYNEWRELIGION with the name of an existing religion. It needs to match exactly one of the religions in the Civ5Religions.xml file. This file can be found in the following locations:
VersionPath
G&K...assets\DLC\Expansion\Gameplay\XML\Religions
BNW...assets\DLC\Expansion2\Gameplay\XML\Religions
Now we come to the part that gives a lot of new modders trouble. This is because your civilization must have two uniques. It doesn't matter what sort of combination you choose for your two uniques, as long as you have two of them. You can have two unique buildings, two unique units, or one of each. If you do not properly code this section, or you have an XML error in the file which contains your new unit and/or new building, the quick select scrollable list on the game setup screen will "crash" when you go to select your new civilization during testing. Basically, you will only see the first five or so civilizations in the list with no scroll bar for scrolling down the list. The advanced setup screen will still work but the quick select list won't.
For the purposes of this tutorial and mod template, I have created two "uniques" based on the monument and warrior. This will keep the game setup civ select list working properly until you are able to get your new uniques added to the mod. For now, we will skip this section until we have covered creating these uniques.
Code:
<Civilization_BuildingClassOverrides> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <BuildingClassType>BUILDINGCLASS_MONUMENT</BuildingClassType> <BuildingType>BUILDING_MYNEWBUILDING</BuildingType> </Row> </Civilization_BuildingClassOverrides> <Civilization_UnitClassOverrides> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <UnitClassType>UNITCLASS_WARRIOR</UnitClassType> <UnitType>UNIT_MYNEWUNIT</UnitType> </Row> </Civilization_UnitClassOverrides>
Now you need to give your civilization some freebies. These are the free buildings, units and technologies that your civilization will have at the start of the game. If you are creating a "normal" civilization, such as the existing ones that come with the game, these three sections should look something like what you see below.
Code:
<Civilization_FreeBuildingClasses> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType> </Row> </Civilization_FreeBuildingClasses> <Civilization_FreeUnits> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <UnitClassType>UNITCLASS_SETTLER</UnitClassType> <UnitAIType>UNITAI_SETTLE</UnitAIType> <Count>1</Count> </Row> </Civilization_FreeUnits> <Civilization_FreeTechs> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <TechType>TECH_AGRICULTURE</TechType> </Row> </Civilization_FreeTechs>
If there are any techs that you wish to disable from being researched by this civilization, you can add them under the next section. This is not a section that is normally used, so you should delete it if you won't be using it for your civilization.
Code:
<Civilization_DisableTechs> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <TechType>TECH_FUTURE_TECH</TechType> </Row> </Civilization_DisableTechs>
The next section allows you to set a starting location priority for your new civilization. This is used if you want your civilization to always start along the ocean or a river or a particular region. If there is a region where you don't want your civilization to start, then use the region avoid table at the end. The existing regions recognized by the game can be found in the CIV5Regions.xml file located in ...assets\Gameplay\XML\Civilizations. Be sure to read the modding notes provided by Firaxis. I've included them here for reference. If you set your civilization to start along the ocean, you can include it in the Civilization_Start_Place_First_Along_Ocean table. This will give it a higher priority for starting along the ocean than other civilizations in the game. This is a new table added for BNW. Take note that Venice already has an entry in this table.
Code:
[COLOR="blue"]<!-- NOTE TO MODDERS: Each Civ can belong to only one of the four Start Bias categories, listed below. --><!-- If a Civ has entries in any of the four following tables, any entries in later tables will be ignored. --><!-- So... Coastal bias trumps River bias trumps Region Priority trumps Region Avoid. --><!-- The best practice is to pick only one of the four types (or none), for each civilization. -->[/COLOR]<Civilization_Start_Along_Ocean></Civilization_Start_Along_Ocean><Civilization_Start_Along_River></Civilization_Start_Along_River>[COLOR="blue"]<!-- NOTE TO MODDERS: Both single and multiple entries for Region Priority (per Civ) are supported! --><!-- If a Civ has one Priority, then on maps without a region of that type, fallback methods apply. --><!-- The fallback methods will match the given civ with a region that has the most tiles of the priority --><!-- terrain type. For instance, if Russia is set for Tundra priority but a map has no Tundra regions, they --><!-- will look for a region that has some tundra. If a Civ is given multiple priorities, fallbacks are not --><!-- used: the bias isn't applied when a map has none of those region types. -->[/COLOR]<Civilization_Start_Region_Priority></Civilization_Start_Region_Priority>[COLOR="blue"]<!-- NOTE TO MODDERS: Both single and multiple entries for Region Avoid (per Civ) are supported! --><!-- Region Avoid only kicks in for Civs that do not have a Coast, River or Priority need. --><!-- If a civ cannot avoid being placed in types it tries to avoid, the Avoid has to be ignored. -->[/COLOR]<Civilization_Start_Region_Avoid></Civilization_Start_Region_Avoid><Civilization_Start_Place_First_Along_Ocean></Civilization_Start_Place_First_Along_Ocean>
Next, you need to have some city names. You should add enough city names here that the player can build a lot of cities without running out of names. How many is enough? Well, that is kind of up to you, but Firaxis includes roughly 60 for their civilizations. You must have at least one name for your capital city. I have included 100 for this mod template. It's up to you to come up with that many names for the actual text. If you don't feel you need that many, you can delete them here. I would recommend leaving the corresponding TXT_KEYs at the end of the file in case you decide to add back some more city names later. Having extra TXT_KEYs won't hurt anything, but forgetting to add them back after adding back the references to them here will cause an XML error for each one that you no longer have loaded in the database.
NOTE: This example code is included for illustration purposes only! Do not copy and paste this into your mod exactly as it is here. The ..... will cause an error.
Code:
<Civilization_CityNames> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <CityName>TXT_KEY_CITY_NAME_MYNEWCIV_0</CityName> </Row> ..... <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <CityName>TXT_KEY_CITY_NAME_MYNEWCIV_99</CityName> </Row></Civilization_CityNames>
Finally, you need some spynames for your spies. If you don't add these, the game will either crash upon entering the Renaissance Era or the civilization won't receive any spies. The Firaxis civilizations include ten spy names so you should have at least that many for your civilization. If you intend to have a lot of extra spies for this civilization, you should add a spy name for each extra spy.
NOTE: This example code is included for illustration purposes only! Do not copy and paste this into your mod exactly as it is here. The ..... will cause an error. Also, if this mod is for the original vanilla version of the game, you should not have any spy names. There is no espionage in the original version of the game. Adding spy names to a mod for the original game will cause XML errors.
Code:
<Civilization_SpyNames> <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <SpyName>TXT_KEY_SPY_NAME_MYNEWCIV_0</SpyName> </Row> ..... <Row> <CivilizationType>CIVILIZATION_MYNEWCIV</CivilizationType> <SpyName>TXT_KEY_SPY_NAME_MYNEWCIV_9</SpyName> <Row></Civilization_SpyNames>
That covers everything for creating a new civilization except for defining the TXT_KEYs. We will cover this in more detail in HOW TO ADD CUSTOM TEXT.
UP NEXT: HOW TO CREATE A NEW LEADER