175
Tool Creation |Human Agents
174
Tool Creation |Human Agents
Enter State tasks within the Behavior Tree
Screen-captured by Author.
Agents entering and exiting the building
Simulated and Screen-recorded by Author.
Exit State
Check to see if the threshold is open or closed (if there is a door built into the opening)
Calculate location depending on if there is a door or not.
If there is a door that is closed, define a random location on the same side of the threshold.
If there is no door or if the door is open, define a random location on the other side of the threshold.
Go to location.
Play animation depending on if there is a door or not.
If there is a door, turn towards the door and play open door animation. Then go back to step 2b.
If there is no door, proceed to step 5.
De-spawn agent.
With these two states, the agents can now enter and exit the simulation. (Fig. 3.3.31 - 32) In the case of evacuation however, the agent must also remember the location of the last threshold they’ve encountered, which can be recorded within their AI controller as an object array. In such a case, the agent would simply need to pull up the array to obtain the location, and then execute the steps from ExitState.