I spend a bit too much time observing my guys in the practise mode and my main conclusions are:
- AI actually can somewhat take cover. A bit suprising connsidering their battle performance.
- AI avoid being in the player’s field of view too much. [Sounds of angry typing about bots blocking line of sight all the time.]
https://youtu.be/dBm2rlBDGfU
As you can see, AI try to get out of player’s field of view by running away, including running across player’s field of view. It can be used as example of doing sth badly, because you try too hard.
How it should work in my opinion: bots should avoid only player’s line of aiming, not his whole fov. In my opinion avoiding loa might apply only when player is actually aiming, to give AI’s pathfinding a bit more freedom.
Also, while trying to go across player’s loa, AI should preffer going behind him even if that means choosing a longer route. (If you are going to implement this, add a safety feature to prevent AI from changing it’s path too much because player starts and stops aiming.) - AI try to stay in the formation too strictly.
https://youtu.be/95XUL9Fd4y4
Even small turns cause AI to run from place to place. Now imagine what happens in the combat when you turn like crazy compared to my gentle moves in the video, no wonder AI has ADHD.
My sugestions:
Give AI more “room for mistakes” so it doesn’t have to strictly follow the pattern. Same goes for player’s input, give it more room for small moves so they don’t affect formation.
Give AI more “inertia” in folowing player’s turns, so if a player makes many quick turns, AI won’t move to follow the formation untill the player looks at the same place for a longer time.
Give larger priority to finding cover, than to folowing the formation. So even if AI should move because player turned, it won’t if it can’t pathfind to the cover. Actually finding cover should be no.1 priority all the time.
Make them move in small groups (for example in pairs) instead of moving all at once. Covering fire and stuff. Also it gives the whole formation more inertia I wrote about.
General sugestion: optymalise pathfinding of the squad as a whole. Now we have situations where soldiers get assigned to a position and they will go there even though, there are other soldiers in better positions to go there.
You can see that AI goes to positions that don’t make any sense all the time. One soldier goes away from his postion only to let the other soldier ocupy it again. Soldiers shuffle instead of moving fluidly.
I have no idea about programing games so I can’t say if my complaining will be usefull at all. Probably most of that stuff is next to imposible to do
EDIT:
After some thinking I’m not sure if problem of avoiding fov actually exists. Actually AI might be following the formation instead of avoiding player’s view.