I'm currently developing a small game project on unity (with purpose of learning C#) where each player controls a base and can build buildings, do research, build units, pretty much the basis.
I arrived where the each player may send their army of different sizes to attack the other player's base. Each army can be composed of three different unit types, being Infantry
, Archers
and Cavalry
. They work as a kind of rock-paper-scissors, meaning infantry
beats cavalry
given equal resources (horses cost more than warriors, so 1 on 1, cavalry still wins), cavalry
beats archers
and finally, archers
beats infantry
given a long distance.
Every unit has different stats, health
, damage
, armor
and range
(mouvement speed exists but I do not want to consider it in battle).
I want the battle to be split in rounds and that it is not because you have less soldiers than the other player that you should loose. What would be an interesting way of solving the battle taking account of all those variables ?
Sort of solution I have is to give each player some decisions as to what would he do first (either archers attack first, cavalry waits for flanks, etc.) but nit seems too complicated and I still don't know how each parameter should be calculated. Should luck be included too ?
Thanks, luisarcher.
EDIT
After comments, here is my question more clearly. What would be the best way to simulate a battle of two armies composed of those units (with their weaknesses and strengths) where both armies would loose troops in X amount of rounds ?
I want the results to evolve with time so the players can react to it (either retreat, or maybe small commands). I'm not looking for a piece of code, but more of a guideline of how should I use every attribute of each unit (health
, damage
, armor
and range
).
EDIT2
By best, I mean an interesting resolution where each unit feels unique to be built and where players won't feel forced to build only 1 kind of units since it has the most cost effective hp/damage per amount of resource spent. I'm thinking of something like all those web-based strategy games like Grepolis, Tribal Wars, oGame, etc.
(damage - armor)
and someone else says health should decrease by(damage / armor)
, how do we determine which one is "best" for your game? You'll need to consider what specific outcomes you want, and which bad outcomes you don't want, and use those to develop clear criteria for proposed designs. \$\endgroup\$