Tweaking the AI
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:
- Always take a shot if the enemy is flanked,
- Look for a cover that allows you to target the enemy with the biggest % to hit,
- Reload your weapon if you are out of ammo,
- Make sure that the cover you choose does not require a full move (as that will allow you to perform a shot).
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:
- They have full cover (well, they do stand near a solid wall)
- Player characters are not flanking them.
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.
Shardpunk: Verminfall
A tactical squad-based survival strategy game based in a thoroughly stylised pixel-perfect steampunk setting.
More posts
- Devlog #140: Shardpunk is now live!Apr 13, 2023
- Devlog #139: Less than a week to launch!Apr 07, 2023
- Devlog #138: Release date reveal!Mar 24, 2023
- Devlog #137: Can a game be truly fair?Mar 04, 2023
- Devlog #136: Reflections on Next FestFeb 17, 2023
- Devlog #135: hand-holding tutorialJan 27, 2023
- Devlog #134: shelter phase changesJan 27, 2023
- Devlog #133: 2022 wrap-upDec 31, 2022
- Devlog #132: playtests in progressNov 25, 2022
- Devlog #131: combat tactics, and moreNov 12, 2022
Leave a comment
Log in with itch.io to leave a comment.