Tim Barrett's profile

Entrenched Enemy AI

This project/prototype was a short test that I participated in over the course of three days. I was tasked with creating a prototype of a third person shooter that featured four enemy AI's entrenched within a house. The player's objective would be to breach the house and clear each of the enemies, while avoiding enemy fire as much as possible.

Each enemy would die after being hit by a single bullet. The player, however, wouldn't die when hit. Instead, each hit would add to a counter on the player's HUD to track how well they performed with each attempt at the scenario. The player would be allotted six, thirty round magazines and two grenades.
Each of the above Blueprints would power the player's HUD. The first, would track the player's ammunition as it was shot, or the magazine was reloaded into the weapon. The second would increase the value displayed in the bottom left corner for how many times the player had been shot by an enemy. Lastly, the bottom right Blueprint shown above would display the objective to the player.

The enemy AI was set up using a behavior tree, blackboard keys and an EQS system with a custom context.
The AI Controller would run the behavior tree at launch to begin the AI cycling through its tasks based on the state of the game. Additionally, it would initiate the AI's stimuli so that it could detect the player through sight as well as lose the player if the line of sight was broken. Lastly, The AI would have a set focus in order to communicate with the EQS systems set in place for it.
The AI's Blueprint set up its collision and health settings to allow the actor to be destroyed if shot. The actors were also tracked so that the game would end once they'd all been destroyed by the player. Additionally, within the AI's Blueprint was its ability to fire the weapon equipped to them if the player was within its line of sight.
The Blueprint below uses a for and for each loop to tell the AI to shoot at the player if it is they are in sight and stop shooting at them when the line of sight was broken.
The hierarchy of the enemy AI's Behavior Tree was set up to prioritize finding cover within the house that it spawned in so that the player couldn't simply shoot them before they had the chance to entrench themselves and render the scenario too easy. If the player was inactive for too long, the enemies would take initiative and begin to seek out the player in order to flank them and eliminate the threat before allowing the player to initiate an attack.
Below is the Blueprint for the Player Character. These would allow the player to aim down sights by activating a secondary camera socketed to the player's equipped weapon. The crouch function was bound to a key press and would allow the player to protect themselves from enemy fire by crouching behind cover, and would slow their movement as a result until they returned to standing position.

The player's equipped weapon was also set to fully automatic with an ammo tracking system to interact with the HUD Blueprint shown and described above. Additionally, the player's ability to take damage from enemy gunfire would interact with the counter displayed on the player HUD Blueprint described earlier. Lastly, the binding and reload function was set for the player here as well.
The two Blueprints below show the weapon's ability to fire and track ammo usage in order to display it to the player.
Last is the Blueprint to control the win condition that would terminate the game once each enemy had been defeated by the player.
Entrenched Enemy AI
Published:

Owner

Entrenched Enemy AI

Published: