Comment on page

# Battle rules

In SpartaDEX, there are clashes between the player's army and the barbarians. At the moment, this scenario is only possible when a player attacks a Barbarian camp, but in the future it is planned to introduce barbarian raids on player’s Polis.

The outcome of the fight is calculated algorithmically based on several variables:

- α - numerical superiority factor, i.e. the ratio of the number of attacker's units to the number of defender's units;
- AOA - Army’s Offensive Ability (calculated on the basis of unit statistics and a random morale coefficient ranging from -30% to +30%);
- ADF - Army Diversification Factor - depends on the variety of types of units in the army (the greater the variety, the greater the army's power). For barbarians, this coefficient is always 1.25;

Based on these coefficients, the following is calculated:

TPA - the Total Power of Army (for attacker and defender)

**TPA = AOA * α * ADF**

The formula for the outcome of the battle is:

**W = AOAattacker * α * ADFattacker - AOAdefender * ADFdefender**

****

**Unit survivability:**

The one who lost the battle loses all his units. The winner only loses part of them. The number of surviving units is calculated from the formula:

**L[%] = |W| / TPAwinner**

L% of the winner's strongest units survive.

Last modified 7mo ago