I'm working on a game similar to the web game Utopia, insofar as players have a number of units with different values for attack and defense.
Question: how do I distribute damage across units when a conflict plays out?
Let's say I have two units:
- Infantry: 3 attack, 3 defense
- Cavalry: 5 attack, 1 defense
Let's say the player has 100 infantry (300 attack, 300 defense) and 50 cavalry (250 attack, 50 defense); the player now gets hit with an attack of 100 points of damage.
How do I resolve this in a way that doesn't force players to understand damage and micro-optimize, also given that I'm not going to store individual units' health values after the conflict?
- If I distribute damage to weakest units first, 33 infantry will die; but players will spam cavalry and keep a small number of "fodder" infantry around to absorb damage.
- If I distribute damage to strongest units first, 50 cavalry die; but players will spam infantry, thinking that stronger units are "not worth it" because they always die.
- If I distribute damage randomly (eg. some infantry get 1 damage, some get 2, some get 3 and die), I will likely end up with players thinking that conflict is not effective, because a number of units took damage but didn't die (and I don't keep track of damaged units -- they heal afterward).
Is there a distribution algorithm I can use that doesn't have any of these side-effects and appears "fair" to the player? If not, how can I make this make sense so players understand how this should work, without me hindering certain types of strategies?
I wrote an answer to a question here that looks similar, but I explicitly didn't tackle the problem of fairly distributing damage without sabotaging different strategies.