HOW TO: Create a Civilization

Jecrell

Ruled: Civ3 - Civ5
Joined
Oct 9, 2005
Messages
709
Location
California, USA
The following is a guide to creating an entire Civilization (also known as an empire) in Civilization IV. This walkthrough will cover XML basics along with the XML files requiring modification, how to handle the art files, leaderheads, flags, buttons, along with some tips to get desired effects.

This tutorial is designed with the inexperienced modder in mind. There will be many sections dedicated to nearly step-by-step processes included in this rather large tutorial. Such as creating the leaderhead, designing U.U.s, setting up the A.I. of a leader, creating custom diplomacy text, and more.

PLAN AHEAD!
Before you begin, it is always a good idea to lay out a design before rushing into creating your own Civilziation.

Some things you should consider:
  • City Names
    You can have as many city names as you want or only one. The problem with having only only one city name is that when the A.I. makes its second settlement, it'll go to your Civilization's city name list, and if it has no more names to choose from, it will select "ANY" city name. If you removed all of Japan's city names except Kyoto, when the AI or yourself makes a second settlement, you'll get something like Damascus or Mecca as the recommended/chosen city name.
    I recommend having at least 12-24 default city names.​
  • Starting Techs
    Each Civ usually has starting technologies. These technologies can be any technology in the game. All the regular Civilizations/Empires choose two from the following: Hunting, Fishing, Mining, The Wheel, Mysticism, or Agriculture
  • Unique Units/Buildings
    Consider the various units that can be replaced by your unique units. If you're designing a civilizaion for the Warlords/Beyond the Sword expansion pack you should also plan a unique building to add to your civilization. You might also want to have a good idea of how to balance them with specific promotions/bonuses in mind. Also consider the possibility of skinning the unit, which will be covered briefly in this tutorial.​
  • Leaders
    Having a good knowledge of the leader in particular along with their personality/handle of government is a must for creating a new leader. With XML files we can create some AI quirks for your new leader to make use of. Along with their A.I. personality you can assign various traits. In Civilization IV leaders take two of the following traits: (Aggressive, Creative, Expansive, Financial, Industrious, Organized, Philosophical, and Spiritual (Warlords/Beyond the Sword adds Imperialistic and Protective traits as well).​

SECTION 1
The Art Files

When modifying the art files in Civilization IV, you're going to need a proper program to modify, DirectDraw Surface, or .dds files. .DDS files are basically similar to regular bitmaps, except that they contain the same image at different resolutions from large to small.

Firstly, you're going to need a proper program to edit these .dds files. Personally I prefer DXTbmp, which properly generates the mipmaps (the same image at multiple resultions) and is relatively user friendly.

SECTION 1.1
Creating the Flag

The very first task you'll need to do to create a flag for your Civilization is a source image to create the flag from. Once you have your source image -- you want to resize its proportions to 128x128.



Here is my Carthaginian flag from my Carthage mod on the left. As you can see it looks pretty nice at 128x128, and it's nicely set in the middle so it doesn't wrap around the actual flag mesh. There is only one problem however. When the game actually loads the image is actually "squished" by about 25% in the width, as you can see the results with the image on the right.


To remedy this, we stretch the original image's width by 125% to cancel out this effect. Which results in a properly scaled image within the game.


Now, with a properly scaled image, we can actually load the image into DXTBmp and create the .dds file. To do this, simply load up DXTBmp. Then select File -> Open and open up your 128x128 bitmap. Now, double click the white area labeled "Alpha Channel." This should load your default paint/image editing program. Now use the paint bucket tool and fill the entire white area with black. This will make the game use your RGB values rather than the player's in-game color to define the flag.

Now, click File -> Save as -> DDS Texture. Before you save the image, click on the "Save as type" bar, and make sure that the image type is DDS DXT3. Try to keep the name of the file simple (LikeThis.dds). For implementation of the flag, skip to Section 2.3.1 of this guide.

SECTION 1.2
Creating the Leaderhead

Firstly, it's best to have a source image. Here I have a painting of Abraham Lincoln -- although it's been shrunk down for internet use.


Now, when creating a leaderhead, it is a good idea to use the ideal proportions of 512x512, and remembering our law of 125% width from our previous enounter. With this in mind, I stretch this image to the proper proportions.


Now it may look rather ugly in that sense, but once put into the game, you can see the results in diplomacy look MUCH more pleasing to the eye!


Now, you want to treat the leaderhead file exactly as you did before with the flags. To create the .dds file, get DXTBmp and start it. Then select File -> Open and open up your 512x512 bitmap. Warning: Don't set the alpha channel black, otherwise there'll be problems with your 2D leaderhead. Click File -> Save as -> DDS Texture. Before you save the image, click on the "Save as type" bar, and make sure that the image type is DDS DXT3.

SECTION 1.3
Creating Buttons

Before you start creating buttons. Typically you'll need three buttons. One for the leaderhead, one for your Civ flag, and one for your Unique Unit. Make your buttons with this in mind for your Civilization.

Button sizes are typically 64x64 pixels. The best idea when creating a button is to firstly create the image for the 64x64 image file. Then, put the image into the Civ4 border. The reason behind the border is that they create an illusion of a button shadow when the alpha channels are applied. This is the border I use; feel free to use it in your mods.



The only difference now is the alpha channel. Here is the actual alpha channel used globally for Civ4 buttons. Make sure to set this up before you save your DDS DXT3 files.



SECTION 1.4
File Arrangements

Now that you've created the Art files you need to create the actual mod directory and place the files in their proper directories.

Firstly, go into your Program Files\Firaxis Games\Sid Meier's Civilization IV\Mods directory. Now, create a directory of your choosing therein. So it'll be something like Sid Meier's Civilization IV\Mods\YourCiv\. Alternatively you can put your mods in the Warlords/Beyond the Sword expansion directories depending on what game you'd like to play your Civilization in.

Note: Do not go into _Civ4CustomMods directory or your My Games\Sid Meier's Civilization IV\Assets directory. Or else save files may not work properly with your modification. Although I will say that you can put game modifications in the My games\Sid Meier's Civilization IV\CustomAssets\ folder, which will produce immediate results when starting CivIV instead of needing to load a Mod to produce the desired results. I recommend only using CustomAssets if you're simply changing graphics of existing civilizations, and not if you're adding new civilizations/leaders.

Anyway, inside the mod directory -- create the following folders and place the art files.
YourCiv\Assets\Art\Interface\Buttons\Civilizations\(your civ's button here)
YourCiv\Assets\Art\Interface\Buttons\Units\(your UU's button here)
YourCiv\Assets\Art\Interface\TeamColor\(your flag here)
YourCiv\Assets\Art\Interface\Leaderheads\(your leaderhead here)
YourCiv\Assets\Art\Interface\Leaderheads\(your leaderhead's button here)

Fortunately, you do not actually need to specify a .ini file, as you will see in most mod directories, within the directory. It will be created automatically when the modification is loaded. It need only be modified if you feel it nessicary after you load your mod the first time.
 
SECTION 2
The XML Files

Now that you've created the art files required for your civilization, you can put them into practice by setting up the XML files. Then you can tell the game where your art files are and how they are set up. Also, you can set up our civilzation's name, leaders, and Unique Unit statistics in these files.

Now, editing XML files is as simple as opening the files in Notepad (I prefer Notepad++) and understanding a few concepts.

There are several types of tags and inputs I've noticed.
Firstly is the open and closed tags.
<Tag>Text Here</Tag>
These tags usually hold information in-between their opening tags and ending tags. Such as your Civilization's name, or the path of your art files.

Secondly are the closed tags.
<Tag/>
These tags are basically closed with no information to divulge. There are a few cases in-which these are nessicary. Try to remember the placement of the / compared to the open and closed tags.

Lastly, are the comment tags.
<!-- Comments here -->
These are what hold comments for the XML files. You can use these yourself to reference particularities in your module/civilization anywhere in the file, but try not to put them inside of tags. Comment tags require <!-- to start the tag, and --> to end the tag. You can use anything in-between.​

SECTION 2.1
Getting the Needed XML Files

Creating XML files from scratch is far too much work for anyone out to add a new Civilization. So it is best to borrow the original Civilization IV XML files and place them into our mod directory.

You're going to need the following files from your Sid Meier's Civilization IV directory.
Assets\XML\Art\CIV4ArtDefines_Civilization.xml
Assets\XML\Art\CIV4ArtDefines_Leaderhead.xml
Assets\XML\Civilizations\CIV4LeaderHeadInfos.xml
Assets\XML\Civilizations\CIV4CivilizationInfos.xml
Assets\XML\Interface\CIV4ColorVals.xml
Assets\XML\Interface\CIV4PlayerColorInfos.xml
Assets\XML\Units\CIV4UnitInfos.xml
Assets\XML\GameInfo\CIV4DiplomacyInfos.xml


You want to place copies of these files into your Mod directory similarly as the file structure presented above.

SECTION 2.2
Setting up the XML Text File

The XML text file for you Civilization is a unique kind of XML file. It is the only XML file to my knowledge that can have any filename of your choosing. The other XML files usually have text reference keys. These keys find our custom text references file and pull text data from it.

Here is an example XML Text reference file for a Civilization with 1 leader. Feel free to change it and customize it however you see fit. Also included are many comments to help you in your civ creation process.

http://www.filegone.com/pwlq (Dead link! To be fixed)

You want to place that file in the following directory inside your mod directory.
Assets\XML\Text\
Feel free to rename the file to anything you like, and change all the references inside to fit your Civilization and its leader.

SECTION 2.3
Setting up the XML Art Files

Now we can get started defining the art files so our Civ's graphics can show up in-game. Now, if you don't have any actual graphics prepared you can technically copy references already presented within the art files. So you could use Catherine as a placeholder and you don't need to make new leader/civ references if you reference already made art files.

However, if you have new art files you want to add to the game (and have been following the tutorial thus far), you're going to need to append new references to the XML Art reference files. So, unlike our text file, we *need* the original files in their entirety.

SECTION 2.3.1
CIV4ArtDefines_Civilization.xml

Remember earlier how I explained the opened and closed tags? In this file, the opening tag and closing tag are seperated by a bunch of minature tags. So, the file starts out with...
<CivilizationArtInfos>
and ends with
</CivilizationArtInfos>
And puts <CivilizationArtInfo> </CivilizationArtInfo> (note no S on the end) tags in-between. So effectively, this file creates a list of the art infos for each Civilzation. We don't want to break this when we add our code in.

In the effort of not breaking the file -- let's put the following lines of code after the last </CivilizationArtInfo>.

Code:
		<CivilizationArtInfo>
			<Type>ART_DEF_CIVILIZATION_[B]YOURCIV[/B]</Type>
			<Button>,Art/Interface/Buttons/Civilizations/[B](your civ's button).dds[/B]</Button>
			<Path>Art/Interface/TeamColor/[B](your flag).dds[/B]</Path>
			<bWhiteFlag>[B]1[/B]</bWhiteFlag>
		</CivilizationArtInfo>

Everything is self-explanatory except bWhiteFlag. bWhiteFlag has a b in-front of it because it is what we know as a boolean. Booleans are either true (1) or false (0). Since we have white flag set to true (1), our flag will not automatically be painted the colors of our civilization.

SECTION 2.3.2
CIV4ArtDefines_Leaderhead.xml

If you understood fitting in your XML into the last file, you should have no problem with this one. There's some uinqueness here since the files like using 3D references -- which we can not yet use. New animated leaderheads are not yet supported, so we're going to make closed tags out of the 3D references.

Here's the bit of code we need to add.
Code:
		<LeaderheadArtInfo>
			<Type>ART_DEF_LEADER_[B]YOURLEADER[/B]</Type>
			<Button>,Art/interface/LeaderHeads/[B](your leader's button).dds[/B]</Button>
			<NIF>art/interface/LeaderHeads/[B](your leaderhead).dds[/B]</NIF>
[B]			<KFM/>
			<NoShaderNIF/>
			<BackgroundKFM/>[/B]
		</LeaderheadArtInfo>

Since we have no NIF to reference, we basically refer to our DDS file instead. Which turns the NIF path tag into our own little Frankenstein DDS reference. The rest of the tags we close up -- since we have no actual 3D files. Although leaving them open with actual references does no harm, but it doesn't do anything really except clutter things up.
 
Reserved --
 
I'll be adding/revising a lot of this in the coming days. So any questions, comments, suggestions are welcome.
 
Cool, I'll be following this. I have a couple questions. Does the civ flag have to be only 2 colors or can it be anything from a single color to a photo? Also, I was wondering what's required to either edit an existing animated leaderhead or create my own animated leaderhead. How difficult is it? I have a kind of cheap idea to use the Sims 2 to create a leaderhead out of a sim and try to animate him a little bit if it's at all possible and within my ability.
 
i think you should speak about the alpha channel and the way to create a decalc flag... if people think they just need to take an image for the flag, they will be disappointed...

gonna follow this
 
Maxor127 said:
Cool, I'll be following this. I have a couple questions. Does the civ flag have to be only 2 colors or can it be anything from a single color to a photo? Also, I was wondering what's required to either edit an existing animated leaderhead or create my own animated leaderhead. How difficult is it? I have a kind of cheap idea to use the Sims 2 to create a leaderhead out of a sim and try to animate him a little bit if it's at all possible and within my ability.

Hehe. Well actually you can edit the animated leaderhead's textures. However, you can not, technically, modify the actual mesh yet. What would be a good idea is to create a mesh/texture in 3DSMax (or any 3D creation program) and wait until the ability to translate the 3D files into Civ IV's mesh/animation files.

Currently we're stuck with "flat" leaderheads.

LAnkou said:
i think you should speak about the alpha channel and the way to create a decalc flag... if people think they just need to take an image for the flag, they will be disappointed...

gonna follow this

I'll show two types as soon as I get done with the "down and dirty" version of this tutorial.
 
u talk nothing about where to put all the stuff need to explain it more theroly to us noobies i mean i made all the pics anf flags and butons but now what.....................
 
tumbleweed4 said:
u talk nothing about where to put all the stuff need to explain it more theroly to us noobies i mean i made all the pics anf flags and butons but now what.....................

My bad -- I'll have section 2 up in a bit explaining the XML things that need to be done. Sorry I havn't updated in a while.
 
This is very helpful! Thanks for your hard work. I've got my first civilization coming along faster than I expected.
 
Nice. I used this to get a start on my new civ.


Are you going to include a custom music for your civ in this too? I finally got my custom diplo music working for my civ, but it took me way longer than it should have.
 
Andicus said:
Nice. I used this to get a start on my new civ.

Are you going to include a custom music for your civ in this too? I finally got my custom diplo music working for my civ, but it took me way longer than it should have.
Diplomatic music and Civilization music tutorials will come later (during Christmas break), because I have yet to personally do it myself. The major reason why I don't really like doing this is that it increases the file sizes greatly for distributed Civs. Although I might create some optional music packs for my Civs.

The next sub-sections of this will be the individual XML files in detail. I hope you've enjoyed the comments and such inside the custom Text .xml file. And seriously guys, feel free to criticize what has been published so far.
 
Help Please!

I am trying to create my own mod and cant for the life of me add civilizations. as a tester i am trying to add Canada as a civ (after following somebody else's tutorial) but it when i load the mod it just wont show up in the civ selection screen (i.e. i cant play as them!)

I have added Mods/Canada/Assets/
in which i have the following:

/XML/Civilizations/CIV4CivilizationInfos
/XML/Civilizations/CIV4LeaderheadInfos

/XML/Text/CIV4GameText_Civilopedia_CivLeaders
/XML/Text/CIV4GameTextInfos_Cities
/XML/Text/CIV4GameTextInfos_Objects

They have the appropriate text in them for a Canada civ (see Cv 4 XML Tutorial Part 1, 2 and 3 for details...its in the tutorials and guides forum).

But i cant get the changes to appear, similar to in the mod i am trying to create. However, i downloaded the Europa Europa mod and that works fine...what am i doing wrong? Is it something to do with the fact that wheni load the mod it says "Loading XML[uncached]" however when it loads the original game it says "Loading XML[cached]" ? If so how do i change this? If not, stil how do i get it to work? Help is much appreciated!

Its kinda driving me :crazyeye: :lol:

thanks a lot,
mrkingkong
 
Have you tried clearing the cache? You could delete the CustomAssets folder to force CivIV to reload all the xml files from your mod.
 
Delete the CustomAssets folder. There should be a folder for CivIV in My Documents\My Games\. CustomAssets will be in that folder. There is also a shortcut from the main directory where you installed CivIV.
 
mrkingkong said:
Help Please!

I am trying to create my own mod and cant for the life of me add civilizations. as a tester i am trying to add Canada as a civ (after following somebody else's tutorial) but it when i load the mod it just wont show up in the civ selection screen (i.e. i cant play as them!)

I have added Mods/Canada/Assets/
in which i have the following:

/XML/Civilizations/CIV4CivilizationInfos
/XML/Civilizations/CIV4LeaderheadInfos

/XML/Text/CIV4GameText_Civilopedia_CivLeaders
/XML/Text/CIV4GameTextInfos_Cities
/XML/Text/CIV4GameTextInfos_Objects

They have the appropriate text in them for a Canada civ (see Cv 4 XML Tutorial Part 1, 2 and 3 for details...its in the tutorials and guides forum).

But i cant get the changes to appear, similar to in the mod i am trying to create. However, i downloaded the Europa Europa mod and that works fine...what am i doing wrong? Is it something to do with the fact that wheni load the mod it says "Loading XML[uncached]" however when it loads the original game it says "Loading XML[cached]" ? If so how do i change this? If not, stil how do i get it to work? Help is much appreciated!

Its kinda driving me :crazyeye: :lol:

thanks a lot,
mrkingkong

I'd have to see your code.
Also, I don't like it when people add text to the default text files (You have 3 XML text files) -- it takes more time and energy to combine mods and its generally not good. You have no idea how many times I have said that in my history on this forum... it's like I'm yelling it until my throat bleeds. You can just make your own XML text file and add everything your mod needs into it.

Did you define the Civ's art assets? Looks like you didn't since you're missing the CIV4ArtDefines_Civilization.xml, and CIV4ArtDefines_Leaderhead.xml files. Or did you just reference the default leaders/civs' art?

And I don't think the cache has anything to do with it. You loaded the mod "uncached." Also, deleting your custom assets doesn't really delete the cache. If you have the patch for Civ IV, just hold shift while the game loads (or ctrl -- either shift or ctrl). That clears the cache.
 
What should I do if I only want to add a new leader to an existing civilization with his own traits? I made my own leaderhead and I think I'd like to use it to add a second leader to the Romans with my own traits but keep everything else default.
 
Jecrell said:
I'd have to see your code.
Also, I don't like it when people add text to the default text files (You have 3 XML text files) -- it takes more time and energy to combine mods and its generally not good. You have no idea how many times I have said that in my history on this forum... it's like I'm yelling it until my throat bleeds. You can just make your own XML text file and add everything your mod needs into it.

Did you define the Civ's art assets? Looks like you didn't since you're missing the CIV4ArtDefines_Civilization.xml, and CIV4ArtDefines_Leaderhead.xml files. Or did you just reference the default leaders/civs' art?

And I don't think the cache has anything to do with it. You loaded the mod "uncached." Also, deleting your custom assets doesn't really delete the cache. If you have the patch for Civ IV, just hold shift while the game loads (or ctrl -- either shift or ctrl). That clears the cache.

Thanks for your reply. However i dont beleive that the problem is the leaderheads as i just defined default leaders i.e. one of my races was formally Germany so i left the leader art as Bismarck.

Any ideas what my problem could be then? I had a very similar problem in Civ 3 in that sometimes a change i had made in the files (if i had added a unit, for example) worked and sometimes it didnt. it is highly frustrating, as im sure you can understand. If i sent you the files is there any chance you could look through them to try and see what i am doing wrong? If not no worries! If so, thanks for taking the time to help a noob out.

thanks in advance
mrkingkong

EDIT: when you say about the text files(i.e. you dont like it when people use the default text files,etc) , do you mean you can just have the one file, literally just enter what you want into it. Rather than following the naming pattern of the other files. Or is that just stupid (its not what iv done with my mod by the way)
 
Top Bottom