Zeyro
Messages: 13,
Joined: Jun 08, 2012,
Offline


Zeyro
Messages: 13,
Joined: Jun 08, 2012,
Offline

I'm sorry if this is in the wrong place, but does anyone know the actual mathematics involved in the combat system?
(I am interested in game design and I LOVE this combat system, but I can't figure out how it works)


droidfreak36
Messages: 183,
Joined: Jan 23, 2012,
Offline


droidfreak36
Messages: 183,
Joined: Jan 23, 2012,
Offline

Copied from simsverd's post in thread "Attack formula":
First, the variables:
A = Attack strength of the attacking unit
Ta = Terrain modifier for the attacking unit
D = Defense strength of the defending unit
Td = Terrain modifer for the defending unit
B = Gang up, resurface, veteran bonus
H = The attacking unit's health points.
Next, the formula:
p = 0.05 * (((A + Ta)  (D + Td)) + B) + 0.5
if p < 0 then p = 0
if p > 1 then p = 1
This is how to figure out the damage:
1. Pick one unit to be the attacker and the other to be the defender.
2. Use the formula above to obtain p.
3. Take H and multiply by 6. This is the number of random numbers (r) generated between 0 and 1. For every r < p a hit is counted.
4. The total number of hits divided by 6 is the number of damage the defending unit will receive.
5. Switch roles between the units (attacker becomes the defender and vice versa).
6. Use the same formula above.
7. Once both units have attacked the damage points are calculated into their health points.
I will use a quick example:
Underling vs Marauder both on Plains
If you use the formula you see that the Underling has a 30% probability of dealing damage for each of its health points whereas the Marauder has a 75% probability of dealing damage for each of its health points.
If the Underling were on a Mountain though, the numbers change to 40% for the Underling and 55% for the Marauder.
That's it!

DroidFreak, the roboticist who plays as Khrals.
(Or Titans now that I realize how legit they are) 

Zeyro
Messages: 13,
Joined: Jun 08, 2012,
Offline


Zeyro
Messages: 13,
Joined: Jun 08, 2012,
Offline

Thank you.



