AI Leader Names

Article written by Vardamir
Published on 03-20-2017; updated on 03-20-2017
Tags: AI, Language Files, Userpatch

A small but nice feature of AoK is a random selection names for AI players. While other games might always have the Japanese AI be Tokugawa, AoK can have Hojou Soun, Saito Dousan, Oda Nobunaga, Gamou Ujisato, Date Masamune, Mouri Motonari, Uesugi Kenshin, Takeda Shingen, Sanada Yukimura, Tokugawa Ieyasu, Nitta Yoshisada, Tairano Kiyomori, Ashikaga Takauji, Imagawa Yoshimoto, Kusunoki Masashige, Hosokawa Katsumoto, Minamotono Yoritomo, Fujiwarano Michinaga, or Minamotono Yoshitsune.

How does the game decide what name to choose? As it turns out, this is entirely controlled within the language files. In order to edit the CD version, you'll need a dll editor such as Resource Hacker, whereas any text editor will suffice for the HD edition.

The names are stored in varying locations based on expansion. Pre-Conquerors names can be found at ID 4400 in language.dll or key-value-strings-utf.txt:

4400, 	"16"
4401, 	"Henry V"
4402, 	"Richard II"
4403, 	"William III"
4404, 	"Lord Talbot"
4405, 	"Prince John"
4406, 	"King Edward"
4407, 	"Henry Tudor"
4408, 	"Earl of Wessex"
4409, 	"Earl of Warwick"
4410, 	"Alfred the Great"
4411, 	"Lord Henry Percy"
4412, 	"The Black Prince"
4413, 	"Duke of Normandy"
4414, 	"Edward Longshanks"
4415, 	"Henry Bolingbroke"
4416, 	"Richard the Lionhearted"
4420, 	"15"
4421, 	"Roland"
4422, 	"Louis IX"
4423, 	"Louis VI"
4424, 	"Louis XI"
4425, 	"Charles VI"
4426, 	"Charlemagne"
4427, 	"King Philip I"
4428, 	"Charles Martel"
4429, 	"Pepin the Short"
4430, 	"Philip the Good"
4431, 	"Charles the Bold"
4432, 	"Philip II Augustus"
4433, 	"Constable Richemont"
4434, 	"Jean Dunois of Orleans"
4435, 	"Raymond,Prince of Antioch"
4440, 	"8"
4441, 	"Athaulf"
4442, 	"King Wallia"
4443, 	"King Alaric II"
4444, 	"King Leovigild"
4445, 	"Teias the Goth"
4446, 	"General Theodemir"
4447, 	"Theodoric the Goth"
4448, 	"King Euric the Visigoth"

The list for each civ start with a number denoting its length, ranging between 8 and 19. 8 is not the technical minimum, but it hypothetically ensures that a name will not ever be used by two AI players. Conversely, 19 is the maximum. A name list starts at 20 IDs after the beginning of the previous list.

Conquerors names start at 4800 in the CD version, or 5800 in the HD Edition. Why the change? There's not enough room for more than a 19th civ before other language IDs are used. Userpatch allows the Conquerors ID start to be shifted, which was done for Forgotten Empires mod and kept for the Forgotten DLC:

Userpatch Civilization Settings

From Userpatch's documentation:

civilizations.aiNameOffset : int
- default: 140
- the offset from the end of the Age of Kings' AI names to the start of the Conquerors'
- Age of Kings AI names end at 4660 (4656, but 20 are reserved per civ)
- Conquerors AI names start at 4800, making the value 140 (4800-4660)

Names for civilizations added with Userpatch can be added immediately after Conquerors names, wherever they have been shifted.

Finally, African Kingdoms names begin at ID 106000.

Do you want to comment on this article? Thank the author? Tribute resources for its improvement? Raze it to the ground?

Come by and visit its thread in the University Forum!