AI Behaviors
Aine Fantasy Adventure - A Working in Progress Top-down RPG Developed by UE GAS
In this in-progress C++ project, I implemented three types of enemies (warriors, rangers, and wizards) using the Unreal Gameplay Abilities System (GAS). Their gameplay abilities involve:
-
A summon ability spawning adds
-
A juicy ranged magic attack
-
Shared melee and ranged normal attack
More Information about this project:
Cross the Continent - A FPS Level Prototype
In this 3-week project, the AI behaviors for my melee and ranged enemies involve three goals:
-
Token-based combat logic from Doom (Whoever gets a token can attack)
-
Navigation through EQS (Chase, Strafe, and Jump)
-
A little bit smart (Take cover and heal)
AI Controller - I implemented an AI controller for all enemies in this project. This controller handles the following things:​
-
Initialization
-
Perception
-
Sight
-
Sound
-
Damage
-
-
Forget the player
-
Seeking an attacker
-
Inform allies of threats
The basic behavior of all enemies involves three FSM states: combat, investigation, and patrol or passive. Each of these states is a subbehavior tree. By setting up all sharing basic states in a base behavior tree BP, I can reduce coupling and modulate differing behaviors.
This is the behavior tree for melee enemies. A melee enemy will patrol passively without wielding a weapon (sword). Then, if it enters a combat state, it will wield a sword, run to where the attacker is, and strafe until getting a token (and the last attack's CD finishes) to perform an attack.
The base enemy class incorporates two interfaces that handle implementing AI behavior and damage calculation. Interfaces are always useful for reminding me to implement critical functions and reducing function redundancies.
The basic behavior of all enemies involves three FSM states: combat, investigation, and patrol or passive. Each of these states is a subbehavior tree. By setting up all sharing basic states in a base behavior tree BP, I can reduce coupling and modulate differing behaviors.
All the AI behaviors are implemented via a structured behavior tree. I created a base behavior tree taking care of shared behavior while having subtrees handle specific behaviors by using: ​
-
Services
-
Tasks
-
EQSs
-
Decorators
More Information about this project:
Kneedle Knight - A Boss Arena prototype for a 3D Action Platforming Game
Boss Fight Prototype - In the 1st pass of the gameplay prototype, I was assigned by the team to create a boss fight arena containing the following parameters:
-
Containing two skills testing all the player's skills
-
The arena's layout would change based on the boss's health points
-
Emphasizing the feeling of fighting against a giant enemy
Flow Chart - After presenting my design ideas to team leads, I made this flow chart to visualize the boss fight flow.
Boss Fight's Gameplay - Whenever the player picks up 3 items, the boss will become weak, and the player can damage it from its back.
Class Diagram— I designed this class diagram to help me organize the boss's finite state machine (FSM). The AI logic in this prototype includes:
-
a "Factory Function"—to initialize all objects in the boss fight arena
-
a virtual class of "Enhancer," including all interactive game objects that can affect gameplay
-
an enumeration to specific the boss state in FSM
Because I was assigned to complete the prototype in 7 hours without any available assets, I used basic shapes to quickly build up the testing map and gameplay mood. The Boss fight level features:
-
Two abilities challenging the player's locomotion skill
-
Casting a fire bolt as a normal attack​
-
Casting fire nova whenever the player collects a cheese
-
-
Two sections challenging the player's different advanced skills​
-
Diverse traversal experience given by enhancers and randomized cheese positions
More Information about this project: