Overview
Want more sprites per unit? Want your army to look like ants? Check out this basic guide to editing the unitprefs.txt file.
Who, what, where?
…SteamsteamappscommonGrand Tactician The Civil War (1861-1865)Config
In you steam library, right click the name of the game, go to manage -> browse local files and you should only have to open the config folder at that point.
The unitprefs.txt file contains quite a lot of data, ranging from units sizes to combat modifiers. In this guide we will focus on adjusting the sprites that represent units on the battlefield. More specifically, how to get more (or less) sprites while keeping everything functioning the same as with the default settings.
For the purpose of sprite editing, the following sections of tghe file are important:
- Unit Data
- Moving Data and Unit Structure
The first contains the needed entries to change the # of sprites and their sizes, the second is needed to ensure that the changes made do not mess with formations and artillery balance.
Being a simple .txt file, you can edit it with notepad and other similar editors. I personally use notepad++, which gives some nice colour coding to certain values, but this is personal preference.
Before you edit anything, make a backup of the file somewhere. It saves you a lot of trouble if you do manage to mess it up badly, and also makes it easy to revert to default/other setups should you so desire.
Unit Data
The start of the unit data section is marked by this line (cut for viewing pleasure):
It contains all the different unit types that you can find on the field of battle and the campaign, numbering 18 in total. I recommend editing only the first 5 types (numbers 0-4) and leaving the others unchanged. This ensures that HQ units, couriers and the like are still clearly visible and distinguishable from the combat units.
A typical unit type looks like this:
For the purpose of sprite numbers and sizes, only these 4 lines are of interest:
Unit Sprite Size is how big a sprite will be in battle. I would recommend keeping it between 2 and 5. Going down to 1 leaves you with something more akin to ants than soldiers, and going beyond 5 reveals the lowish resolution of the base sprites.
How many men represent is the ratio of sprites shown to actual soldiers in the unit. The default for infantry and cavalry is 0.025, or 2.5%, meaning that a fresh infantry brigade of 3000 fit for duty men gets represented by 75 sprites. Artillery defaults to to 0.13 or 13%, but has a few more things to take into account when editing.
Moving Data and Unit Structure
The start of the Moving Data and Unit Structure section is marked by this line (cut for viewing pleasure):
This section is important for ensuring that any changes you make in the unit data mesh well with the look and feel of the game. If you skip this section, you are likely to see spaghetti lines stretching far and wide, artillery with wrong gun numbers and guns of the wrong size and sprites sunk into the ground. The goal of any edits here is to ensure that the units still take up roughly the same space as on the default settings. While you can try to make more severe changes in the interest of historical accuracy and the like, all examples given later on will assume as goal a default experience with more sprites.
The full section is too big to paste here comfortably, so I will simply list the relevant parts for our purpose:
These lines are important to prevent (or provoke) the very long lines that occur when you crank up the sprite count by a lot. You will likely have noticed in-game that units are divided into several little block when you give movement orders. As default, these blocks contain 8 sprites (4×2) and thus a full infantry brigade would have 9.375 blocks on the battle map ( ((0.025*3000)/8) or sprite total / sprites per block). If you want your gamplay experience to be as close to normal, just with different sprite amounts, you should strive to keep the amount of blocks the same.
In practice, this means that you should do:
New Sprite Count / 9.375 = New Sprites per Block
New Sprites per Block / 3 = New Side Z sprite count (Side x is double this)
If you use significantly smaller sprite sizes, I would aslo recommend changing Placement height of the regiment platform to a slightly smaller value.
For these lines, you want to change the Y offset for untis of which you have altered the sprite size, otherwise you will encounter sprites half burried (or floating).
This part is very important if you have altered the sprite count for artillery, since it affects the gun count for the unit while in battle. As a rule of thumb, if you increase the artillery sprites by a factor X, then you want to divide this number by the same factor X.
If you do not do this, you will see strange numbers of guns in your battery.
These lines are important if you have altered the model size for the artilery guns themselves (see next piece of code). If you do not do this, you migh see your batteries take up a lot more space than they did before.
Change these sizes if you have altered artillery sprite sizes, or you migh see childeren operating your artillery pieces. Don’t be to radical with your changes here, some fiddling might be required to get this feeling and looking right. Combine with the code above for the best result.
Some Examples
To utilize the examples, change the values in the unitprefs.txt file to match the example code.
This example is one of the easier ones to do, since it leaves the artillery related stuff alone and focuses on getting the infantry and cavalry sprites to a similar ratio.
Do not change #2 (artillery) except for sprite size to 4.
This example is about the highest sprite ratio I would advise. You will likely notice substantial loading times for most battles involving >20.000 men, and performance will be noticably worse. During battles, gun counts may also differ slightly from the numbers promised on the campaign map/historical OOB.
Guns per sprite can be lowered to 0.24|0.23 if you want to prevent a slight excess of guns in battles.