Nations, Cities, and Player Origins
OOTP comes with a world database that includes over 80,000 cities and all the nations in the world today. But, perhaps you don't want to use the real world for your baseball universe. Perhaps you want to add new cities or play in an entirely fictional universe. Luckily, most of the world database is customizable!
The OOTP world database is contained in the world_default.xml file located in the database folder of the customizable data folder. Any time a new game is created OOTP will use this file to generate the baseball world.
world_default.xml
The world_default.xml file can be edited in any text editing program(notepad), but using a more advanced text editor with color coding, line numbers and other quality of life options is highly recommended (ex: notepad++). Before editing the file make a backup of the original or work on a copy.
Basic Structure
World
- Ethnicities
- Continents
- Nations
- Nation
- State
- Cities
- State
- Nation
- Nations
- Regions
Ethnicities
OOTP primarily uses "ethnicities" to generate Facegen images of players. They are also used in conjunction with the names.xml file to generate appropriate player names. Nations can have multiple "ethnicites" and each one can be distributed or weighted independently. Names can also be used for multiple "ethnicites" and their frequency can be set for each ethnicity independently.
By default OOTP comes with 40 ethnicities with various distributions of face types for each. You can create your own by editing and existing entry or by adding to the list.
Example:
<ETHNICITY id="0" name="U.S. (Modern)" name_korean="미국(현대)" african="0" asian="0" east_indian="0" caucasian="1000" hispanic="0" />
<ETHNICITY id="1" name="Hispanic" name_korean="히스패닉" african="300" asian="0" east_indian="0" caucasian="50" hispanic="650" />
The first entry is for "U.S. (Modern)" and will create 100% caucasian facegens. The distribution is set using a scale of 0 to 1000. The second entry is for "Hispanic" and has a different distribution of facegen types. It's important to note that these distributions are used solely for the face types created by facegen.
As shown later, each ethnicity can be used within a Nation along with a distribution percentage. Each name in the names database can also be linked to multiple ethnicities with different distribution percentages.
Continents
The continents section is only used for organizational and display purposes.
Nations
Each Nation has a unique ID and several attributes . Here is an example of the Nation entry for Canada
<NATION id="36" name="Canada" name_korean="캐나다" short_korean="캐나다" pop="35151728" etid="32" capid="57981" gender="0" bbqual="5" abbr="CAN" abbr_korean="CAN" dem="Canadian" dem_korean="캐나다인" time_zone="-5">
- id: unique ID number
- name: The name of the country
- name/short_korean: Used for the Korean localization
- pop: the population of the country
- etid: the primary ethinicity of the country. (Only used as a fallback if the ethnicities aren't set at a lower level?)
- capid: the id number of the country's capital city
- gender: ?
- bbqual: the baseball quality of the nation on a scale of 1-5. see Baseball Quality
- abbr & abbr_korean: Country abbreviation. This abbreviation is used to load the Nation Flag of the same name. ex: CAN = can.png
- dem & dem_korean: used by OOTP's text engine
- time_zone: the primary time zone if not set at a lower level (state or city)
Within each <Nation> are two primary sections and an optional third.
<SECOND_NATIONS>
This section is optional and is used in the player selection process for international tournaments?.
<ETHN_PCTS>
This is where the distribution of ethnicities is set. Again using Canada as an example:
<ETHN_PCTS>
<ETHN_PCT etid="8" pct="5" />
<ETHN_PCT etid="32" pct="95" />
<ETHN_PCT etid="39" pct="5" />
</ETHN_PCTS>
- etid: the ethnicity ID as defined in the <ETHNICITIES> section
- pct: the relative usage of the ethnicity. Note: while most entries are defined as an even share of 100% this is not a requirement.
In this example the vast majority of players will use ethinicity # 32 "Canadian", while a smaller percentage will use #8 "French" and #39 "U.S. (African-American)"
<STATES>
This section is where each State/Province is defined.
<STATE id="678" name="Ontario" name_korean="온타리오" pop="13448494" abbr="ON" abbr_korean="ON" time_zone="-5" observes_dst="1">
- id: unique ID number
- name: state/province name
- pop: population
- abbr: abbreviation
- time_zone: time zone. Used if time zone is not set at the City level
- observes_dst: sets whether day light savings time is observed. 1 = "Yes" 0 = "No". Used if time zone is not set at the City level
<CITIES>
This section is where each city is defined
<CITY id="57981" name="Ottawa" name_korean="오타와" pop="812129" lat="45.42000" long="-75.71000" abbr="OTT" abbr_korean="OTT" />
- id: unique ID number
- name/name_korean: City name/Korean localization
- pop: city population (Can be used on inaugural draft screen to set team market size)
- lat and long: Latitude and Longitude of the city. (Used in determining "close to home" calculations?)
- abbr: city abbreviation. Used for team abbreviations when generating teams.
- time_zone: (Optional - use if different than State) time zone of the city
- observes_dst: (Optional - use if different than State) sets whether daylight savings time is observed
- altitude: (Optional) a value of 0-6. If not set the default is set to 0 (sea level?) with 1-6 being relative altitude. Used for park factors in generated ballparks?
<REGIONS>
Regions are used to group States or Nations together. Regions can be used to setup leagues and tournaments and can also be used to limit foreign player usage and to limit teams to specific draft regions.
Regions can be organized as a group of States or as a group of Nations. There are also a group of auto-generated regions (hardcoded?) that are based on the baseball quality of all nations.
<REGION id="36" sort_order="1020" name="AMERICAS: USA / Canada / Mexico" name_korean="아메리카: 미국/캐나다/멕시코">
<REGION_NATIONS>
<REGION_NATION id="36" />
<REGION_NATION id="124" />
<REGION_NATION id="206" />
</REGION_NATIONS>
</REGION>
- id: unique Region ID
- sort_order: Used to determine order in the selection menu (Clarification Needed)
- name: Name to describe the region.
In the above example the Nation ids of Canada, Mexico and the USA are used.
Advanced Editing Tips
Manually editing the xml file can be very tedious, but it can be made easier by first manipulating the data in a spreadsheet and then inserting that data back into the xml. One method is to insert the xml tags between the finished columns of data. As an example here what a spreadsheet of city data would look like with xml tags inserted between the spreadsheet data (Using the previous example of Ottawa without the Korean localization fields):
ID | Name | Pop | LAT | LONG | ABBR | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
<CITY id=" | 57981 | " name=" | Ottawa
|
" pop=" | 812129 | " lat=" | 45.42 | " long=" | -75.71 | "abbr=" | OTT | " /> |
Once completed you can copy and paste the city entries in the appropriate <CITIES> </CITIES> section.
Fixing Errors
If you make a mistake in your xml file OOTP will generate an error message when it can't parse the xml file. This error message will include a line number which can be used to find the approximate location of the mistake. This is one reason why an advanced text editor is recommended. Most errors will be from missing quotation marks, missing closing tags ( />) and mismatching section pairs (<STATE> without a closing </STATE>).
Using a Custom File for a New Game
OOTP provides a method to use custom files without the need to overwrite the default files in the database folder. To do this create a New Custom Game from the main screen and enter Advanced Mode by clicking the button at the bottom of the League Creation Wizard. Click on the Advanced tab at the top. Under Source Database Settings you can now select any custom database files you wish to use in your new custom game, if a file is missing OOTP will use the default file(s).
Importing an Edited File for an Existing Game
The world_default.xml file can be imported to an existing game from the Game Settings section. From the Game menu go to Game Settings and navigate to the Database tab. In the top right click the Database Tools drop down and select Re-import world database from XML file. It is recommended to backup your league file before re-importing the edited data.
Nation Flags
OOTP does not support a custom path for Nation Flags. All nation flags must be placed in the data/database/nation_flags folder and the file name must match the country abbreviation in the world_default.xml file. Files need to be in png format and the default flag size is 70px by 40px (Width x Height).
Example:
<NATION id="124" name="Mexico" name_korean="멕시코" short_korean="멕시코" pop="107550697" etid="1" capid="49935" gender="0" bbqual="5" abbr="MEX" abbr_korean="MEX" dem="Mexican" dem_korean="멕시코인" time_zone="-7" observes_dst="1">
The country abbreviation is "MEX" so the flag file is mex.png
This is all out of date.
OOTP's world database is actually nothing more than two text files: nations.txt and cities.txt. These are located in the datadatabase directory in your OOTP installation directory. The nations.txt and cities.txt files are used in a number of scenarios in the game:
In determining the nation for each league in your universeIn determining team cities based on the league nationIn determining player and coach origins and namesIn making decisions about whether a player wants to sign a contract, based on the distance between the team's location and the player's originThe nations.txt and cities.txt files are comma-separated text files. If you're not familiar with those, see this screenabout comma-separated files. In particular, if you're looking to edit the cities.txt file with Microsoft Excel, see this section of the page.
The world database is used for all leagues in a given saved game. There is no way, for example, to use one set of nations and cities for "League A" in your saved game, and a different set for "League B" in your saved game.
Read the following sections for more information:
The nations.txt FileThe cities.txt FilePutting Nations and Cities TogetherHands-on: NationsHands-on: CitiesEditing Nation Flags