Code:
Problem description:
After 3 weeks I'm about to finish coding the game AI but got stuck in the unit strategy AI. I'm talking about a total war/civilization like strategy AI. I've had many ideas but the implementations are disappointing...
So what is the main idea behind creating/moving and giving units targets to attack and towns to capture ensuring that AI towns are protected???
My idea is similar I mean I have defensive and offensive units, targets , percentages to divide targets and units and also guerrilla tactics and decoys. The problem is that I don't want the player to cause my troops to go back and forth from attack to defense because he moves his own troops back and forth. I mean I want my units to pursue enemies but not that much that makes them to stray from their goal. Thought of creating a radius of pursue.
But I dont know whether it's best too attack easy targets or go in for decisive attacks where the enemy units are stacked. |
Perhaps your AI should strategize in terms of risk/reward. Which or units targets pose the greatest threat? What benefits might you achieve from taking out a specific target early? (E.g., access to a choke point to get from A to B or likewise prevent an enemy crossing, destroying the enemy's fuel reserves, cutting off an enemy supply line.)
In some ways the decisions might be easier if units have synergy. The top goals should be to either defang or kill the enemy as quickly as possible, reducing as much of their power as you can. That is, if your enemy has a unit that provides cover to other units that can attack you effectively but are otherwise weak, then you want to take out that cover unit ASAP because then the rate of possible damage you can do is accelerated. If a weak scout is accompanied by a guard and you need to take out both units, the scout should be your target because taking him out reduces that particular group to just one enemy--unless you have a very quick way of dispatching the guard, in which case go for it. All decisions can be boiled down to:
|
Alternatively, a master controller could simply choose the units specifically based on distance to target, health, and other considerations, trying to keep their power balanced according to the way it wanted to apply them.