155
Tool Creation |Human Agents
154
Tool Creation |Human Agents
Agent-State Actions
Now that we have established the three human systems within our simulation model, our agents should be able to move around freely within the space. However, since these agents are no longer simple dot representations—but actual human agents walking in a virtual 3D environment—we require additional considerations to portray them within the simulation.
The first of these considerations are the actions the agents need to perform once they choose a state from the decision logic. Within our processing prototype, they are simply represented by dots that try to avoid one another to get to a target. While this was fine when the level of detail was represented by dots, it seems rather unrealistic now that these agents are more representative of the human form. As such, to retain this credibility, we need to define a set of actions for the agents to perform depending on the task that they choose to act upon. In doing so, this crowd simulation becomes much more comparable to reality.
Fortunately, UE4 provides a useful tool called the Behavior Tree specifically for scripting artificial intelligence. This tool—much like blueprints—provides a visual method of integrating functionality by utilizing a series of nodes. The difference from blueprints, however, is that this Behavior Tree Graph executes logic by priority from left to right and top to bottom.[11] (Fig. 3.3.13 - 14) This allows the Behavior Tree to work alongside the blackboard and AI controller to provide an intuitive method of establishing these actions based on the choices the agents have made. The decision logic tells the blackboard what state the agent is in, and the behavior tree will read that state to determine which branch of tasks it should perform. From this, we can define a series of states that the agent may be in.
The Behavior Tree allows a visual way to define AI tasks within UE4
From “Behavior Tree Overview,” Unreal Engine Documentation, accessed October 18, 2019, https://docs.unrealengine.com/en-US/Engine/ArtificialIntelligence/BehaviorTrees/BehaviorTreesOverview/index.html.
Behavior Tree Execution Order from top to down and left to right
From “Behavior Tree Overview,” Unreal Engine Documentation, accessed October 18, 2019, https://docs.unrealengine.com/en-US/Engine/ArtificialIntelligence/BehaviorTrees/BehaviorTreesOverview/index.html.