I have been posting these FPS Tactical AI Demo for a couple of times. This is a part 3.
After much trial and error we have managed to solve a lot of the challenges. I’m very much willing to share and give back
to this great community that I learn from. In this demo I will be sharing a custom Threat Perception system,
cover scoring system and suppression system.
A brief Description.:
We’re building a Tactical FPS/RTS . our objective is to create a reasonably believable AI that poses challenge to player.
With that, the gameplay is battle of 2 teams of player accompanied by AI Mobs.
Link to Video
- AI that takes cover
- AI That is aware of environment and enemy formation.
- AI that doesn’t run off to do its own thing.
- AI that doesn’t die too easily.
As shown in our first 2 video. We manage to achieve the majority of the features. However, the challenge start to heads itself
in terms of performance and scalability. It’s easy to make AI that takes cover and detects enemy. But it’s difficulty to manage 20-30 of them battling each other.
In previous version, AI individually selects for cover and scores them based on criteria. However this become way too expensive.
Eventually. we tried this and we found positive results :
Squad Cover-sharing :
A squad helper object is spawned when none is there. This object scans for active node, scores each node and shares this information
with everyone in the squad. This is done per team. This results in reduced redundancy but the trade-off is that the checking is no longer done per request
and it is not as up-to-date as the previous implementation. However in our game, we do not expect AI to be moving too quickly. So
we find this acceptable.
In previous implementation we find that manually detecting units can be quite expensive. With the threat object system , the
AI is no longer aware of individual units but clusters of unit. These ‘threat’ objects are created when there are X amount of unit. They merge
when needed and split when necessary. These threat object allows us to deal with less data, hence better performance.
Weight-based Cover Selection:
The AI can now accept weight parameters when selecting Cover. As mentioned in 1) , the AI shares certain generic data of the cover , however
the full score is calculated by each AI based on weightage. The reason we require this weightage is because, at difference situation, the AI
might want to select cover with a different criteria. For example, when the AI is low in morale (future feature ) , it will select full cover that are
further away from enemy.
Given our currently implementation , we have decided to limit behavior tree only on high level processing. The low level processing such as cover selection,
cover validation, enemy processing is all done in the AIController.
This is another newly implemented system that allows AI to respond to continuous bombardment of firepower.
When AI is suppressed , it will crouch ( while moving ) , stop firing and Hide ( if in cover ) . This allow a more tactical gameplay.
A practical implementation is for situational weapon AI. An AI carrying an anti-tank weapon needs several seconds to aim,
however , if interrupted by suppression, it is unable to aim properly, hence delaying the heavy weapon usage. This is inspired by
games like Company of Heroes where AI is very believable.
I am sharing this as part of a way to give back to the community, modeling great examples like SilentX , ambershee, etc. However please bear
in mind, I am no pro in this, do not take any of my sharing as a ‘methodology’. This is as much as I know.
If you have any questions regarding AI , feel free to ask me.
I am unable to make a tutorial for this because there are too many inter-twining this that this AI used that is related to our game.
It is of course possible to isolate the sections, but it will take time ( that I do not have ) .