Join the forums now, and start posting to receive access to our Scripts Vault!
This turns into a one-sided battle resulting in the player who started the battle with less units ultimately losing. (not fair)
3. Lets say the 100 damage I deal floats for a second... your units counter attack and your damage floats for a second, the the system inflicts damage on each player's units at the same time... which either results in no unit dying or all units dying. (again unrealistic)
make defenders have an advantage
Post something more about the game as a whole.
In case of strategic scale equal forces battle outcome is just a dice roll, on a tactical scale you take into account players "order of battle".
u need to make a complex game if u want a realistic game.
It's really hard to say how it should work without knowing the rest of the game (economics, invasion reward/causalities ratio, ability to replace troops).
i would avoid the 'calculate one side then the other' approach....rather calculate the losses for both sides then apply them at the same time.as for how you want battles to work, i would start off by writting down some rules for my game universe...such asinfantry cannot destroy tanks, max damage they can inflict is 50%.tanks cannot move if below 60% damage.planes are impervious to infantry and tanks.infantry do not receive movement penalties bassed on damage.this helps set the framework for your game, and also provides you with a set of rules that you can check your battle engine against,next i would build a test harness that allows you to run the same battle several times through your battle engine, structure your battle engine so that the actual engine can be swapped out for an alternative one, ie isolate the code that calculates the results from the rest of the code, then start with a simple attacker allways wins and slowly expand and refactor it runnig the tests each time eventually you will reach a point where the results are good enough and the performance acceptable.