An Introduction to Creating Units with AGE 2

Article written by Sarn
Published on 12-29-2011; updated on 07-10-2016
Tags: , ,

Many of us have, at one point or another, been designing a scenario and wished for “that one unit that they should have made!”? Well, now you can make it yourself! Using the Advanced Genie Editor (or AGE), you can change units, copy them, and even make completely new units. This guide will take you through the steps of making your first unit with AGE.

The tools

All you’ll need for this is a copy of The Conquerors (of course) and the Advanced Genie Editor 2(available here). This guide will be using AGE 2, which is still under development by Keisari Tapsa. The original AGE from stsb77 is also available here, but due to how much better AGE 2 is, it’s what I’ll recommend you use.

Setting it up

The first thing you’ll want to do is make a back-up of your data files that you’ll be editing. Go into your Age of Kings folder (usually C:\Program Files\Microsoft Games\Age of Empires II) and open the folder labeled “data.” Find the data files and copy them into another file somewhere else. The files you’ll want to copy, just to be safe, are “empires2.dat”, “empires2_x1.dat”, and “empires2_x1_p1.” If you have backups of these files, if you make a mistake in AGE that you cannot fix, you can replace the data files with the backups and still be able to play The Conquerors.

When you first open AGE, you’ll have a large window and a smaller pop-up window in front of it. In order for AGE to edit your data files, it needs to know where they are. At the top of the window, you’ll see a number of buttons. If you installed your copy of AoK in the default location (C:\Program Files\Microsoft Games\Age of Empires II), then you just need to click the “TC Defaults” button. If you installed it somewhere else, you’ll need to change the path in the boxes to go to your alternate installation location. Once you’ve finished this, click “OK” and we’ll get started.

Creating a unit

Before we actually create the unit, we need to make a quick change. At the top of screen just below the various tabs across the top, on the first line, there should be a box checked labeled “Automatically,” which automatically (surprise there) copies the unit to the selected civilizations (enabled using the row of boxes below). Still on the first line, select the “Including graphics” box. This means that all civilizations will have the same graphics that you make. If you un-select “Automatically,” everything you do will only affect the civilization that is selected above the unit list on the left and you can manually copy your unit to whatever civs you select by clicking the (currently grayed-out) “Copy” button. Now, on to the real fun!

When creating a new unit, there are two methods you can use. Your first option is to start completely new, a blank slate. The problem with this is that many of the data values are still unknown, so you won’t know what to put in some boxes, and they could affect the game if you don’t put the right value in. For this reason, I find it better (and faster) to use the other method.

The other method is much easier. First, you need to find the unit that most closely resembles the unit you want to make. Do you want to make a horseman of some kind? You could start with a copy of a knight or scout cavalry. Are you trying to make a new swordsman? You could copy the militia or champion. For this example, we’ll try to make a new kind of archer. So, to start, I’m going to copy the entry for “Archer.” If you notice on the left side of the window, there’s a large list of entries. You can click on a few and you can see that each entry is for a different building or unit. We’re interested in the Archer (ID number 4). Click on the Archer and then click the “Copy” button below the list. Next, click the “Add” button to create a new entry, then click the “Paste” button to paste the Archer data onto your new entry. Voila! You have created a new unit! However, this is just a copy of an archer. In order to make it into a new unit, we’ll need to make some changes.

What do we want to change?

There’s a great deal of things you can change for every unit, but a lot of them are more advanced or minor details. I’m going to cover some of the simplest and often-desired changes: Name, Graphics, HP, Speed, Range, and Attack.

Name

This is an obvious first change. We don’t want our new unit to be named “Archer,” do we? Not really. To change the name, there are two options. The first is to change the language.dll string for the unit. This box is located a few lines from the top of the window. AoK has a file that has a list of all the names used in the game, from “A Barbarian Proposal” (Scenario 4 in the Attila the Hun campaign) to “Yusuf” (A computer player in the El Cid campaign). If it’s text in the game, it’s in the language files. So, one option for changing a name is linking to a different string in the .dll file. The default for the archer is 5083. So, you could decide that you want your archer to be named “My granny,” (a taunt in the language file) you could, since it’s in the dll (string 7129 if you’re curious). The limitation here is that you can only use strings in the language file. Let’s say you want to name your new unit “Sniper” (which isn’t in the language file. You’re out of luck, right? Wrong!

Your other option allows you to enter in any name you want. To do this, first put a zero (0) in the “Language Dll Name” box, which should be right in the center fo your screen currently. This tell AGE to use the name in the “Name” box, which is right above the language DLLs section. Now that you’ve done this, delete the text in the “Name” box” (right now it should be “ARCHR”) and type the name you want. For this example, enter “Sniper.” Click in another box and look at the list on the left. You should see that our unit (ID 866, all the way at the bottom) is now named “Sniper.” Success!

Graphics

Another common desire is to change a unit’s graphics. For our sniper, let’s say I like the longbowman graphics better than the normal archer. There are 6 things we’ll need to change here. Grab a piece of paper or open a text document so you can copy down some numbers. We’ll first look at the Longbowman. Above the list on the left, you should see a number of boxes. The top one should say “0 — Gaia (2).” The second and third boxes are search boxes. In the first search box, type “Longbowman” and select the Longbowman from the list. Now, right below the Language DLLs section, there’s a section labeled graphics. The boxes we need to note down are the Icon, Attack Graphic, Standing Graphic, Walking Graphic, Dying Graphic, and Dead Unit. The first five are in the Graphics section and “Dead Unit” is about halfway down the page.

Make a list with each of the entries you need and the number on those boxes. When you’re done, you should have a list like this:

Icon — 41
Attack Graphic — 966
Standing Graphic — 972
Walking Graphic — 976
Dying Graphic — 969
Dead Unit — 115

Now that we have this information, we can go back to our new Sniper. Clear the search box and either scroll to the bottom of the list (where new units are created by default), or search for “Sniper.” Select it, then put the first value in the correct box (Icon goes in Icon, etc). Repeat for the other graphics. Now you have a unit that’s named “Sniper,” which looks like a Longbowman, but acts the same as an Archer (for now).

One thing you might want to do differently is give you new unit a different icon. Maybe you don’t want to confuse your Longbowmen and you Snipers. Who knows? If you want to use a different Icon, just find a unit with an icon you like and copy down the number. Let’s say we want to make our Sniper a bald guy. We could use Jean Bureau’s icon (68) instead and put “68” in the Icon box instead of 41 (Longbowman icon).

HP, Speed, Range

I put these together because 1) they’re all quick and easy, and 2) they’re right next to each other. Right below the graphics section, there are a number of boxes, among them are three specific ones we are interested in. The first is “Hit Points.” Simply enter the number of hit points you want this unit to have. Try to keep it realistic though. The toughest heroes only have a few hundred HP, while most infantry have less than 100. In order to make the unit balanced, let’s give him low HP to compensate for the high attack and range we’ll give him. Change the HP value to 20.

The next box is the speed box. This determines how fast the unit will move. The average speed for a unit is 1 (or almost 1). Let’s make our Sniper a little faster so he can run away from the units he is supposed to snipe. Change the speed value to 1.1.

If you look down and to the right, you’ll see the “Max Range” and “Min Range” boxes. The Max Range is the greatest distance your unit can shoot, while the Min Range is the shortest. Now, most snipers shoot from quite a distance, so let’s increase the Max Range to 9. Now, because we have such a large range, we also need to give the Sniper a greater Line of Sight (LOS) in order to see where he’s shooting. So, since the Max Range always needs to be smaller than the LOS, we’ll give the Sniper a LOS of 10. Change this value now.

Another thing to consider is the Minimum Range. Most snipers do not fire their weapons at a close range, so give the Sniper a minimum range of 4. One example of the minimum range in current units is the Skirmisher. Skirmishers are not able to attack units that are too close to themselves. What this means for us is that when you use the Sniper, you’ll need to keep him away from his targets; otherwise, he won’t be able to shoot them. You’ll also want to change the “Displayed Range” to match the Max Range, so that when you look at the Sniper in the game, the info on the unit will show that it has 9 range instead of 4.

Attack

Another common change is attack values. This gets a little more complicated because units’ attack values are linked to armor values. I’ll try to explain them as simply as possible.

First, you need to understand that there are a bunch of armor classes and each armor class has a corresponding attack class. In order to damage a unit with a certain armor class, the attacker needs to have the same attack class. For example, in order to damage a unit with Armor Class 1, the attacker needs to have Attack Class 1. Same with classes 2, 3, and so on. The two armor classes that all units and builds have are Class 3 and Class 4. Class 3 is the basic pierce (ranged) armor and Class 4 is the basic melee armor. This means that all ranged units (Class 3 attack) and melee units (Class 4 attack) can damage every unit.

Other classes are used for attack bonuses. For example, a Spearman has a Class 8 attack of 15. This means that he’ll do 15 extra damage to any unit that has Class 8 armor (Cavalry). This is why Spearmen do extra damage against cavalry. If you look to the right of the list of attacks, you can see the amount and the Class. To make it easier, there’s a drop-down list of all the classes and what groups they are. For example, if you want to do extra damage to Siege Weapons, just find it on the drop-down menu and click it; you don’t need to know the Class numbers.

For our example, we won’t try to make any special bonuses, but just increase the basic ranged attack. Now, as I mentioned, the basic ranged attack is Class 3. Snipers should do more damage than a normal archer, so we’ll increase his attack to 20. This means that he’ll do a lot of damage, but remember that he has lower HP and cannot shoot units that are too close. Click the Class 3 entry (it’s the third one, number 2 — It should say “2 — Amount: 4 — Class 3) and change the the “Amount” to 20. You should see that the Amount in Class 3 entry has changed. Now your Sniper does 20 damage per arrow instead of 4. Finally, you’ll want to change the “Displayed Attack” value to match your base pierce attack (Class 3). If we were making a melee unit, we would want it to match the base melee (Class 4). Do this now.

Wrapping up

Look up to the upper left-hand corner of the window and you’ll see a couple gate icons. Click the one labeled “Save” to save your changes. Give the path to your data files (or click “TC defaults” if you installed in the default location) and then click OK.

There you go! You’ve successfully created your first new unit. You’ve made a Sniper, which shoots farther, runs a little faster and does more damage than a normal archer, but which has lower HP and cannot shoot nearby enemies. If you want to open up the scenario editor, it will be in the units list and you can play around with it. If you want to make it stronger or weaker, faster or slower, or name it something else, feel free to go play around in with the values in AGE until you’re satisfied. If you want to make another unit, use the same method: copy a similar unit, change what you want, save, and enjoy!

I’d encourage you to play around with things in AGE. That’s the way I learned most of what I know. Also, check the AoK Hend Modding forums; there is a lot of knowledge there. Just always remember to make backups of your files and you’ll be amazed with what you can discover with a bit of creativity.


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!