How to Make New Units


By Mythic Commodore

This guide assumes that you have unpacked the data files using the method found here.

Also, it is assumed that you have an understanding of the export_descr_unit.txt file. For information on that file, see my export_descr_unit.txt guide. For my example, I will be making Berserkergang. Basically, they will look like Viking Raiders with an armour upgrade, with a small unit size and a large attack. In addition, they will be led by a Norse Swordsman. It usually works best to start with a similar unit, so I will start with Viking Raiders. Their entry looks like this:

    type Viking Raiders dictionary Viking_Raiders ; Viking Raiders category infantry class light voice_type Light banner faction main_infantry banner holy crusade soldier Viking_Raiders, 60, 0, 1 attributes sea_faring, hide_forest, hardy, can_withdraw formation 1.2, 1.2, 2.4, 2.4, 4, square stat_health 1, 0 stat_pri 9, 2, no, 0, 0, melee, melee_blade, slashing, axe, 25, 1.2 ;stat_pri_ex 0, 0, 0 stat_pri_attr ap stat_sec 0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1 ;stat_sec_ex 0, 0, 0 stat_sec_attr no stat_pri_armour 0, 3, 6, flesh ;stat_armour_ex 0, 4, 5, 7, 3, 6, 6, flesh stat_sec_armour 0, 0, flesh stat_heat 2 stat_ground 1, -2, 3, 2 stat_mental 5, normal, untrained stat_charge_dist 40 stat_fire_delay 0 stat_food 60, 300 stat_cost 1, 480, 155, 85, 65, 480, 4, 120 armour_ug_levels 0, 1, 2, 3 armour_ug_models Viking_Raiders, Viking_Raiders_ug1, Viking_Raiders_ug2, Viking_Raiders_ug3 ownership denmark, slave era 0 denmark ;unit_info 9, 0, 9
I will edit it a bit:

    type Norse Super Warriors dictionary Norse_Super_warriors ; Berserkergang category infantry class heavy voice_type Heavy accent East_European banner faction main_infantry banner holy crusade soldier Viking_Raiders_ug1, 12, 0, 1.2 officer norse_swordsmen_ug2 attributes sea_faring, hide_improved_forest, very_hardy, can_withdraw, frighten_foot, hide_anywhere formation 1.2, 1.2, 2.4, 2.4, 4, square, shield_wall stat_health 1, 0 stat_pri 19, 5, no, 0, 0, melee, melee_blade, slashing, axe, 25, 1.2 ;stat_pri_ex 0, 0, 0 stat_pri_attr ap stat_sec 0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1 ;stat_sec_ex 0, 0, 0 stat_sec_attr no stat_pri_armour 4, 15, 10, flesh ;stat_armour_ex 0, 2, 3, 5, 3, 8, 8, flesh stat_sec_armour 0, 0, flesh stat_heat 4 stat_ground 1, -2, 3, 4 stat_mental 10, disciplined, highly_trained stat_charge_dist 40 stat_fire_delay 0 stat_food 60, 300 stat_cost 1, 800, 103, 65, 150, 800, 2, 300 armour_ug_levels 0 armour_ug_models Viking_Raiders ownership denmark era 0 denmark era 1 denmark era 2 denmark ;unit_info 7, 0, 11

Image
Berserkergang - the new unit in all it's glory but more work remains.

These warriors will be powerful, but not unstoppable. Here's what they look like ingame:
....and that's on huge unit sizes! They may look good, but the unit description reveals that they are far from finished:

Note not only the absence of a name and description, but the absence of a proper picture. These are our next goals.

The first task is to give the unit a real name. To do this, you need to go to the text folder inside the main data folder. Look for a file called export_units.txt.strings.bin. Note that all of the files in that particular folder are in the .strings.bin file format. This cannot be modified, but a number of good converters exist. I suggest this one. It comes as a .rar archive, which can be opened with 7-Zip.

The only problem is that you need to have the Python scripting language installed on your computer. Once you have used the converter, you can open up the newly-generated export_units.txt file and will be presented with a number of text lines. Go to the bottom of the file to enter new text. For this next part, you need to know the dictionary name of your unit. This is the name in the "dictionary" line of the export_descr_unit.txt file. For example, mine is "Norse_Super_warriors". Use this name to generate three new lines in export_units.txt. The first should start with the dictionary name enclosed in curly braces and then have the in-game name afterwards:

  • {Norse_Super_warriors}Berserkergang

This is simply the name the game uses to refer to the unit. The next line should be the dictionary line enclosed in curly braces, with "_descr" added to the end, and then a description of the unit:

  • {Norse_Super_warriors_descr}Berserkergang are the most powerful of the Danish fighters. Comparable to the Spartans of old, these men come from an exclusive warrior society, where they are bred for combat. In battle, no foe can stand against them for long.

This is the description used in the unit's information scroll. The last line should be the dictionary line enclosed in curly braces with "_descr_short" added to the end, and then a condensed description:

  • {Norse_Super_warriors_descr_short}Berserkergang are extremely powerful axe-armed fighters.

This description is used in the army customization screen in custom battles, as well as in the condensed recruitment report. Save the changes and you are good to go. Next time you start the game, it will automatically rebuild the .strings.bin file from the .txt file you just edited, so there is no need for any reconverting.

Image
Berserkergang
unit info card

We are now almost done with the unit. The last part is adding in the ui elements - the images. The first UI element that you will want to consider adding is a unit info card. This is the image used for the unit's portrait in the unit info panel. Simply take a screenshot of your unit in action, and then use Photoshop to make it into a 191x280 image. I would recommend cropping it a bit, and doing a close-up on an individual soldier. If you do not have Photoshop (like me), then try GIMP. It is a free Photoshop alternative. Once you have created your image, then go to the data/ui/unit_info folder. There you should see 25 folders - one for each faction, as well as a "merc" folder for mercenaries. Put an the image into every needed folder, saving it as "your unit's dictionary name_info.tga". For example, here is my norse_super_warriors_info.tga file.

Image
Berserkergang
unit card

The next step is to make a unit card. This is the card shown in the row at the bottom of the screen. To do this, make a 48x64 image of your unit. Be sure to not have any colour in the background or else the background will always be that colour. Once you have made it, go into your data/ui/units folder. Inside this folder you should see 25 folders - one for every faction, as well as a "mercs" folder for mercenaries. Then go into the appropriate folder and save it as "#your unit name.tga". For example, here is my #norse_super_warriors.tga. The black background is because I have the image in a .bmp format, which displays black where alpha channel, or transparency, should go)

Once you have done all of those, your unit is complete, and you should then run it through a few playtests. Use the Grassy Plains map on Medium difficulty. I had 1 unit of my Berserkergang fight 1 unit of French Dismounted Chivalric Knights. We barely lost:

Image

Since I want my unit to be "supermen", a revision is in order. Here are the new stats:

    type Norse Super Warriors dictionary Norse_Super_warriors ; Berserkergang category infantry class heavy voice_type Heavy accent East_European banner faction main_infantry banner holy crusade soldier Viking_Raiders_ug1, 12, 0, 1.2 officer norse_swordsmen_ug2 attributes sea_faring, hide_improved_forest, very_hardy, can_withdraw, frighten_foot, hide_anywhere formation 1.2, 1.2, 2.4, 2.4, 4, square, shield_wall stat_health 1, 0 stat_pri 24, 12, no, 0, 0, melee, melee_blade, slashing, axe, 25, 2 ;stat_pri_ex 0, 0, 0 stat_pri_attr ap, area, launching stat_sec 0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1 ;stat_sec_ex 0, 0, 0 stat_sec_attr no stat_pri_armour 7, 17, 13, flesh ;stat_armour_ex 0, 2, 3, 5, 3, 8, 8, flesh stat_sec_armour 0, 0, flesh stat_heat 4 stat_ground 1, -2, 3, 4 stat_mental 10, disciplined, highly_trained stat_charge_dist 40 stat_fire_delay 0 stat_food 60, 300 stat_cost 1, 800, 103, 65, 150, 800, 2, 300 armour_ug_levels 0 armour_ug_models Viking_Raiders ownership denmark era 0 denmark era 1 denmark era 2 denmark ;unit_info 7, 0, 11
And....

Now that's more like it!! Now that you know how to make your own units or edit existing ones, a whole new world is open to you. This is, in fact, the cornerstone of modding. Although your units will show up in custom battles, they will not be in the campaign. My next guide should remedy that. Be ready for A Guide to the Export_Descr_Buildings.txt. In the meantime, try not to have too much fun making new units! ;)

Good Luck,
Mythic_Commodore