Sandbox Package

From GECK
Jump to: navigation, search

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 chooses 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.

Also see the iSandBoxPreventRepeatedActionTime setting.

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:


Setting Default Description
fSandboxSleepStartMin 19 Min time to start sleeping.
fSandboxSleepStartMax 1 Max time to start sleeping.
fSandboxSleepDurationMin 6 Minimum duration for sleeping.
fSandboxSleepDurationMax 10 Maximum duration for sleeping.


Start Time

Rolls randomly for sleep start time between fSandboxSleepStartMin and fSandboxSleepStartMax.

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

Duration

Rolls randomly for sleep duration using fSandboxSleepDurationMin and fSandboxSleepDurationMax.

Eating Meals

Sandboxing actors with the "eating" flag set in the package calculate their mealtimes when the sandbox package starts, and then recalculate them once per day as necessary. Actors will grab food items from the game world such as in containers or physically placed on top of furniture and consume them.

The meal times are based on the following gamesettings:


Setting Default Description
fSandboxBreakfastMin 6 Min time to start eating breakfast.
fSandboxBreakfastMax 9 Max time to start eating breakfast.
fSandboxLunchMin 11 Min time to start eating lunch.
fSandboxLunchMax 14 Max time to start eating lunch.
fSandboxDinnerMin 17 Min time to start eating dinner.
fSandboxDinnerMax 20 Max time to start eating dinner.
fSandboxMealDurationMin 0.5 Min duration for eating a meal.
fSandboxMealDurationMax 2 Max duration for eating a meal.


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.