I am currently building a turnbased tactics game.
The Board is a small (about 4*6) tiled grid.
The AI plans all moves of its units, each unit can
- move 2 times
- move and attack
- or attack
at least in this basic stage.
Only one unit can be on a grid cell at any given moment. But a Unit can take a turn to a grid cell which was just left by the former occupant.
The AI plans out the whole turn in advance, and then the actions is played.
The Mission: The AI should maximize the attacks for each round. Currently only Melee is implemented, so this means maximize the count of own units in the grid cells next to the player units, and they should have a turn left to attack, if possible.
I am having a hard time with units getting moved on tiles, where a other unit is still present and so on.
Is there some kind of algorithm or even brute-force approach to match the the criteria?