• Designed meelee and ranged NPCs to fight the player
  • NPCs can be given a patrol path that they will guard
  • NPCs will investigate noises they hear or enemies they see
  • If an NPCs health gets too low they will flee combat and break line of sight in order to heal

Behavior Trees:

Picture 1

  • Meelee NPC with strafe around the player and attack in intervals

Action Game: Melee AI EQS

Picture 2

  • Ranged NPC will find a suitable position and shoot at the player then reposition

Action Game: Ranged AI EQS

Picture 3

Sub-Trees:

  • Used to switch between different states in the behavior tree

Picture 4

Picture 5

Picture 6

Tasks & Enviromental Queries:

  • Moves the enemy along the patrol route

Action Game: AI Patrol

Picture 7

  • Uses a query to find positions out of the player’s line of sight to hide at

Picture 8

  • Uses a query in line of sight to the player, preferrably farther away, and repositions to a nearby point

Picture 9

  • Uses a query around the player to find a good position to attack from

Picture 10

Enemy Blueprints:

  • Creates the basic health bar widget and die/hit react functionality for all enemies

Picture 11

  • The melee enemy attacks in a sphere trace in front of itself

Picture 12

  • The ranged enemy attacks in a line trace from itself to the player

Picture 13

AI Controller:

  • Initializes all enemies and defaults their state to passive
  • Creates the perception for each enemy: sight, sound, & damage

Action Game: AI Perception

Picture 14

Blackboard:

  • The basic blackboard for all enemies
  • Uses the attack target to reference who they are fighting, the player or another npc
  • The state keeps what current state the enemy is in
  • Point of interest is if the enemy hears the player or sees the player for a moment and wants to investigate
  • Attack radius is how much range the enemy has to make an attack
  • Defend radius is how much range the enemy wants to keep between itself and the player

Picture 15

Blueprint Interfaces & Damage Struct:

  • Interfaces used to define functions for melee and ranged seperately

Picture 16

Picture 17

  • Structure used to store different types of damage and modifiers, like blockable or uninterruptable

Action Game: Damage System

Picture 18