Grand Tactician: The Civil War (1861-1865) Guide

Unitprefs - Some Basic Editing for Grand Tactician: The Civil War (1861-1865)

Unitprefs – Some Basic Editing

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?

Location

…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.

Contents

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.

Tools

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.

WARNING

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 code

The start of the unit data section is marked by this line (cut for viewing pleasure):

#### Unit Data #####

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:

Unit Type 0# Name ——————————————————— Infantry Maximum Unit Size 3000 Basic Unit Speed Factor dismounted 0# 1 Basic Unit Speed Factor mounted 0# 1 Unit Sprite Size #0 5 How many men represent a unit, factor 0.1: 100 men = 10 sprites #0 0.025 Minimum Unit Symbol Size #0 2 Obligatory minimum strength of remaining unit after detaching #0 500 Double quick (attack) speed factor 1.7 Running speed factor 2 Unit name text z-position adjustment (used to shift the text away from the unit symbol, minus is farer away) -8 Commander’s Standard Range 50 Maximum Line of Sight 200 Standard rounds ammo 0 60 Standard rounds ammo 1 0 Standard rounds ammo 2 0 Spotting Factor (used for concealment, the lower, the more visible) -50 Standard dust amount when moving per hour 400 Unit is able to run (true/false) false Fire angle radius shift to sides (degrees) 25 Command range campaign 0 Combat range campaign 0

Editing sprite sizes and numbers

For the purpose of sprite numbers and sizes, only these 4 lines are of interest:

Unit Sprite Size #0 5 How many men represent a unit, factor 0.1: 100 men = 10 sprites #0 0.025

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 Code

The start of the Moving Data and Unit Structure section is marked by this line (cut for viewing pleasure):

#### Moving Data and Unit Structure #####

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:

Number of sprites on one regiment block on side x – only for Infantry & Cavalry 4 Number of sprites on one regiment block on side z – only for Infantry & Cavalry 2 Size of one regiment block 0.3 Placement height of the regiment platform over ground 0.5

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.

Sprite table size Table 0# Infantry (used for troop type specific sprite size) 1 Sprite y offset Table 0# Infantry (how high is the sprite drawn over ground) -1.3 Sprite table size Table 1# Cavalry (used for troop type specific sprite size) 1 Sprite y offset Table 1# Cavalry (how high is the sprite drawn over ground) -1.3 Sprite table size Table 2# Artillery+Rest (used for troop type specific sprite size) 1 Sprite y offset Table 2# Artillery+Rest (how high is the sprite drawn over ground) -1.3

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).

Guns per sprite to show up (used for stats) 0.5

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.

Distance between two artillery guns when limbered 4 Distance between two artillery guns when unlimbered 0.6

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.

Gun Model Size x (has also to be updated in editor) 0.03 Gun Model Size y (has also to be updated in editor) 0.03 Gun Model Size z (has also to be updated in editor) 0.03

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.

~10% sprite representation – scale 4

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.

Unit Data changes
Unit Sprite Size #0 3 How many men represent a unit, factor 0.1: 100 men = 10 sprites #0 0.1
Unit Sprite Size #1 4 How many men represent a unit, factor 0.1: 100 men = 10 sprites #1 0.1

Do not change #2 (artillery) except for sprite size to 4.

Unit Sprite Size #3 4 How many men represent a unit, factor 0.1: 100 men = 10 sprites #3 0.1
Unit Sprite Size #4 4 How many men represent a unit, factor 0.1: 100 men = 10 sprites #4 0.1

Moving Data and Unit Structure changes
Number of sprites on one regiment block on side x – only for Infantry & Cavalry 8 Number of sprites on one regiment block on side z – only for Infantry & Cavalry 4 Size of one regiment block 0.3 Placement height of the regiment platform over ground 0.5
Sprite table size Table 0# Infantry (used for troop type specific sprite size) 1 Sprite y offset Table 0# Infantry (how high is the sprite drawn over ground) -0.3 Sprite table size Table 1# Cavalry (used for troop type specific sprite size) 1 Sprite y offset Table 1# Cavalry (how high is the sprite drawn over ground) -0.3 Sprite table size Table 2# Artillery+Rest (used for troop type specific sprite size) 1 Sprite y offset Table 2# Artillery+Rest (how high is the sprite drawn over ground) -0.3

25% sprite representation – scale 3

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.

Unit Data changes
Unit Sprite Size #0 3 How many men represent a unit, factor 0.1: 100 men = 10 sprites #0 0.25
Unit Sprite Size #1 3 How many men represent a unit, factor 0.1: 100 men = 10 sprites #1 0.25
Unit Sprite Size #2 3 How many men represent a unit, factor 0.1: 100 men = 10 sprites #2 0.25
Unit Sprite Size #3 3 How many men represent a unit, factor 0.1: 100 men = 10 sprites #3 0.25
Unit Sprite Size #4 3 How many men represent a unit, factor 0.1: 100 men = 10 sprites #4 0.25

Moving Data and Unit Structure changes
Number of sprites on one regiment block on side x – only for Infantry & Cavalry 13 Number of sprites on one regiment block on side z – only for Infantry & Cavalry 6 Size of one regiment block 0.3 Placement height of the regiment platform over ground 0.3
Distance between two artillery guns when limbered 2 Distance between two artillery guns when unlimbered 0.3
Sprite table size Table 0# Infantry (used for troop type specific sprite size) 1 Sprite y offset Table 0# Infantry (how high is the sprite drawn over ground) -0.3 Sprite table size Table 1# Cavalry (used for troop type specific sprite size) 1 Sprite y offset Table 1# Cavalry (how high is the sprite drawn over ground) -0.3 Sprite table size Table 2# Artillery+Rest (used for troop type specific sprite size) 1 Sprite y offset Table 2# Artillery+Rest (how high is the sprite drawn over ground) -0.3
Guns per sprite to show up (used for stats) 0.25

Guns per sprite can be lowered to 0.24|0.23 if you want to prevent a slight excess of guns in battles.

Unit Symbols & Objects changes
Gun Model Size x (has also to be updated in editor) 0.02 Gun Model Size y (has also to be updated in editor) 0.02 Gun Model Size z (has also to be updated in editor) 0.02
SteamSolo.com