Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.
nikhilm92 edited this page Dec 24, 2011 · 13 revisions

IPR Only

In a battle between two armies A and B,

D_A = Sum of defense values of all units of A
D_B = Sum of defense values of all units of B
O_A = Sum of offense values of all units of A
O_B = Sum of offense values of all units of B
A_0 = Initial population of army A
B_0 = Initial population of army B

dA/dt = -(O_B / D_A)
dB/dt = -(O_A / D_B)

A(t) = -(O_B / D_A)t + A_0
B(t) = -(O_A / D_B)t + B_0

Let,

t_A = Time for A to die.
t_B = Time for B to die.

t_A = (A_0 * D_A) / O_B
t_B = (B_0 * D_B) / O_A

If t_A < t_B, A got exterminated. Number of surviving soldiers in B = B(t_A)
If t_B < t_A, B got exterminated. Number of surviving soldiers in A = A(t_B)
If t_A = t_B, A and B get exterminated.


Refined Battle Formula

Let there be two armies A and B. Let A have n military units and B have m military units. A specific unit of an army is represented by a subscript to the army name such as A_i.

Each military unit will have two inherent attributes relevant to battle: Defensive Strength (D) and Offensive Strength (O).

Each military unit will also have two attributes called Experience (E) and Morale (M) which are unique to each specific unit and are either accumulated or dependent upon the unit's specific history.

The population of an army is the sum of the populations of it's constituent units:

Army population sum

Army population sum

As battle progresses, this population changes (as soldiers are killed). Therefore, the change in an army's population is also the sum of the changes in population of it's constituent units:

Derivative sum

Derivative sum

The derivative of the population of a military unit with respective to time is what drives the battle.

Main formula

Main formula

This formula can be used to generate the battle data required to simulate a battle. A battle ends when all units on one side have routed or have been killed. The routing of units depends on their morale. If the morale of a unit crosses a certain specified threshold, the unit routs. Morale (Morale) is a function of time and is defined later on this page.

constants are constants that will be used to balance the battle formula.

Clone this wiki locally