top of page
  • Writer's pictureCallum Winfield

Devlog 4 - Behaviour Trees

Moving on from the last attempt to create immersive Ai for the robot companions in the game, I decided to do some further research on possible ways to create AI in Unreal Engine. I came across how Unreal Engine integrates its own behaviour tree system. The system is so heavily integrated into the engine that they are soo many possibilities in what we could accomplish with our games Ai.

I began to create a behaviour tree for the AI present in the scene with just some simple states that it can act out on input presses from the player. The Behaviour tree reads the AI's current state by going off of the selector node and working its way left to right and see what states it can activate. Nodes such as Sequence node contain their own blue print class that define a function.

Along with the Ai having a Behaviour Tree it also has another component attached which is a thing called a Blackboard which contains actions that can be referenced with the Behaviour tree's blueprints.

Though the Ai still needs to have its base blueprint set out or the Ai wont be able to reference stated in the Behaviour Tree. Below you can see the base blueprint for the Ai with at the top an Event Begin Play node which leads into two nodes that run the behaviour tree and call for the blackboard to be used, a node that set up underneath that defines what initial state the Ai will be in and a final node set up that defines how the Ai will follow the player character.

The player can also interact with the AI's movement as well, below you can see some of the interactions programmed into the player controller. These include the option to make the AI wait, this is seen by the top node link with it ending with a final Print String node that just shows the text "waiting" on screen to help with play testing. The node link below that is related to the follow command the player can give to the Ai companion, with a similar Print string at the end to give the message "following player".

The last ability I wanted to have set in the game was to be able to tell the Ai companion to go to a certain location on the map with a spannable waypoint the player will create.

The simple mock up was made in Unreal engine using a pre-set shape, a point light and a custom emissive material.

Below you can see an example of one of the playtest, demonstrating the working follow and wait system, though the go to system and waypoint are heavily broken. The action will create the debug line in front of the player and spawn the waypoint though it will spawn the waypoint in the wrong location which will in turn send the Ai follower to that location. I've tried all I can to fix this and nothing has been able to work so I'm gonna hand over what I've worked on to one of my team mates and see if they have any better luck getting the system to work.

I also did some play testing with what was working with this system to see if any players could break what was in place. Overall I did 4 playtests with different players and found no result leading to any bugs occurring, below you can see one of the playtests I recorded during this time.



11 views0 comments

Recent Posts

See All
bottom of page