top of page

Unreal Engine FPS

Bot Fight
AI Behaviour Tree

This project was all about creating an FPS from scratch in Unreal Engine 4. It was the first time I had done many of the processes involved, including creating AI using behaviour trees.

Game Modes

There are two game modes available; deathmatch and team deathmatch. Each of these is played on the same map. You can play with 1-4 player controlled characters in split screen, whilst any remaining spaces will be filled with bots. The scoreboard UI is invidividual to each players' viewport, and changes depending on the game mode.

AI

The AI can be set to either play in a free for all deathmatch or a team deathmatch, utilising the same behaviour tree for both. It performs most if not all the checks a human would, including checking whether it can reload, or if it cant reload, whether it has a gun in its inventory that it can reload etc.

Target acquisition is performed by line of sight using a dot product calculation against all other characters in the level.

Weapons

Each weapon derives from either the base gun class or the base melee weapon class, which in turn each derive from the base weapon class.

Interfaces are used throughout so the owner of the weapon only needs to know to try and either use primary or secondary fire.
Weapons include:

  • Machine Gun (hitscan)

  • Shotgun (hitscan)

  • Rocket Launcher (projectile)

  • Frag Grenade (projectile)

  • The Immobilizer (projectile)

    • Primary fire - Fires a ball that will roll on the floor and then explode. Enemies within it's sphere of influence will take x amount of damage x times per second, adding up to a DPS set in the weapon. This continues for a few seconds.

    • Secondary fire - Fires a similar ball that floats slowly through the air until hitting something at which point it will stick. This ball causes less damage than it's primary counterpart and can be shot out of the air.

Inventory

The inventory system was designed as a blueprint component.

Features:

  • Slots for primary and secondary guns, melee weapon and grenades.

  • Can drop the held item, allowing anyone to pick it up with the same stats.

  • Inventorys can be transferred between characters.

Characters

Characters each have their own unique stats such as jump height and run speed, as well as their own abilities.

Abilities:

  • Launch - Launch high into the air.

  • Dash - Near instantaneously dash forward a short distance.

  • Featherfall - Fall slowly to the ground whilst holding jump.

bottom of page