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.7 replies
Age of Kings Heaven » Forums » The University » Adding User Interface for new civilizations (Approved)
Topic Subject:Adding User Interface for new civilizations (Approved)
posted 11-16-16 06:29 AM CT (US)         
This article has been approved and can also be read at the University. - Leif Ericson

If like me you have always wanted to add THAT civilization you felt was missing from the game, you may have tried to do so thaks to the UserPatch following this guide, but you will then realize that when trying ingame, the civilization lacks the User Interface. In this article we will look at how to add new UI.

Adding User Interface for new civilizations

Preparation :
You must have the UserPatch installed for this to work, and have followed LmScar13's guide on how to add new civilizations.
This guide explains how to add UI to new civs for The Conquerors, but adding to mods such as Forgotten Empires follows the exact same process.
Adding new civilization to the HD edition is NOT possible at the moment this article is written.

Section 1 Where to store UI

User Interfaces are stored in the interfac.drs in the DATA folder. There are three UI for each civ, small, medium and large. They are stored at very specific IDs in the .drs file :

-Interface 800x600 : 51100 + ID + civ ID
-Interface 1024x768 : 51100 + 20 + civ ID
-Interface 1280x1024: 51100 + 40 + civ ID

Section 2 Adding UI

In the XML file you edited to add your new civilization, the first lines are these :

<?xml version="1.0" encoding="utf-8"?>
<configuration game="age2_x1">
<name>Age of Empires II: The Conquerors Expansion 2</name>
<path>The Conquerors</path>
<civilizations langId="10230" descId="20150" aiNameOffset="140" uiBaseId="51100" uiStride="20" uiOffset="2">

uiBaseId specifies the first civilization UI slp in interfac.drs.
uiStride specifies the total number of civ UIs. This can be greater than the number of civilization.
uiOffset specifies the gap between the last UI of one resolution and the first UI of the next largest resolution.

Set uiOffset to 0, there is no use of having a gap between IDs as we will use these IDs.

To add a new UI for a new civ we just extract the 3 UI of an existing civ from the interfac.drs using Turtle Pack, and add them to the gamedata_x1_p1.drs. Then we rename them accordingly to the civ ID we want to link them to.

As an example the IDs for the 19th civ would be 51119, 51139 and 51159.

The civ ID is the ID we find in the age2_x1.xml or in AGE.

But what if we have more than 20 civilizations ? We wouldn't have enough space to store the UI since some ID would overlap.
Fortunately the UserPatch provides us with a solution allowing to expand well beyond 20 civilization.

Section 3 Expanding the number of civilization

Onto the problem, we have to increase the uiStride number to a greater one, let's say 30.

This way the interfaces ID will work this way :

-Interface 800x600 : 51100 + ID + civ ID
-Interface 1024x768 : 51100 + 30 + civ ID
-Interface 1280x1024: 51100 + 60 + civ ID

Very important : By doing so we have to adjust the existing UI to match the new ID the executable read them.
The Interface 1024x768 will have to be moved 10 ID up, and the Interface 1280x1024 20 ID up to make up for that change.

The IDs for the 19th civ would then be 51119, 51149 and 51179.

Once this is done, we now have 30 UI slots, that's enough for 12 new civilizations over The Conquerors, and we can always extend it if we need more.

Fluctuat nec mergitur.

[This message has been edited by Leif Ericson (edited 03-20-2017 @ 07:12 PM).]

posted 11-16-16 06:29 AM CT (US)     1 / 7       
If you find anything to add or any mistake I made please comment so I can improve the article

Fluctuat nec mergitur.
posted 11-14-17 11:45 PM CT (US)     2 / 7       
When pissible add new civ for Hd?
posted 11-15-17 02:11 AM CT (US)     3 / 7       
Probably never.

Fluctuat nec mergitur.
posted 11-15-17 09:45 AM CT (US)     4 / 7       
Why we cant add new civ for hd?
posted 11-16-17 07:12 AM CT (US)     5 / 7       
Because HD modding support is far worse than UP modding support. Just one of many shortcomings unfortunately.
posted 10-24-18 04:06 PM CT (US)     6 / 7       
As the civ limit was expanded, there is any change here?
posted 01-03-19 12:05 PM CT (US)     7 / 7       
What is the slp name of user interface of dlc civilization in HD. Can't find it. For example I couldn't find 51208 of wololo kingdoms mod in HD version.
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Kings Heaven | HeavenGames