Posted November 15, 2018 by bryqu
So another thing I did work on in June was making sure that enemy characters finally start behaving in an interesting way.
Due to the cover system that the whole combat is based on, AI needs to be aware of its environment and perform an action which seems to be the best one (well, maybe not always best for them - to make sure that the player gets some fun out of the combat as well).
The way I implemented it was to make sure that each AI character has all the necessary information available when determining their next action. By "necessary information" I mean things like: potential cover locations, targets and threats, amount of ammunition available, etc.
Then, based on this information, the AI can evaluate its possibilities by taking into consideration all the positive (e.g. option to flank the player) and negative (e.g. option to become flanked) aspects.
I have only implemented few basic behaviors for the AI, so far which include:
As you can see there is no melee combat related behavior here as of yet.
Now, even if in most of the cases the AI seems to be behaving quite nicely:
It turns out that sometime they have issues with determining the best cover:
Now, in theory all is correct here: the AI has chosen a location where:
On the other hand, it seems that in such situation the AI should in fact be flanked be player characters.
I definitely need to investigate this further, I guess.