New Civilizations

– by Argalius,
Created: 24th December 2006
Last Edited: 24th December 2006

In the last few months several people asked the community to explain how to create new civs. The process of new civs is rather difficult and complex and can’t be explained in one paragraph. So the answer the people got was that they should try it out themselves or that they should leave it to the ‘pro’s’. Although comments like these are understandable, they don’t give anybody any satisfaction and that’s why I wrote this tutorial. I hope you’ll learn something from it, but remember that learning by trying is always better than just reading this tutorial. It’s very true that you learn from your mistakes.

Before we start I’d like to make a few notes first:

• Creating new civs isn’t meant for rookies. Extensive knowledge of the files and structures used in Age of Empires III is required to get the job done. To get this knowledge first read the other available tutorials and try some things out. After that you can try to make a new civ.

• Your new civ won’t have AI unless you overwrite an existing civ. This is due to the refering to the .personality files found in the \AI map. You will still be able to play your new civ, but the computer won’t to able to use it so you can’t play against your new civ. When you are overwriting an existing civ for your new one you probably want to use new/unique units. Then you should consider that you’ll have to change the AI files (ie. AIMain.xs) aswell before the AI will use the unit. This can sometimes be to only add/change a few lines, but it could also mean that you’ll have to extensively edit the AI which is a totally different thing about which I don’t know very much.

• New civs can’t be played/viewed in multiplayer. Also, changing the files will make it impossible to login to ESO so if you still want to be able to play online aswell as working on your mod. Then copy the game folder and rename it, if you wish to play online just rename the maps and you should be all set. This is also useful when you need to patch your game. Just use your ‘online-version’, patch it, copy the new files, edit them and you’ve updated your mod to the latest patch version. Always a smart thing to do even if you can’t use your mod online.

So if you still want your new civ after these notes, then please continue the tutorial. Please keep in mind that this tutorial is written with a totally new civ in mind, so not a copy of an existing one. This means everything we want the civ to have will be brand new. Remember that when I’m talking about Natives I don’t mean the three new civs from The Warchiefs, but the sub civs you can ally with by building trading posts.

The first thing you need to do (really it’s important! I didn’t do it and kind of kept hitting to it during the process) is to make an outline of your civ. What name do you want it to give, what kind of art, what flag, what units, what techs, what politicians etc. etc. It’s very important you atleast have a global idea of what you want, then you know what you’re aiming at and you’ll always have something to do. When I was working on my mod I had to stop modding continuesly to do more research, something which really slowed the process down alot. So after you created the basic outline we can continue.

A modder who wants a new civ is obviously going to start with civs.xml.xmb found in data.bar. I’ll use the Spanish data as an example and break it appart to explain every part:

<civ>
<name>Spanish</name>
<main>1</main>
<statsid>SP</statsid>
<portrait>objects\flags\spanish</portrait>
<culture>Mediterranean</culture>
<displaynameid>22864</displaynameid>
<rollovernameid>26061</rollovernameid>
<alliedid>26446</alliedid>
<alliedotherid>26445</alliedotherid>
<unalliedid>26444</unalliedid>
<hcshipmentmodifier>0.73</hcshipmentmodifier>
<agetech>
<age>Age0</age>
<tech>Age0Spanish</tech>
</agetech>
<agetech>
<age>Age1</age>
<tech>ColonializeSpanish</tech>
</agetech>
<agetech>
<age>Age2</age>
<tech>FortressizeSpanish</tech>
</agetech>
<agetech>
<age>Age3</age>
<tech>IndustrializeSpanish</tech>
</agetech>
<agetech>
<age>Age4</age>
<tech>ImperializeSpanish</tech>
</agetech>
<postindustrialtech>PostIndustrialSpanish</postindustrialtech>
<postimperialtech>PostImperialSpanish</postimperialtech>
<buildingefficiency>0.3</buildingefficiency>
<gold>0</gold>
<food>0</food>
<wood>0</wood>
<startingunit>Explorer</startingunit>
<startingunit>WarDog</startingunit>
<townstartingunit>Settler</townstartingunit>
<townstartingunit>Settler</townstartingunit>
<townstartingunit>Settler</townstartingunit>
<townstartingunit>Settler</townstartingunit>
<townstartingunit>Settler</townstartingunit>
<townstartingunit>Settler</townstartingunit>
<townstartingunit>Settler</townstartingunit>
<townstartingunit>CrateofFood</townstartingunit>
<townstartingunit>CrateofFood</townstartingunit>
<townstartingunit>CrateofWood</townstartingunit>
<homecityfilename>homecityspanish.xml</homecityfilename>
<homecityflagtexture>objects\flags\spanish</homecityflagtexture>
<homecityflagbuttonset>spanishFlagBtn</homecityflagbuttonset>
<homecityflagbuttonsetlarge>spanishFlagBtnLarge</homecityflagbuttonsetlarge>
<postgameflagtexture>ui\ingame\ingame_ui_postgame_flag_spanish</postgameflagtexture>
<matchmakingtextures>
<bannertexture>ui\eso\civ_flags_quick_launch</bannertexture>
<bannertexturecoords>0 0 0.78125 0.125</bannertexturecoords>
<portraittexture>ui\eso\eso_quick_search_politicians_02</portraittexture>
<portraittexturecoords>0.4375 0.4296875 0.830078125 0.814453125</portraittexturecoords>
<smallportraittexture>ui\singleplayer\cpai_avatar_spanish</smallportraittexture>
<smallportraittexturecoords>0 0 1 1</smallportraittexturecoords>
</matchmakingtextures>
<unitregen>
<unittype>Hero</unittype>
<rate>0.25</rate>
<idletimeout>3.5</idletimeout>
</unitregen>
<unitregen>
<unittype>Minuteman</unittype>
<rate>-2.0</rate>
</unitregen>
<unitregen>
<unittype>SPCBolivar</unittype>
<rate>0.25</rate>
<idletimeout>3.5</idletimeout>
</unitregen>
</civ>

<name>Spanish</name>
Every civ needs its own unique name, this name is used in alot of places so it’s important you don’t misspell it in the civs.xml.xmb. If you want your new civ to have AI it’s important not to edit this tag (because you’re going to replace an existing civ), the rest of the tags are free to edit, except this one.

<main>1</main>
This tag means if the civ is a normal playable civ or a sub/native civ. 1 means playable 0 means sub/native.

<statsid>SP</statsid>
Although I’m not sure, I think this has something to do with the Post-Game stats. Just make sure it’s unique and it’ll probably be alright. It could also be that it’s used by ESO to keep track of how much the different civs are used. If that might be the case it doesn’t matter anything since our civ will never see ESO. I never encountered any problems with it being unique from others so just do that.

<portrait>objects\flags\spanish</portrait>
Used when you create a new HomeCity (HC) to show which civ you selected. Important to make it point to your new flag texture to avoid annoying problems like selecting the wrong civ.

<culture>Mediterranean</culture>
Cultures are defined in cultures.xml.xmb, to my knowledge cultures are only used in anim files for the art used on (mostly) buildings. That way you can use one anim file for a building used by civs using different art sets. If you want your civ to use an existing art set change it accordingly. If you plan to make a new set you should first define your culture in cultures.xml.xmb and create the set. I won’t go further into this because it’s self-explanatory.

<displaynameid>22864</displaynameid>; <rollovernameid>26061</rollovernameid>
Your civs name/rollover name, defined in stringtable.xml.xmb.

<alliedid>26446</alliedid>
<alliedotherid>26445</alliedotherid>
<unalliedid>26444</unalliedid>

When your civ is a sub/native civ these tags define the strings used for a text that will be displayed when the native town is selected. I doubt they have any function for playable civs.

<hcshipmentmodifier>0.73</hcshipmentmodifier>
Multiplies the time needed for shipments to arrive at your Town Center. A number between 0 and 1 means that time will be lower. A number higher than 1 mean it will take longer for them to arrive. Negative numbers will most probably result in an error.

<agetech>
<age>…</age>
<tech>…</tech>
</agetech>

These techs are used to define what techs are used to age up. Where <age> is pointing to <name> in ages.xml.xmb (data.bar) and tech points to the tech found in techtree.xml.xmb (\data map). (more on the age-techs later on)

<postindustrialtech>PostIndustrialSpanish</postindustrialtech>
<postimperialtech>PostImperialSpanish</postimperialtech>

Used when game settings are used where you will start in the fourth or fifth age. They obviously point to techtree.xml.xmb.

<buildingefficiency>0.3</buildingefficiency>
No idea what this does, maybe it has something to do with the time it takes to construct a building. Whatever it may be, all the original civs use 0.3.

<gold>0</gold>
<food>0</food>
<wood>0</wood>

The starting resources for the civ, you could for example give your civ an extra 200 food right away instead of a food crate.

<startingunit>…</startingunit>
<townstartingunit>…</townstartingunit>

A starting unit is a unit you’ll get when the game starts, for free. They will be placed somewhere in your TCs LOS. Town starting units are also free and are aquired right at the start, but they will come out of the TC and stay close to it.

<homecityfilename>homecityspanish.xml</homecityfilename>
Points to the HC file that’s used for the civ, they are located in data.bar.

<homecityflagtexture>objects\flags\spanish</homecityflagtexture>
Points to the flag texture used for the HC.

<homecityflagbuttonset>spanishFlagBtn</homecityflagbuttonset>
<homecityflagbuttonsetlarge>spanishFlagBtnLarge</homecityflagbuttonsetlarge>

These point to buttonsets.xml.xmb (data.bar) where the name is used in set name=”…”. These sets are used for the HC button on the ingame-UI that will take you to your HomeCity and the flag you’ll see when selecting a civ/HC.

<postgameflagtexture>ui\ingame\ingame_ui_postgame_flag_spanish</postgameflagtexture>
The texture that’s used in the post-game screen.

<matchmakingtextures>
<bannertexture>ui\eso\civ_flags_quick_launch</bannertexture>
<bannertexturecoords>0 0 0.78125 0.125</bannertexturecoords>
<portraittexture>ui\eso\eso_quick_search_politicians_02</portraittexture>
<portraittexturecoords>0.4375 0.4296875 0.830078125 0.814453125</portraittexturecoords>
<smallportraittexture>ui\singleplayer\cpai_avatar_spanish</smallportraittexture>
<smallportraittexturecoords>0 0 1 1</smallportraittexturecoords>
</matchmakingtextures>

The bannertexture and portraittexture are only used in ESO as far as I know, where the coordinates (W X Y Z) give the position of the part used from the texture. Where 0 is at the beginning (0 px) and 1 is at the end (ie. 150 px) where W and Y are horizontal and X and Z are vertically (0 0 1 1 meaning it uses the whole texture). <smallportraittexture> is used for singleplayer so you’ll have to change this.

<unitregen>
<unittype>…</unittype>
<rate>…</rate>
<idletimeout>…</idletimeout>
</unitregen>

The unitregen tags are used for the auto-regenerating of HP by the defined unit(type), the rate per second and after how much idle time the regenerating will start.

For sub/native civs and campaign civs the following tag is also used:
<visible>0</visible>
<visibleineditor>1</visibleineditor>

Where <visible> is for the main singleplayer setup screen, 0 meaning it won’t be listed, 1 meaning it will be listed. <visibleineditor> means if you’re able to select the civ for a player in a scenario, for normal and campaign civs this value is 1, for sub/native civs this value is 0 meaning a player can’t play with the given civ.

A new civ means you also want it to be unique so you will need to give it a unique set of units and buildings (brand new or not; it doesn’t matter). For that we are going to edit the techtree and make the age-techs you’ll need to let your civ advance through the ages. An age0 tech will look like this, this is the tech research right at the beginning to make it possible for your civ to research techs, train units and construct buildings:

<Tech name =’Age0X’ type =’Normal’>
<Status>UNOBTAINABLE</Status>
<Flag>Shadow</Flag>
<Effects>
<Effect type =’Data’ amount =’1.00′ subtype =’Enable’ relativity =’Absolute’>
<Target type =’ProtoUnit’>…</Target>
</Effect>
<Effect type =’TechStatus’ status =’active’>…</Effect>
</Effects>
</Tech>

The name used for the tech (Age0X, where X is your civ’s name) is defined in civs.xml.xmb as described above. Between the <Effects> tags the <Effect> tags are defined, they say what the tag does, just look at the techtree.xml.xmb to see what sort of variations there are, they’re very easy to understand. In the Age0 tech you should define what units/buildings and techs are researchable for this civ. Also remember to include the politician techs so your civ will be able to advance to the next age.

The techs for the other ages are virtually the same, only they don’t say everything that is available, only what is available after that age or maybe an increase of LOS for your buildings etc. Note that these techs are always activated when your civ advances to a next age, no matter what politician is chosen.

When creating your new civ you might want to include new politicians aswell. Not the biggest taks around, this is what the politiciandata.xml.xmb looks like:

<politicians>
<Techname portraitfilename=”ui\ingame\politicians\politician_X”/>

</politicians>

The “Techname” points to techtree.xml.xmb and is the name of tech that’s researched when this politician is chosen. These tech look like this:

<Tech name =’Techname’ type =’Normal’>
<DisplayNameID>#</DisplayNameID>
<Cost resourcetype =’Food’>#</Cost>
<Cost resourcetype =’Gold’>#</Cost>
<ResearchPoints>#</ResearchPoints>
<Status>UNOBTAINABLE</Status>
<Icon>ui\ingame\icon_age_iV</Icon>
<RolloverTextID>#</RolloverTextID>
<Flag>CountsTowardEconomicScore</Flag>
<Flag>AgeUpgrade</Flag>
<Flag>Shadow</Flag>
<Effects>

<Effect type =’SetAge’>Age#</Effect>
</Effects>
</Tech>

Something that’s really important is <Flag>AgeUpgrade</Flag>, if that isn’t included you won’t advance to the next age so make sure it’s there. The effect type SetAge points to the Age named in ages.xml.xmb.

When you’ve fully read this tutorial I’m sure you’ll be able to create your own civs. There are still a few things left to do of course, but given you have a decent level of modding experience I’m sure you’ll find everything out. Good luck!

Argalius