Changing Config to Use Custom-Civ as Default-Civ in Game-Setup

NorthernSanta

Chieftain
Joined
Jun 5, 2012
Messages
5
Location
East of Vancouver, B.C., Canada
I'm having some trouble trying to refine my Civ 5 'config.ini' / 'User Setting config' file.
I have a custom civ that I enjoy using and I would like to change my config file so that the game recognizes it immediately so that it's the automatic choice for each new game I setup.

I've figured out how to set the other game-setup default-choices, as per my preferences, such as difficulty level, map type, etc. I've tried to few things to try and get the game to recognize my custom civ, but nothing has worked so far. My custom civ does appear on the main-list of civs, so I know that it works. I was just hoping to make a small change so that I don't have to scroll down to the bottom of the civ-list to choose it each time.

I have some/limited experience with coding and language but I'm certainly no expert. It's unclear to me if I need to add the whole path location including the folder and/or just the civ's filename.xxx.

I thought I would post and ask the community since there seems to be a lot of knowledgeable gamers here. If someone could point me in the right direction with how/what to change in my config.ini file so my custom civ is my default for every new game, I would be grateful for any help you could give.

Thank you in advance.

~ NorthernSanta (aka - Jim)
 
Pretty sure it can't be done (at least not via the ini files) as the values in those must be valid for both standard and modded games (and a custom civ number won't be valid for the standard game)
 
whoward69,

Thank you for your reply.

In Civ 4 I recall being able to configure a custom civ so that it would register as-the-default-civ when starting a new game... for civ 4 it was just a matter of typing in the full path to the folder of the mod as well as the mod-civ name. Hmm. I did try this but no luck.

Civ 5 is quite moddable... and my instincts tell me that somewhere/somehow there's likely a way to do this... I just don't have the expertise to fiddle around (in knowing what the heck I'm doing). *shoulder shrug*

On a related note to your answer: Is it possible to assign a unique ID number to my custom civ... such as '-1' or '50' or something, then go into the default game files (game location path etc = C:\Program Files\Sid Meier's Civilization V\assets\Gameplay\XML\Civilizations\ and open the file "CIV5Civilizations.xml") and add in a line that would recognize the specific ID number for the custom civ?

Logic tells me that something like that 'should' work, but the last thing I want to do is to mess up the game's default files.

whoward69, thank you for replying and giving your thoughts and feedback on this. I appreciate it very much.
Oh, and thanks for all the customs that you've made... I really like the types of customs and the kinds of 'edits' you've made! Your customs make my Civ 5 very playable!

Cheers!
~ Jim
 
and my instincts tell me that somewhere/somehow there's likely a way to do this

Lot's of things in Civ 5 seem like they should be doable, but they arn't.

That configuration file has to be valid for plain games - or the plain game will try to load a Civ that doesn't exist and crash, even for modded games there is no guarentee that the mod is loaded, so the game can still crash - so unless you are going to hack your new civ into the core game XML files so it appears as part of the "plain" game, there really is no way to do it.
 
whoward69,

Even though my instincts tell me there might be a way to do it, in the end, it's not as though my civ doesn't work at all. Sure, I have to scroll down the list-of-civs when starting each new game, but that is not an inconvenience... everything is still playable. *smiling*

Thank you for your feedback whoward69... I think I'll just leave things things alone (as they are) and enjoy playing.

~ Jim
 
I've found an issue/problem with what I've written below, so for now, don't follow anything!
I'm trying to solve it and will post a proper solution soon.


I've discovered that "-1" tells the game to select "random civ", so "-1" won't work... and probably no number in the negative All the civs have an ID number. If you have 18 default civs, then the assigned number are from 0 to 17. If you have more default civs, then the same rule applies, which means that the lowest ID number is always "0", and goes to, say, 24, if you were to have 25-default civs etc.

I have found a way to assign your custom civ in the user config settings but in order to do that your custom civ needs an ID number, but assigning a custom civ an ID number no longer makes the civ a custom one and the game recognizes it as a default civ (but you can't play a default game using it, so don't bother; it only shows up in the civ-list). I thought that if I assigned my custom civ, say, ID number 98, then went into my config.ini and typed in "98", then it would always place that civ as the selected one, but it won't appear on the custom-civ list at all. So, my deduction is that ANY civ with an ID number means that it's a default civ, and any civ without a default ID number means that it will show up on the Mod-User-Game civ-list for selection. SO, any civ (custom or default) either has an ID number or doesn't, which the game recognizes as default-civs and custom-civs... no exceptions.

For now, everything I've typed below is worth the "toilet paper" it's written on. I'll fiddle around with this custom-civ matter when I have more time. I'll leave all the text there for now and consider deleting my post if no solution reveals itself.


~ ~ ~ ~ ~ ~ ~

For information's sake --

I couldn't help but fiddle around with the .xml files, both the default Civ 5 .xml files and my custom civilization's .xml files... and I stumbled across a semi-solution.

Although I still can't insert my custom civ into the slot as the default-user-civ for starting any new game, I did find a sort-of-compromise...
my custom civ now appears at the very top of the list-of-all-the-civs (custom and default). *YAY*

In fact, it's fairly straight forward and simple for anyone to do, if they choose, so as long as you follow the steps.
(always backup your file and test to see if it works as you make any changes!).

My computer/Operating System is Windows7 and also has an XP-mode too.

Step 1 - Go to your custom civilization's folder found in the "Documents" folder -- My location happens to be --
C:\... ... \Documents\My Games\Sid Meier's Civilization 5\MODS\[your custom civ's folder name]\

-- for other Operating Systems the location will be slightly different, but still found under the "Documents" or My Documents" folder (which is the default location where all the custom stuff is kept)

So find your custom civ's folder, then open it to see the folders within your custom-civ folder.

Step 2 - Inside your custom-civ's folder you should find a folder named "XML", open it up.

Step 3 - Inside that "XML" folder you should see a folder named "Civilizations", open that up.

Step 4 - Inside the "Civilizations" folder you should see 2 files. These files are critical to your civilization working properly!

The file we want to make a small edit to is named "Civ_[name of your custom civ].xml"
And at this point, before you edit anything, I highly recommend making a backup copy of this file!

If you need to know how to copy the file -- Highlight it, right-click on that file you highlighted and select "copy" from the drop-down menu. Then left-click on the white portion of your screen inside the folder so that you "unhighlight" the folder. Right-click again and this time, from the drop-down menu choose "paste". It should make a duplicate copy of the file you just copied.

Step 5 - Open the ORIGINAL file, "Civ_[name of your custom civ].xml" (not the copy you just made). You may need to open it in notepad or some kind of text/writing application that allows you to edit the text inside the file.

Step 7 - the edit - At the top of this file you should see a bunch of text that looks similiar to what I've pasted below... except that the information on each line will be related to your custom civ (I'm using my civ info as an example).

Example: "<Type>CIVILIZATION_[your civ name]</Type>"

Step 7.5 - Adding a new line into your custom civ's information...
...so that the custom civ you like using the most will appear at the very top of the list (but not the default starting civ). You'll still have to click on it to select it, but at least it's not at the bottom of your list anymore. *smile*

So, immediately below in the bunch of data you see I've highlighted a line in RED. That line NEEDS to be added into your custom civ's file... AND you need to do it accurately with no mistakes, no spaces, and no extra character or numbers etc. Do it exactly as you see it below... the line is:

~ ~ ~ ~ ~ ~ ~

<GameData>

<Civilizations>
<Row>
<ID>-1</ID>
<Type>CIVILIZATION_CANADA</Type>
<Description>TXT_KEY_CIV_CANADA_DESC</Description>
<ShortDescription>TXT_KEY_CIV_CANADA_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_CANADA_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_CIV_CANADA_PEDIA</Civilopedia>
<CivilopediaTag>TXT_KEY_CIV5_CANADA</CivilopediaTag>
<DefaultPlayerColor>PLAYERCOLOR_RED</DefaultPlayerColor>
<ArtDefineTag>ART_DEF_CIVILIZATION_ENGLAND</ArtDefineTag>
<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
<ArtStyleSuffix>_EURO</ArtStyleSuffix>
<ArtStylePrefix>EUROPEAN </ArtStylePrefix>
<PortraitIndex>0</PortraitIndex>
<IconAtlas>CIV_COLOR_ATLAS_CANADA</IconAtlas>
<AlphaIconAtlas>CIV_ALPHA_ATLAS</AlphaIconAtlas>
<MapImage>MapCanada512.dds</MapImage>
<DawnOfManQuote>TXT_KEY_CIV5_CANADA_TEXT_1</DawnOfManQuote>
<DawnOfManImage>MacDonaldDOM.dds</DawnOfManImage>
</Row>
</Civilizations>


~ ~ ~ ~ ~ ~ ~

<ID>-1</ID>

The number is a "minus 1" or "-1" in between the > <

The reason for this is because all of the default civilizations in the game have identification numbers assigned to them... from 0 --> to (at least) 18. The higher the number, the lower on your civ-list the civilization will be.
WARNING -- DO NOT EDIT THE DEFAULT-CIV ID NUMBERS, THIS WILL MESS UP YOUR GAME... LEAVE THEM ALONE.

So, by adding a line with a -1, that puts your custom civilization at the top of the list. Add that line in, SAVE the file, start up your civ 5 game and see if your custom civ is at the start of the list -- UNDER "MOD" GAME SETUP, not the default game setup.

Although I haven't tested my next theory out, I would think that if a person had 2 or 3 or more custom civs, you could essentially add the same line into each separate civ's file to have all your custom civs in-a-row at the top of the list -- but you would have to change the number that you've added so that each one is specifically different, for example...

~ Let's say you have 3 new custom civs... named A, B and C.
~ You want A at the top of the list, followed by B, then C.
~ To do this, the lowest-custom-civ-on-your-list gets the ID number "-1". The next civ closer to the top of the list gets the ID number "-2", and the top civ on your list gets ID number "-3".

Since I enjoy one particular custom civ in my game, I have the appropriate ID number assigned to it and it's at the top of my list of civs. The above method should work for placing multiple custom civs at the top of your list when you start a new mod-game, but please don't hold my feet to the fire. *giggling* It DOES work using only one custom civ, but for multiples, you'll have to be the Guinea Pig to test it out. As I say, always backup your files/work before edits--and always test the changes before comitting yourself.

It's taken a little while to type this stuff in here, but I figured since I found a semi-solution, why not post it and maybe it would help others . *smile*
I still haven't found a way to make my custom civ the default-choice in the user game setup (without actually having to click on it to select it). Nor, have I figured out if I can add a line(s) into my game's configuration-file so that my custom civ is always my default. For now, this is an ok compromise for me.

Enjoy your game!

~ Jim
 
Civ5 dll expects all tables (that have IDs) to go from 0 to something. Some tables can handle discontinuous IDs, but others can't. I would expect ID = -1 to cause some serious problems.

Isn't the civ with ID=0 at the top of your list? That's what I always see in my mod.
 
OK, my post above probably wasn't very helpful. It looks like you are working with someone else's Canada mod (nothing wrong with that) and are quite a beginner at modding (nothing wrong with that). What you really need to do is get that Canada civ to have ID=0. Unfortunately, the way things are now is that Americans have ID=0 and everything else just gets numbered sequentially, with the custom civ last.

This is the XML code you need to delete those pesky Americans and replace them with Canada (who wouldn't want to do that?!):

Code:
<GameData>
	<Civilizations>
		<Delete ID="0"/>
		<Update>
			<Set ID="0"/>
			<Where Type="CIVILIZATION_CANADA"/>
		</Update>
	</Civilizations>
</GameData>

What you really need is this (I fixed your indentation; please use code tags [CODE] [/CODE] around any code you post in the forums):

Code:
<Civilizations>
		<Row>
			<Type>CIVILIZATION_CANADA</Type>
			<Description>TXT_KEY_CIV_CANADA_DESC</Description>
			<ShortDescription>TXT_KEY_CIV_CANADA_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_CIV_CANADA_ADJECTIVE</Adjective>
			<Civilopedia>TXT_KEY_CIV_CANADA_PEDIA</Civilopedia>
			<CivilopediaTag>TXT_KEY_CIV5_CANADA</CivilopediaTag>
			<DefaultPlayerColor>PLAYERCOLOR_RED</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_ENGLAND</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
			<ArtStyleSuffix>_EURO</ArtStyleSuffix>
			<ArtStylePrefix>EUROPEAN </ArtStylePrefix>
			<PortraitIndex>0</PortraitIndex>
			<IconAtlas>CIV_COLOR_ATLAS_CANADA</IconAtlas>
			<AlphaIconAtlas>CIV_ALPHA_ATLAS</AlphaIconAtlas>
			<MapImage>MapCanada512.dds</MapImage>
			<DawnOfManQuote>TXT_KEY_CIV5_CANADA_TEXT_1</DawnOfManQuote>
			<DawnOfManImage>MacDonaldDOM.dds</DawnOfManImage>
		</Row>
		<Delete ID="0"/>
		<Update>
			<Set ID="0"/>
			<Where Type="CIVILIZATION_CANADA"/>
		</Update>
</Civilizations>

If you really want Americans in your mod too, I would do things in this order:
  1. Delete Americans
  2. Add Americans to end of table (copy from core game table without the ID=0 line)
  3. Add Canadians to end of table
  4. Move Canadians to ID=0

Like this:

Code:
<Civilizations>
		<Delete ID="0"/>
		<Row>
			<Type>CIVILIZATION_AMERICA</Type>
			<Description>TXT_KEY_CIV_AMERICA_DESC</Description>
			<ShortDescription>TXT_KEY_CIV_AMERICA_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_CIV_AMERICA_ADJECTIVE</Adjective>
			<CivilopediaTag>TXT_KEY_CIV5_UNITEDSTATES</CivilopediaTag>
			<DefaultPlayerColor>PLAYERCOLOR_AMERICA</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_AMERICA</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
			<PortraitIndex>0</PortraitIndex>
			<IconAtlas>CIV_COLOR_ATLAS</IconAtlas>
			<AlphaIconAtlas>CIV_ALPHA_ATLAS</AlphaIconAtlas>
			<MapImage>MapAmerica512.dds</MapImage>
			<ArtStyleSuffix>_EURO</ArtStyleSuffix>
			<ArtStylePrefix>EUROPEAN </ArtStylePrefix>
			<DawnOfManQuote>TXT_KEY_CIV5_DAWN_UNITEDSTATES_TEXT</DawnOfManQuote>
			<DawnOfManImage>DOM_Washington.dds</DawnOfManImage>
			<DawnOfManAudio>AS2D_DOM_SPEECH_UNITED_STATES</DawnOfManAudio>
		</Row>

		<Row>
			<Type>CIVILIZATION_CANADA</Type>
			<Description>TXT_KEY_CIV_CANADA_DESC</Description>
			<ShortDescription>TXT_KEY_CIV_CANADA_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_CIV_CANADA_ADJECTIVE</Adjective>
			<Civilopedia>TXT_KEY_CIV_CANADA_PEDIA</Civilopedia>
			<CivilopediaTag>TXT_KEY_CIV5_CANADA</CivilopediaTag>
			<DefaultPlayerColor>PLAYERCOLOR_RED</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_ENGLAND</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
			<ArtStyleSuffix>_EURO</ArtStyleSuffix>
			<ArtStylePrefix>EUROPEAN </ArtStylePrefix>
			<PortraitIndex>0</PortraitIndex>
			<IconAtlas>CIV_COLOR_ATLAS_CANADA</IconAtlas>
			<AlphaIconAtlas>CIV_ALPHA_ATLAS</AlphaIconAtlas>
			<MapImage>MapCanada512.dds</MapImage>
			<DawnOfManQuote>TXT_KEY_CIV5_CANADA_TEXT_1</DawnOfManQuote>
			<DawnOfManImage>MacDonaldDOM.dds</DawnOfManImage>
		</Row>

		<Update>
			<Set ID="0"/>
			<Where Type="CIVILIZATION_CANADA"/>
		</Update>
</Civilizations>
Note that I left out the <GameData></GameData> enclosure in the last two code boxes.

I generally do all my modding in SQL rather than XML, so I'm not 100% sure about my syntax here (I know the logic is correct and I could do this in SQL).
 
What you really need to do is get that Canada civ to have ID=0.

Which won't work as both the civ lists (the one on the main game setup screen and the one on the drop-downs in the Adv Setup screen) are sorted alphabetically by Leader description - America is not first in the list, in fact Washington is the penultimate entry.

If all you want is modded civs at the top of these lists, change the sort order of these two lists to be by "id descending" - for build 511 the two files in question are in C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v\assets\UI\FrontEnd\GameSetup and are AdvancedSetup.lua and SelectCivilization.lua - search for "table.sort" and then look for the ones that sort by leader description and you'll find the code blocks that need changing.

There's a patch due today, so you may want to hold off editing these as any update will delete your changes .
 
Top Bottom