Breaking the Cycle Dev Notes | DevLog_022

Outsets and Expectations

Because the brief allowed for a few more weeks of development, I wanted to take the brief and learn something new. Something more out of my comfort zone and perhaps skill set to stretch myself a bit more than last project. I set out to do more a more systemically driven game, with emphasis on AI actions determined by a state machine. I was slightly nervous about the scope of this project at the beginning, with my biggest concerns being the AI Programming, which I haven’t done within UE5 and using C++. My other big concerns were the scope of having a narrative experience unfold through player exploration and interacting with the world. 
 
I segmented these concerns by delineating what I was willing to spend on trying to figure out a certain problem before having to give it up to meet the brief. So having a custom AI controller that controlled 3 different characters was the largest hurdle to solve, so I decided to start there and see where the scope would break me.

Custom AI Behaviors

I knew that setting these custom behaviours would involve having to do them in C++, which is why I wanted to tackle them. After a couple days of reading documentation, I was able to sort out any questions I had and get a working prototype of multiple NPCs working off the same Behaviour Tree autonomously (and in unique ways).

AI Behavior Tree
Custom Behavior Tree Node

This behaviour tree was the basis of the NPC actions, while the nodes in the tree were custom, accessing the HouseStateMachine I built in tandem to trigger certain actions according to each unique NPC’s actions.

House State Machine

The properties in the state machine were easily manipulated by the actors in the world, as it is just an Info Actor that exists in the world. It has no transform or scene component, but rather is a dynamic custom data structure to keep track of the multiple NPCs, while granting access to those states to Actors in the world that would need them.  

AI NPC Properties

These properties in each NPC were either triggered by the state machine, or reactive of the state machine being set by something else in the world. This systemic element is rather simple, but I believe I could expand this system to a much more complex world with more behaviours in a larger time frame. But for what is needed in this brief, I believe it provided the bones to a solid implementation of the mechanics we set out for.

Resetting Expectations

Reflecting on tackling the AI elements, I felt more confident on keeping the scope of the game where it was at, given that I achieved what I thought would be my largest hurdle quickly. It is not perfect, but it gave me the confidence to carry on with the rather lofty game idea and continue implementation on features surrounding the idea of reacting to multiple AI actors in the level.

Leave a comment

Your email address will not be published. Required fields are marked *