Names
All player names in OOTP can be found in the names.xml file located in the database folder of the customizable data folder. This is a large file containing over 250,000 lines consisting of First Names (30,000+), Last Names (220,000+) and Nicknames (4000+). As with the world database file (world_default.xml) the use of an advanced text editor is highly recommended.
File Structure
The names.xml has three sections for each name type.
<FIRST_NAMES> </FIRST_NAMES>
<LAST_NAMES> </LAST_NAMES>
<NICK_NAMES> </NICK_NAMES>
All three sections use the same format for each name and each name is on a single line. Here is an expanded example:
<N nid="121664">
<EN>Markus</EN>
<ES>Markus</ES>
<KR>마커스</KR>
<JP>マーカス</JP>
<CN>馬庫斯</CN>
<NL>
<L lid="0" dist="2"/>
<L lid="6" dist="1"/>
<L lid="7" dist="1"/>
<L lid="10" dist="6"/>
<L lid="11" dist="1"/>
<L lid="12" dist="1"/>
<L lid="32" dist="1"/>
<L lid="39" dist="1"/>
</NL>
</N>
The first line <N> contains a unique name ID (nid). The name ids do not need to be in a sequential order, they just need to be unique.
The second section contains the name and language localization versions of the name. The default name is within the English <EN> tags.
The next section is the Names List section and this is where the name is associated with the Ethnicity IDs in the world_default.xml file. In the example the first "Language ID" lid is "0", this corresponds with the Ethnicity ID of 0 which is "U.S. (Modern)". The second is "6" which corresponds with "Dutch".
"dist" is used to set how frequently the name will appear in that specific Languague ID "lid". As with the world_default.xml file this number is not a set percentage, it is a relative value. As an example the name "Smith" has a distribution value of "34859" in the U.S. Modern lid, whereas "Smithers" has a distribution value of "54"
Player Name Selection
When the game creates a player it will first generate the country of origin (Nation id) based on the league settings and the type of player being created. Within that Nation the game will check the distribution of the Ethnicity IDs and select one. The game will then "randomly" select a name matching that ethnicity from the names file with the likelihood of selection based off of the distribution weights.
Importing the names.xml File
New Game
Option 1: Overwrite the names.xml file in the \data\database folder (make a backup of the original file)
Option 2: 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).
Note: Whenever a game patch is installed the default files in the database folder will be overwritten so be sure to keep a separate copy of your custom file.
Existing Games
The names.xml file can be imported in 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 name & ethnicity database. It is recommended to backup your league file before re-importing the edited data.
Tips for Editing the names.xml File
If you just want to add a few names into your game they can simply be added to the file in the appropriate section. Just make sure to use a unique Name ID number.
However, If you are working with larger amounts of data it is best to use spreadsheets to edit and manipulate your data.
Unlike the world_default.xml file the names file is a bit more complicated due to the way Language IDs are linked to names. It's more difficult to organize namesets based on ethinicities.
One option, and the simplest, is to not worry about duplicate name entries and simply have an individual spreadsheet sheet for each ethnicity. Just make sure that each name still has a unique ID.
Another option is to take everything from option one, combine it into one sheet, sort by name and then manually merge each individual lid name into one name with multiple lid and dist
As with the the world_default.xml file, xml tags can be inserted into spreadsheet columns to build the individual xml lines. See world_default.xml Advanced Editing Tips