Sandbox Package

Revision as of 11:26, 24 November 2008 by imported>Jwoodward (→‎'''Action Selection''')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Sandbox Package allows NPCs to exhibit autonomous ambient behavior without the need for explicit schedules. When assigned to use a sandbox package, an NPC will automatically interact with food, furniture, Idle Markers, and other characters in the world.

Action Selection

When a sandbox package starts up, it builds a list of nearby objects with which it could interact. To select an action, it computes a score for each object, based on the specifics of that object. That score will be set to zero if that object becomes an invalid target, or if it was the same object that the sandbox just selected previously. Each object's score is then weighted by a relative "probability" value based on the type of the interaction (i.e. sleep, eat, use furniture, use idle markers, or dialogue). The sandbox maintains these probability values over time, adjusting them each time it choses a target object. It drops the probability to zero for the type that was just chosen, and increases the probability for the other types. This ensures that the actor will not select the same kind of action repeatedly (unless it has no other options). For example, after eating, the probability of eating again immediately will be zero, but will increase over time as the actor performs actions other than eating.

Idle Markers

Much of the behavior of an NPC using the sandbox package results directly from data attached to objects in the world (idle markers, with collections of potential animation), or simply from the presence of objects in the word (furniture, food, other NPCs), with no extra data required.

See Idle Markers for more information about what can be specified on a marker.

Sleeping

Sleep time and duration is calculated when the sandbox package starts, and then recalculated once per day as necessary.

Sleeping is based on the following gamesettings:

iSandboxSleepStartMin
Min time to start sleeping. (Default = 19)
iSandboxSleepStartMax
Max time to start sleeping. (Default = 1)
iSandboxSleepDurationMin
Minimum duration for sleeping. (Default = 6)
iSandboxSleepDurationMax
Maximum duration for sleeping. (Default = 10)

Start Time

Rolls randomly for sleep start time between iSandboxSleepStartMin and iSandboxSleepStartMax.

So sandboxing actors can start sleeping between 19:00 and 1:00, using these gamesettings.

Duration

Rolls randomly for sleep duration using iSandboxSleepDurationMin and iSandboxSleepDurationMax.

Eating Meals

Sandboxing actors calculate their mealtimes when the sandbox package starts, and then recalculate them once per day as necessary.

The meal times are based on the following gamesettings:

iSandboxBreakfastMin
Min time to start eating breakfast. (Default = 6)
iSandboxBreakfastMax
Max time to start eating breakfast. (Default = 9)
iSandboxLunchMin
Min time to start eating lunch. (Default = 11)
iSandboxLunchMax
Max time to start eating lunch. (Default = 14)
iSandboxDinnerMin
Min time to start eating dinner. (Default = 17)
iSandboxDinnerMax
Max time to start eating dinner. (Default = 20)
iSandboxMealDurationMin
Min duration for eating a meal. (Default = 0)
iSandboxMealDurationMax
Max duration for eating a meal. (Default = 2)

Other Behaviors

When not sleeping or eating a meal, the actor can engage in other activities -- if allowed by the package and available within the package radius.

Behaviors:

  • Conversation -- no duration, the behavior is done when the conversation is finished.
  • Furniture (chairs, etc.) -- pick duration as below
  • Idle Markers -- pick duration as below
  • Eating -- pick duration as below
  • Wandering -- pick duration as below

Duration

Various gamesettings and formulas are used in calculating behavior duration. The basic idea is that this varies based on an actor's energy -- low energy actors tend to spend more time sitting and eating; high energy actors spend more time wandering and idling.


Package Specific data

  • Starting Location:
    • Near Reference: The actor will Sandbox at this location. If the specified location is the start of a linked patrol route, the actor will Sandbox at each patrol point for a duration specified by Patrol Idle Time, then move on to the next linked location after it completes its current action.
      • Radius: Indicates how close the NPC has to get to target reference.
  • Wander Location: Standard Location data. Go to specified location and wander near it, within a specified radius.
  • Allowed Behavior: Check to enable the following behaviors:
    • Eating
    • Sleeping
    • Conversation
    • Idle Markers
    • Furniture (other than beds)
    • Wandering

Flags

  • Must Complete: Invalid.