Download

Tactical AI ( Cover , Threat and Suppression )

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

Needed Features:

  • 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 :

  1. 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.
    521b34ae47c3f07d850e6041df69c96d6465e42b.jpeg

  2. Threat Object:
    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.
    7a074db187cd73ad318c97bfdf8d024ed8598509.jpeg

  3. 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.
    Parameters.jpg

  4. Behavior Tree
    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.

  5. Suppression System
    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 ) .:cool:

2 Likes

Really great stuff. I haven’t looked at AI in UE4 yet, but this is tempting me to dive into it!

Great use of behavior trees! -This is awesome stuff, can’t wait to see fully implemented!

Any reason you are not using EQS for position/point evaluation?

because i’m a lazy maggot… :frowning:

in fact I should… sighh…

Okay seriously, I’ve no idea how EQS work, haven’t got time to learn them yet, in fact I just saw them on learn page , which I
believe is the first tutorial on EQS.

Well I recommend switching to it. The queries are time sliced by default and can be debugged at editor time using the EQS testing pawn.

Any high level pointers on how you implemented suppression? Looks impressive!

Looks really nice. I still fighting through the logic of an usefull ai. From my point of view, yours look like magic. My bot is able to patrol, find a cover location, shoot on an pawn in focus and is uses AI Perception for seeing and hearing. it works more or less okay. it not that i use unreal for the first day, but stuff thats totally new, i always no idea how they work. i appriecate any tipps, what to do next. :slight_smile:

Hey if you get some time would like to try this but need the blackboard setup?