Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hi Petf, 

Let me explain how the AI retreat algorithm works.

Firstly, only soldiers engaged with your soldiers take part. They choose a wall, because that's the easiest structure to defend and the wall must be in opposite direction from your soldiers positions to avoid fire during retreat. The wall could be anywhere, not necessarily at the edge of the scene. During retreat they will take pot shots if you pursue them, but only if they have high chance of scoring a hit. Also, because only part of the militia are retreating, if you start chasing them you can run into other enemy patrols. I think in fact, having different groups of enemy following different strategies make it more unpredictable for the player.

Inside a building is not a good place to defend if there are a lot of soldiers, because they tend to get in each others way.