One day out of nowhere, I’ve decided that I was going to do a NPC case study on the Nutcracker from the hit indie game Lethal Company.
I thought this would be a fun side project to study and learn what it takes to make an enemy NPC from a released game. All recreated in Unreal 5.4 in 5 days.
The goal was the replicate the Nutcracker in every way, using the original model, animations & SFX, and remaking the AI behavior with all of it’s nuance details.
Challenges
Timed (internal decision making) transitions weren’t as simple as FSM.
To transition to the Inspect State after an elapsed time has passed, had to call a timer event in the AI Controller.
Was considered a parallel action and should try a custom Service node next time.
Translating Finite State Machine to Behavior Trees.
Had to view Behavior Trees as Hierarchical FSM.
All nodes under the same selector node can transition into each other.
All nodes under the same sequence node executed in an one-way series.
Every tree depth was it’s own set of states.
White - Patrol
Yellow - Inspect
Red - Aggro
Cyan - Kick
Shortcomings
Couldn’t attach AI Perception Comp to the model’s head.
Can override GetActorEyesViewPoint, but Unreal C++ kept crashing on PC.
Can put AI Perception Comp on child Actor, then read data from there.
Didn’t because I couldn’t see the perception cone in the debugger.
Will resort to thirdparty add-on.