Which unit do you shoot first?
In every Real Time Strategy game, there comes a time that you face your enemy in combat. Then you have to decide which unit to attack first. There are many ideas about optimal strategies, and many of them have good arguments. I decided to write a small simulator to find the optimal strategy.
I implemented strategies based on the number of hit points and the firepower of enemy units. Every simulation round all the enemy units fire at me, and I fire at a single enemy unit. The best strategy? Find the unit with the most firepower per hit point and whack it. However, this does requires quite some math, since the hit points change and thus the firepower / hit point ratio changes about every second.
Unless you can do a lot of math in a very short time, easier to fire at the unit with the most firepower. Almost just as good is shooting at the unit with the least hit points. Which one of those two is best probably depends on the game and the units you’re facing.
Focusing your firepower on the unit with the least fire power or the unit with the most hit points is really bad. It’s better to just pick a unit at random.
Here are the actual results. The number is the total damage the enemy units did to the simulated “me”, hence lower is better.
findMostFPperHP 2934277 findMostFP 3546364 findLeastHP 3603899 findRandom 6908600 findLeastFP 7470776 findLeastFPperHP 10460769 findMostHP 10482618