Sandbox Package
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 SelectionEdit
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.
Also see the ISandBoxPreventRepeatedActionTime setting.
Idle MarkersEdit
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.
SleepingEdit
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 |
iSandboxSleepStartMin | 19 | Min time to start sleeping. |
iSandboxSleepStartMax | 1 | Max time to start sleeping. |
iSandboxSleepDurationMin | 6 | Minimum duration for sleeping. |
iSandboxSleepDurationMax | 10 | Maximum duration for sleeping. |
Start TimeEdit
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.
DurationEdit
Rolls randomly for sleep duration using iSandboxSleepDurationMin and iSandboxSleepDurationMax.
Eating MealsEdit
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:
Setting | Default | Description |
iSandboxBreakfastMin | 6 | Min time to start eating breakfast. |
iSandboxBreakfastMax | 9 | Max time to start eating breakfast. |
iSandboxLunchMin | 11 | Min time to start eating lunch. |
iSandboxLunchMax | 14 | Max time to start eating lunch. |
iSandboxDinnerMin | 17 | Min time to start eating dinner. |
iSandboxDinnerMax | 20 | Max time to start eating dinner. |
iSandboxMealDurationMin | 0 | Min duration for eating a meal. |
iSandboxMealDurationMax | 2 | Max duration for eating a meal. |
Other BehaviorsEdit
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.
BehaviorsEdit
- 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
DurationEdit
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 dataEdit
- 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.
- 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.
- 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
FlagsEdit
- Must Complete: Invalid.