153

Tool Creation |Human Agents

152

Tool Creation |Human Agents

Pathfinding

The last human system to reestablish is the pathfinding system. Recalling from Chapter 2.3: Abstracting the Human Systems, the purpose of this system is to provide a way for the agents to move to their goals through the consideration of their subconscious desires, which we achieved by modifying Craig Reynolds’ description of the three layers of motion: action selection, steering, and locomotion. From this, we investigated Edward T. Hall’s proxemics to establish personal space for the agents, where action selection defined their subconscious desires of preserving this space, steering provided the forces that drove this preservation, and locomotion translated this force into their current position within the virtual environment.

Translating this methodology into UE4 is once again, fairly straightforward, considering that the software has a built-in navigation system by means of a NavMesh volume within the simulation environment.[10] (Fig. 3.3.11) As it can be seen, compared to simple text-based IDEs such as processing, where we had to essentially create everything from the ground up, UE4 offers a vastly more efficient workflow. Rather than having to work down the levels of code to calculate the vector position of these agents while simultaneously implementing various vector calculations to account for collision and avoidance, we can now just utilize UE4’s built-in navigation for the agents to move to their desired conscious goals.

In order to implement subconscious goals such as personal space, however, we must implement our modified layers of motion on top of this built in NavMesh. This can be done by utilizing a Tick Event (which is triggered every frame) to trigger an offset position node within the AI controller. In doing so, we can utilize a variety of vector calculation nodes to mimic the steering forces from Reynolds’ description of motion. (Fig. 3.3.12) This will not only make the crowd flow smoother but also more human-like.

Navmesh at work

Simulated and screen-recorded by Author.

Flocking Behaviors recreated with Vector and World-Offset nodes within UE4

Screen-captured by Author.