Changing / Adding Civs in a Worldbuilder file

blitzkrieg1980

Octobrist
Joined
Aug 29, 2006
Messages
4,899
Location
New Jersey, USA
I'm not sure if this has been posted before but I couldn't find when doing several Google & Civfanatics searches. This is a basic tutorial on the fields and data that need to be manipulated in order to change the leaders in a Worldbuilder file. Specifically, this thread is a response to a request/question in the General forums here.

I will be using the Earth18civs worldbuilder file that comes with BTS. We will be changing several of the civs that are included in that file in order to get a little balance and shift the game so that Qin and Cyrus aren't always dominant powers and the New World has a chance to be something other than Montezuma murdering Roosevelt and a 3 city Capac.

Locate the World Builder file
The first step is to locate the worldbuilder file that you wish to manipulate. In my system, the custom scenario worldbuilder files are located in
Code:
C:\Program Files (x86)\2K Games\Civilization 4 Complete\PublicMaps
but I can't guarantee that's where you will find them especially if you use Steam. Macs can find these files by going to their Applications folder and locating the PublicMaps folder for BTS there (again, Steam is a different story).

Once you have located the worldbuilder file you wish to manipulate (in this case, I'm using Earth18Civs), copy it and paste with an altered name as it is always good practice to backup the original files that came with the game. Then, open it with a text editor of your choice (I like Notepad++).

A World of Worldbuilder Options
In this file, you can manipulate just about anything about a map that you want. You can manually alter tiles, assign bonus resources, change the leaders/civs/starting locations, and even assign teams (which work like permanent alliances). There is a fairly comprehensive manual for this file located here: Worldbuilder File Manual. However, I will be covering the specific fields that need to be manipulated in order to change and/or add new civs to a worldbuilder file.

Changing Civs Out
This process is fairly simple and straight forward. For this example, I will change Montezuma in Earth18Civs to Pacal II (which might actually give Roosevelt a chance and help advance the old world).

Original code
Code:
BeginPlayer
	LeaderType=LEADER_MONTEZUMA
	CivType=CIVILIZATION_AZTEC                         
	Team=16                         
	PlayableCiv=1                         
	StartingX=19, StartingY=37                         
	Handicap=HANDICAP_NOBLE                         
EndPlayer
Altered Code
Code:
BeginPlayer
	LeaderType=LEADER_PACAL
	CivType=CIVILIZATION_MAYA                         
	Team=16                         
	PlayableCiv=1                         
	StartingX=19, StartingY=37                         
	Handicap=HANDICAP_NOBLE                         
EndPlayer

  1. Locate the leader you wish to change by searching for LEADER_MONTEZUMA (insert the leader you wish to change in place of Montezuma)
  2. This is the "LeaderType" field. Change it to reflect the leader you want. I will change Montezuma to Pacal so I will alter LEADER_MONTEZUMA to be LEADER_PACAL
  3. Below the "LeaderType" field is the "CivType" field. NOTE: If you plan on having a civ that isn't associated to the leader you chose, make sure you have the "Unrestricted Leaders" option checked when you go to play the game.
  4. Change the "CivType" from CIVILIZATION_AZTEC to CIVILIZATION_MAYA (again, substitute the names I have for your particular situation)

Make sure to alter the starting techs for the "team" assigned to your leader so that the starting techs match the default for the leader's civ.
Original Team Code
Code:
BeginTeam                         
	Tech=TECH_MYSTICISM                         
	Tech=TECH_HUNTING                         
EndTeam
Altered Team Code
Code:
BeginTeam                         
	Tech=TECH_MYSTICISM                         
	Tech=TECH_MINING
EndTeam

Starting Location
If you don't need to change the starting location of the changed civ, there's nothing else to do! If you do want to change the starting location, you can alter the "StartingX" and "StartingY" values. As far as I know, the "origin" (0,0) is the bottom and leftmost tile on the map. The further to the east you go, the more positive X value is. The further north you go, the more positive Y value is.

I, personally, would check to make sure that your chosen starting spot is a viable tile and not an "impassable" tile such as a mountain, coast, or ocean. You can do this by doing a search for "x=15,y=20" (substitute 15 and 20 for the x/y coordinates you want to use as starting location). This will bring you to the part of the worldbuilder file which defines the tile at coordinates (15,20). You can verify the terrain type is not an impassable tile or that it doesn't have a resource on it.

Adding a New Civ
Please note that if you plan on adding more than 18civs, you should probably have a modified DLL file since the out-of-the-box DLL only allows for 18civs. The 50civ DLL can be found here. Other than that, follow the steps below to add a new civ to a worldbuilder file.

Follow these directions if you are altering a map that has less than 18 civs in it. (Skip to the next set of directions if you are altering a map file that already has 18 or more civs in it)
  1. Go to the last "BeginTeam" entry that has data in it (it is the last entry that has techs defined in the data).
  2. Once located, go to the next "BeginTeam" entry and hit enter to insert a line between "BeginTeam" and "EndTeam".
  3. Enter "Tech=", enter the first starting tech for the civ you want to add and hit enter to insert another line (example Tech=TECH_AGRICULTURE)
  4. Enter "Tech=", enter the second starting tech for the civ you want to add (example Tech=TECH_MINING)
  5. Go to first "BeginPlayer" entry that has NONE entered next to "LeaderType"
  6. Change LeaderType=NONE to the leader you want to enter (example LeaderType=LEADER_PACAL)
  7. Change CivType=NONE to the civ you want to enter (example CivType=CIVILIZATION_MAYA)
  8. Add a new line after the "Team" line
  9. Enter PlayableCiv=1 and add a new line
  10. Enter StartingX=#, StartingY=# substituting the # for actual numbers (again make sure the tile location you are assigning as start location isn't an impassable terrain type)
  11. Add another new line and enter Handicap=HANDICAP_NOBLE (this can be changed when you actually start the custom scenario but you should set it to default NOBLE)
Original Team Code
Code:
BeginTeam                         
EndTeam
Altered Team Code
Code:
BeginTeam                         
	Tech=TECH_MYSTICISM                         
	Tech=TECH_MINING                         
EndTeam

Original Player Code
Code:
BeginPlayer
	LeaderType=NONE
	CivType=NONE
	Team=10
EndPlayer
Altered Player Code
Code:
BeginPlayer
	LeaderType=LEADER_PACAL
	CivType=CIVILIZATION_MAYA
	Team=10
	PlayableCiv=1
	StartingX=80, StartingY=51
	Handicap=HANDICAP_NOBLE
EndPlayer

That's it! Rinse and repeat to add up to 18 civs. If you want to add more than 18 civs, follow the directions below.

If you are adding a civ to a map file that already has 18 civs, follow these directions.
  1. Locate the last "BeginTeam" entry in the file
  2. Copy from "BeginTeam" to "EndTeam" (inclusive) and paste it after the last "EndTeam"
  3. Change the starting techs to reflect the civ you want to add. For example, to add Sumeria, you want to have Tech=TECH_AGRICULTURE and Tech=TECH_THE_WHEEL since Sumeria starts with The Wheel and Agriculture
  4. Locate the last "BeginPlayer" entry in the file and copy/paste it
  5. Increment the "Team" field (if the "Team" value from the leader you copied was 18, you should change it to 19). We need the leader to match up with the team which is why it is important that you paste the new "BeginPlayer" and "BeginTeam" below the last in the list.
  6. Change the other player data just like you did in the "Changing Civs Out" section

With the 50 Civ DLL, you could add 32 more civs to the Earth map using the method outlined above (though this would be quite overcrowded). This method should be valid to use with any worldbuilder file.

In order to play your altered worldbuilder file, start the game as usual. Choose Single Player > Custom Scenario. In the list of scenarios, you will find your custom worldbuilder file with the altered name you gave in the first step of this tutorial.
 
Hi, thanks for this but WHERE do I get the information to put in each Begin Player field? Is there a LIST somewhere?

For example, I figured out the first couple of lines to add the British:
BeginPlayer
Team=18
LeaderType=LEADER_ELIZABETH
LeaderName=TXT_KEY_LEADER_ELIZABETH

But then I don't have the information to complete the field:
CivDesc=TXT_KEY_CIV_CARTHAGE_DESC
CivShortDesc=TXT_KEY_CIV_CARTHAGE_SHORT_DESC
CivAdjective=TXT_KEY_CIV_CARTHAGE_ADJECTIVE
FlagDecal=Art/Interface/TeamColor/FlagDECAL_Carthage.dds
WhiteFlag=0
CivType=CIVILIZATION_CARTHAGE
Color=PLAYERCOLOR_ORANGE
ArtStyle=ARTSTYLE_GRECO_ROMAN
PlayableCiv=1
MinorNationStatus=0
StartingGold=20
StateReligion=
StartingEra=ERA_ANCIENT
RandomStartLocation=false
CivicOption=CIVICOPTION_GOVERNMENT, Civic=CIVIC_DESPOTISM
CivicOption=CIVICOPTION_LEGAL, Civic=CIVIC_BARBARISM
CivicOption=CIVICOPTION_LABOR, Civic=CIVIC_TRIBALISM
CivicOption=CIVICOPTION_ECONOMY, Civic=CIVIC_DECENTRALIZATION
CivicOption=CIVICOPTION_RELIGION, Civic=CIVIC_PAGANISM
Handicap=HANDICAP_NOBLE
EndPlayer

Any help would be HUGELY appreciated...
 
Assets\Python\pyWB\CvWBDesc.py
This is however not really a list. Instead it's a parser to work as a bridge between the text file and the dll file. I'm not sure if anybody have taken the time to write a list of the options and even if somebody did that, I question how perfect it could be because it's one of those files, which can be modded. Obviously if you add a new feature in the dll then you also add it to the savegame and/or WBDesc if it makes sense/is needed. Imagine some magic themed mod where each player generates mana. Both WBDesc and savegames should handle currently stored mana for that to make sense.

In order to read the list of options for players specifically, you need to look up class CvPlayerDesc and in that class, def read(self, f). It has a bunch of lines looking like:
PHP:
v = parser.findTokenValue(toks, "CivDesc")
You can make your own list based on the token names mentioned here. In this specific case the token name is CivDesc. If you know something about programming you can also look at the next lines and figure out what the game is doing with each token when it reads them, though for the purpose of just making a list it's not strictly needed to be able to read the following code.
 
Top Bottom