-
Notifications
You must be signed in to change notification settings - Fork 0
Battle
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.
Let there be two armies 






Each military unit will have two inherent attributes relevant to battle: Defensive Strength (

Each military unit will also have two attributes called Experience (

The population of an army is the sum of the populations of it's constituent units:
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:
The derivative of the population of a military unit with respective to time is what drives the battle.
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 (






