Armor class

**Armor classes** are semi-hidden unit attributes in *Rome at War*. They are necessary to make attack bonuses work correctly.

## Overview

### In-game references

The bonus attack and armor class system is not directly displayed in-game. The only visual element of armor classes is noticing the attack value bonuses that units and buildings inflict on each other, but even then, heavy amounts of cross-referencing of the unit and building types taking and receiving damage would have to be tediously studied; and combined with the fact that the type of armor classes assigned to each unit and building are never specified in-game. The only way to directly see armor class bonuses and their values is with the use of the Genie Editor, which is the official program to view and edit dataset included in game files.

While the technology tree states which unit is strong against which type of unit, it does not tell if it is by design or by bonus damage. If by bonus damage, it does not tell the player how this bonus damage is dealt, or which unit is in which armor class. While most armor classes are intuitive (for example, it is clear that the Horus Warrior is in Armor class: Infantry), there are also many which are not. In another example, the aforementioned Horus Warrior is also in its own Armor class: Horus Warrior, and Champions deal significant bonus damage against this class. Neither is referenced anywhere in the game. Another example are Camel Riders: they are not in Armor class: Cavalry like one might assume, but instead in their own Armor class: Camel, which takes less bonus damage than the cavalry class from anti-cavalry units, so they are less vulnerable to their counter units than the game suggests.

Attack bonuses come in play due to two independent factors: Armor classes and hill/cliff bonuses. While focusing on Armor classes on this page, the role of hill/cliff bonuses will also be touched on.

### Function

Basically, the bonus damage is calculated the same way as the base damage is calculated (simply by subtraction of attack and armor), but in order to calculate bonus damage in the first place, the attacking unit logically has to have an attack bonus against its target. This is where the armor classes come into play.

Simply speaking, bonus damage is a flat additive value to the base damage and if a unit has more than one armor class, the bonus damages of the attacking unit stack. For example, the War Elephant is in Armor class: War elephant and in Armor class: Cavalry, and the Auxiliary Spearman has an attack bonus against both classes. So both bonus damages are added when a Auxiliary Spearman attacks a War Elephant.

Each unit has an armor value for every armor class it is assigned to. For most units this armor value is 0 and simply determines that they are in this class and take bonus damage, but for some units, it is non-zero. A positive value indicates that this unit (partially) resists bonus attacks against this armor class, while a negative value means it is more vulnerable. For example, the Praetorian Prefect has +8 cavalry armor, making it less vulnerable to anti-cavalry attacks than other cavalry units. On the other hand, for example, the Elephant Archer has –4 cavalry archer armor, making it take even more damage from anti-cavalry archer attacks.

## Damage calculation

The damage in *Rome at War* works in many steps, which is seen as following:

**Step 1:** Attack multipliers are applied and stored.

A
t
t
a
c

k

i

:=
A
t
t
a
c

k

i

×
x

{\displaystyle Attack\_{i} := Attack\_{i}\times x}

 where

x
≥
1

{\displaystyle x \geq 1}

 is the multiplier on respective attack class i. Attacks are stored as integers only. So an attack value which is not an integer is rounded off. An example where

x
≠
1

{\displaystyle x \neq 1}

 is Siege Engineers, where

# x
1.2

{\displaystyle x = 1.2}

for

# i
11

{\displaystyle i = 11}

. While x can be less than 1, there exists no reason to do so.

**Step 2:** Damage due to every class. This step is done for all armor classes present. For any specific armor class i:

A. For

A
t
t
a
c

k

i

>=
0

{\displaystyle Attack\_{i} >= 0}

 or

A
t
t
a
c

k

i

>
A
r
m
o

r

i

)

{\displaystyle Attack\_{i} > Armor\_{i})}

:

D
a
m
a
g
e

1

i

=
m
a
x
(
0
,
A
t
t
a
c

k

i

−
A
r
m
o

r

i

)

{\displaystyle Damage1\_{i} = max (0, Attack\_{i} - Armor\_{i})}

: Damage1 is never negative
B. For

A
t
t
a
c

k

i

<
0

{\displaystyle Attack\_{i} < 0}

 and

A
t
t
a
c

k

i

<
A
r
m
o

r

i

)

{\displaystyle Attack\_{i} < Armor\_{i})}

:

D
a
m
a
g
e

1

i

=
A
t
t
a
c

k

i

−
A
r
m
o

r

i

{\displaystyle Damage1\_{i} = Attack\_{i} - Armor\_{i}}

: Damage1 is always negative
**Step 3:** Bonus damage resist multiplier.

D
a
m
a
g
e

2

i

=
D
a
m
a
g
e

1

i

×
(
1
−
x
)

{\displaystyle Damage2\_{i} = Damage1\_{i} \times (1-x)}

 for enemy units, where x is the value of the attribute. Usually

# x
0

{\displaystyle x = 0}

. This does not apply for

# i
3
,
4
,
31
,
33

{\displaystyle i = 3, 4, 31, 33}

 since these classes provide base damage. Currently this property is used by Sicilian infantry, cavalry, and archers, where

# x
0.33

{\displaystyle x = 0.33}

, and by Mauryan elephants, where

# x
0.25

{\displaystyle x = 0.25}

. Note that the

D
a
m
a
g
e

2

i

{\displaystyle Damage2\_{i}}

 values may not be integers and are not stored, so they are allowed to have decimal values.

**Step 4:** Addition.

D
a
m
a
g
e
# 3

Σ
i

D
a
m
a
g
e

2

i

{\displaystyle Damage3 = \Sigma\_i Damage2\_{i}}

for all i, where

Σ
i

{\displaystyle \Sigma\_i}

 denotes summation over all armor classes.

**Step 5:** Other bonus multipliers. Unlike the previous multiplier, this does apply for

# i
3
,
4
,
31
,
33

{\displaystyle i = 3, 4, 31, 33}

.

D
a
m
a
g
e
# 4
x
×
D
a
m
a
g
e
3

{\displaystyle Damage4 = x \times Damage3}

where x is calculated as follows, starting at

# x
1

{\displaystyle x=1}

:

* This sub-step does not apply to secondary projectiles. If the unit dealing damage is on high ground or above the cliff,

x
:=
x
×
1.25

{\displaystyle x := x \times 1.25}

 or

x
:=
x
×
1.5

{\displaystyle x := x \times 1.5}

 (the latter only for Dacians after researching Murus Dacicus). If the unit receiving damage is a building and on a desert cracked terrain,

x
:=
x
×
1.2

{\displaystyle x := x \times 1.2}

.
* This sub-step does not apply to Chakram Throwers or units with blast damage. If the unit receiving damage was not the intended target (i.e., it is a mishit),

x
:=
x
×
0.5

{\displaystyle x := x \times 0.5}

.
* This sub-step applied only to units with blast damage. x is set according to the type of blast damage. Except for the tapering effect, the main target always receives 100% damage.

**Step 6 - Result**:

D
a
m
a
g
# e
m
a
x
(
1
,
D
a
m
a
g
e
4
)

{\displaystyle Damage = max(1, Damage4)}

 This is to ensure that even if

D
a
m
a
g
e
4
<
1

{\displaystyle Damage4 < 1}

, the unit must receive a minimum of 1 damage since it is being attacked. Note that the minimum damage rule is applied after all the attack multipliers.

* Damage may not be an integer, but the game works with the values just fine. It does subtract fractional hit points, but the UI shows only the integer part of the remaining hit points. The unit dies when the remaining hit points reach below 1 (not less than or equal to 0), that is

H
P
<
1

{\displaystyle HP<1}

.

* If the secondary projectile has no respective attack classes applied to it at all (e.g., Mangonel which have no attack classes at all or Liburnas have only anti-ship, anti-camel and anti-fishing ship attacks) hits unintended target or if attack ground is used, no damage by such projectile is inflicted. If the secondary hits an intended target, however, it deals the minimum damage of 1 instead.

You might think why values 3, 4, 31, and 33 are excluded from step 3. Step 3 is for reducing bonus damage. These armor classes are dealing regular/base damage by their definition. These are namely base pierce (3), base melee (4), special melee (31), and special pierce (33).

While the formulas may look complicated at first glance, it basically says that a specific armor class value is subtracted from its respective attack class value, but the individual result cannot be negative. Hill and other bonus multipliers are applied. This resulting value is added to the total damage dealt. Bonus attack cannot be reduced by melee or pierce value. Unlike with melee and pierce damage, information about the bonus damage cannot be found in the unit infobox or in tech tree in-game.

Steps 4 and 5 can be interchanged mathematically because the order of operations does not matter there, but it is more time efficient to perform step 4 before step 5.

Also there is no case where an attack class has both an additive boost as well as a multiplier. We can formulate theoretical situations like Iberian Auxiliary Spearmen with Mantriparishad, and Bloodlines and percentage HP boost with Huns, but the results are consistent because of how these bonuses are implemented. The Iberian bonus applies before the start of the game (fixed) and Mantriparishad being a unique technology, needs at least 1 second to finish (variable). Bloodlines applies when we research it (variable), but the Huns bonus specifically applies to Light Cavalry and upgrades at the start of the game (fixed). When we have either boost fixed, we get consistent results.

## Base armor

Base armor is the default value of an armor class which a unit does not have. This is an important attribute to make armor classes function.

For example: A Cavalryman is defined to have armor classes of Base Melee (2), Base Pierce (2), Obsolete (0), Cavalry (0), Oxybeles Attack (-14) and Base Armor 10,000. This means that it has armor classes of Infantry (10,000), Warship (10,000), Elephants (10,000), and so on. Normally all these attack values are less than 10,000.

Substitute these values in the formula for damage calculation by a Post-Imperial Mauryan Champion to get:
Damage  `= (17 - 2 {melee}) + (5 - 0 {cavalry}) + (8 - 10,000 {Horus Warriors}) + (6 - 10,000 {Standard Buildings}) + (4 - 10,000 {Camels}) =`  **20**.
The single highest attack in the game is Furious the Monkey Boy against standard buildings (999).

## Common values

* Attack class 21 is defined by the game to be a variation of *anti-building attack* (attack class 11).
	+ For buildings (except Fish Traps except Wonders),

	a
	r
	m
	o
	r

	v
	a
	l
	u
	e

	21
	=
	0

	{\displaystyle armor \, value \, 21 = 0}

	 always, because it was never meant to be reduced.
	+ For reasons unknown, Fish Traps do not have building armor classes (neither 11 nor 21), unlike their counterpart - Farms.
	+ For reasons unknown, Wonders do not have armor class 21, despite having armor class 11, and have a special armor class 0.
* All units except Fire Galleys have exactly same attack vs Fishing Ships (armor class 34), as they have against regular Ships (armor class 16). This was done to promote use of Galleys in Feudal Age to snipe Fishing Ships, rather than the Fire Galley countering everything.
* B
a
s
e

a
r
m
o
# r
10
,
# 000
a
r
m
o
r

v
a
l
u
e

33

{\displaystyle Base \, armor = 10,000 = armor \, value \, 33}

 for most units and buildings (please check Trivia).

## Implications

* Percentage attack upgrades like the Iberian Spearman-line bonus, Spartan Kryptia, Siege Engineers, and Heated Shot are calculated and stored in unit stats and are always an integer. The modified values are used to determine damage. Depending on the unit, it may be greater than or less than the percentage increase. Hill bonuses are always calculated in every situation after calculating the damage from armor classes and the damage dealt maybe a non-integer, in which case the shown HP is rounded down.
	+ Iberian Pikemen should get +27.5 vs Cavalry, they actually get +28.
	+ A regular Pikeman on a hill also gets +25% damage bonus. Ignoring the insignificant melee attack vs Cavalry, it should deal +27.5 vs Cavalry. It appears in game that it deals +28 in odd hit and +27 in even hit. Behind the scenes, it actually is dealing +27.5 but the new HP of the receiving unit is always rounded down. Extending this rule, on a hypothetical unit having 5 attack vs itself, it will deal 7, 6, 6, and 6 damage to itself in a cycle, because the 6.25 damage works this way.
* Not every unit with an attack bonus against another unit can be called a counter. The Spearman line has +1 vs the Horus Scout , but get wrecked by them.
* Despite not having bonuses, a unit can be called a counter to the other unit. The obvious example of this is a Priest. The Scout Cavalry line, the Cavalryman line, and Chaariots are pretty strong counter to siege units. Mangonels can be called a reasonable counter to Crossbowmen. Composite Bowmen are a fairly good counter to Crossbowmen.
* Despite having a meagre difference of 1 pierce armor, the Spearman line is nowhere near to the Militia line in resisting archer fire. This is because reliably every archer unit has an attack bonus vs Spearmen. Regular Archers and Skirmishers do +3. Regular Cavalry Archers and unique foot archers do +2. Crossbowmen do +1. Most notably, Camel Archers do not receive any attack bonus. Elephant Archers also do not receive any attack bonus until Parthian Tactics, but this maybe by design to make them weak to the Spearman line.
* Despite both Auxiliary Spearmen and Mounted Skirmishers having attack bonus vs the other, neither unit is called a counter to the other.