Summary
In this chapter, we created a simple form of NPCs in our virtual world. We started by exploring the basic nature of behavior trees and state machines, and to have a tool for creating the state machine controlling the behavior available, we added an ImGui-based visual node editor. Then, we added classes for different node types and integrated these new classes into the existing code, including a node factory and node editor extensions. Finally, we added interactions with other instances in the virtual world.
In the next chapter, we will go back to the animation side of things: we will add additive blending in the form of morph animations to create facial animations. First, we will discuss what morph animations are, and which constraints we must take care of. Then, we will import existing morph animations in the glTF models and offload the animation work to the GPU, similar to the other animations. As the last step, we will combine facial animations and interactions, creating...