173

Tool Creation |Human Agents

172

Tool Creation |Human Agents

Enter/Exit State

Since most spaces are not closed systems, we will need a way for the agents to enter and leave. As such, entrances and exits need to be defined within the simulation to establish the crowd flow within the space. Because these entrances and exits are essentially a type of threshold however, we can use the same methodology defined in ThresholdState, with the addition of spawning the agents in the case of entering, and de-spawning the agents in the case of exiting. (Fig. 3.3.29 - 30) From this logic, we can establish the following steps:

Enter State

Spawn agent along the entrance threshold.

Check if threshold has a door or not

Calculate location depending on if there is a door or not.

If there is a door, play door opening animation, then to go step 2b.

If there is no door, set agent rotation to face perpendicularly away from the entrance threshold.

Set AgentState to DefaultExplore.

To spawn Agents, we must first make a list of all the Entrance Threshold objects at the start of the simulation

Screen-captured by Author.

Spawning Agents at Entrance Thresholds

Screen-captured by Author.