i try to find an algorithm for strategy game battles like travian or lord of ultima or ... but every program that i wrote it had bug for calculating dead Soldiers, some examples of this critical points is:
- in real world when 100 soldiers attack to 1 soldier,its usual that all 100 soldiers is alive and 1 defender soldier is dead.
- finding winner of battle
data example is:
attacker:
Soldiers | defending-power | attacking-power | Soldier Count |
---------|-----------------|-----------------|---------------|
A | 20 | 45 | 5
B | 22 | 77 | 4
C | 41 | 32 | 7
D | 38 | 54 | 6
E | 27 | 41 | 6
defender:
Soldiers | defending-power | attacking-power | Soldier Count |
---------|-----------------|-----------------|---------------|
A | 44 | 12 | 6
B | 59 | 18 | 6
C | 73 | 40 | 7
D | 26 | 61 | 2
E | 7 | 24 | 4