You must be logged in to post messages.
Please login or register

The University
Moderated by Popeychops, Leif Ericson

Hop to:    
Welcome! You are not logged in. Please Login or Register.4 replies
Age of Kings Heaven » Forums » The University » AI Leader Names (Approved)
Bottom
Topic Subject:AI Leader Names (Approved)
Vardamir
Huskarl
posted 11-08-16 09:08 PM CT (US)         
This article has been approved and can also be read at the University. - Leif Ericson

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:



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.

AoK: Realms
Adds Armenians, Balts, Bamars, Bohemians, Bulgars, Burgundians, Chimus, Dutch, Helvetians, Jurchens, Khmers, Malays, Mandinkas, Moors, Muisca, Tamils, Tufans, Turcomans, and Viets

Genie Converter - an AKX installer for modern times

[This message has been edited by Vardamir (edited 08-08-2017 @ 07:33 PM).]

AuthorReplies:
TriRem
Huskarl
posted 11-17-16 03:29 AM CT (US)     1 / 4       
Nice and interesting article, never knew that.

One tiny nitpick is that even though 8 names seems to be the minimum in order for preventing AIs sharing the same name in 8 players games with the same civ, this can still happen. It may be a bug but in last game on UP 1.4 I got two Teias the goth AI.

Fluctuat nec mergitur.
Vardamir
Huskarl
posted 11-17-16 06:05 PM CT (US)     2 / 4       
Interesting. I've done a number of editor tests to check out names with new civs and never noticed any overlap.

AoK: Realms
Adds Armenians, Balts, Bamars, Bohemians, Bulgars, Burgundians, Chimus, Dutch, Helvetians, Jurchens, Khmers, Malays, Mandinkas, Moors, Muisca, Tamils, Tufans, Turcomans, and Viets

Genie Converter - an AKX installer for modern times
TriRem
Huskarl
posted 11-18-16 04:44 AM CT (US)     3 / 4       
I just reproduced it, it was in AoFE. I got two Teodoric the Goth, my language files are in French if it makes a difference (just checked the language files, everything is fine).

Fluctuat nec mergitur.

[This message has been edited by TriRem (edited 11-18-2016 @ 04:48 AM).]

Jineapple
Squire
posted 03-02-17 07:13 AM CT (US)     4 / 4       
I've noticed the same thing when working on Wololo Kingdoms. It happens only rarely (way less than you would except if every name pick was independent from the others), but it does happen.

Thanks for the thread, got the AI names working properly
On a side note, when I shifted the AI names to 8500+ (the first block with enough space) I got problems with RMS generation. Maybe there are lines in the dll that aren't there in the HD .txt anymore, don't have the tools around to check atm. In any case, shifting to 11500+ worked.
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Kings Heaven | HeavenGames