171

Tool Creation |Human Agents

170

Tool Creation |Human Agents

Threshold State

While explore provides a good generic way for agents to explore the space, we should remember that there are other forms of attractors other than distance. To accommodate for this, we can define another class of objects that represents thresholds. These objects would act as doors or openings that offer attraction to passing agents as they see it, which allows slightly more control in diversifying the crowd movements within the simulation space.

The series of actions required for this state can be thought of as a simplified version of the object interact state, as the agents are essentially interacting with the door or threshold. As such, we only require a slight modification in animation and position when compared to the object interact state. To create a series of actions for this then, we can define the following steps: (Fig. 3.3.27 - 28)

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 or if the door is open, proceed to step 5.

Change AgentState to DefaultExplore.

With these steps, the agent will walk through the threshold on to the other side and continue to explore the space beyond. If there is a door in the way, the agent will then proceed to open the door first before walking through to the other side.

Threshold State tasks within Behavior Tree

Screen-captured by Author.

Agent moving through threshold

Simulated and Screen-recorded by Author.