169

Tool Creation |Human Agents

168

Tool Creation |Human Agents

Agent Interact state tasks within Behavior Tree

Screen-captured by Author.

Agents interacting with each other

Simulated and Screen-recorded by Author.

Agent Interact State

The agent interact state defines what happens when an agent decides to interact with another agent. The methodology for this is similar to what we just established within object interact state, except we now must consider these steps in the context of human interactions.

When an agent decides to interact with another agent, this interaction could either be with someone the agent knows (an acquaintance) or have never met (a stranger). As such, we can logically deduce these interactions into these two basic types. When the agent wants to interact with a stranger, they might first need to walk up to them before engaging in conversation. However, when the agent wants to interact with an acquaintance, they might both recognize each other and meet halfway. To simply this into its fundamental actions, we can proceed with the following steps: (Fig. 3.3.25 - 26)

Check if the other agent is facing towards or away the agent (by using the dot product).

Define location depending on the direction of the other agent.

If facing away, move to the location of the other agent.

If facing towards, define random location between the two agents.

Get attention of the other agent by setting the AgentState of the other agent to AgentInteract (with an optional tap animation).

If facing away, get their attention after walking to them.

If facing towards, get their attention before walking to the random location between the two agents.

Loop talking animation for a random time interval.

After finished talking, play goodbye animation.

Set both agents’ AgentState to DefaultState.

While this method might imply that the people facing away are presumed to be strangers, and people facing towards are acquaintances, the fact that the location generated in between the two agents are random in step 2b means that there is a gradient of possible meeting locations between the agent. This gradient then can portray both acquaintances meeting in the middle, or the agent going up to a stranger to talk, or the agent signaling a stranger or acquaintance to come to them, or anything in between.

Of course, if other senses, such as sound, were added, we would then need to introduce another option, where the first agent might shout at the other agent to get their attention, in which the other agent would then turn around and they can meet at a random location between them. This being said, to keep the simulation simple at this stage, we will mainly be utilizing sight.