A downloadable game

Heist Guys is a stealth action (horror?) game made in ~5 hours for a Mastered Creator day.

The brief was to make anything that had an AI system in it. I already had a fair bit of experience with AI as I used a state machine with a lot of Unreal's AI functions, I used this day as an excuse to delve deeper into behaviour trees.


You can find the Git Repo here: https://github.com/Woeger/Heist-Guys

CONTROLS: 

WASD: Movement

Mouse: Move Camera

CODE:

I was really looking into behaviour trees and how they work with this project, so naturally how I accomplish that is the best thing to show off.


As this was a fairly rapid prototype, the behaviour is simple but I tried to replicate a lot of what I did in my main portfolio project. 

The bulk of this tree is based on the selector that has two different subtrees depending on if we can or can't see the player. Sensing the player is done the same as my portfolio project with a pawn sensing component, utilising sight. Though I set it up purely with C++ in this case.

 

I manually create the perception component, along with a SenseConfig_Sight in order to tweak the parameters of the perception. Once I have all of that, I set up a callback function with OnTargetDetected. OnTargetDectected accesses the blackboard of the behaviour tree in order to set the Boolean used to control that selector to true, which gives us the chasing behaviour instead of the random locations. It'll default back to the random locations when the MaxAge is reached, which is defined in those parameters.

If you want to see all the Tasks I made, the code is in the repo above, but I'll showcase how I find the player location, which is the first task executed in the right subtree.


Tasks for behaviour trees in C++ all generally follow the same format, which is having this 'execute task' method, which takes in a behaviour tree that its run within. This task specifically is used for finding the player location, which we use to make the AI chase the player. I accomplish this by first getting the player character from my gameplaystatics, before getting the location of that character. I then have an if check to see if we're already chasing (as we'll go through that right subtree multiple times) and if we're not, we set the target location, otherwise we get a random point near the players location inside the Navigation Mesh.

Download

Download
HeistGuys.zip 655 MB

Leave a comment

Log in with itch.io to leave a comment.