Idle behaviors

What companion does when they are bored?

When we don't move and our companion NPC stands on the same place for some time, our companion becomes idle and choose one of their defined idle behaviours. Sometimes companion can change choosen behavior to another one.

Idle NPC definitions

We can define these types of idle behaviors:

  • Idle Companion stands on their position and does nothing
  • Animate Play an animation frames defined in SDV content asset Data/animationDescriptions
  • Lookaround Companion looks around by changind their face direction

Each behavior has a common data and type specified data. There are a table of the common data field:

FieldTypeDefault valueDescription
BehaviorBehaviorTypeREQUIRED! The type of behavior. Valid behavior types are listed above
Tendencyfloat1.0The chance this behavior will be chosen, as a relative weight. A higher number results in a higher chance, with the probability being calculated as a fraction of the sum of all weights of defined behaviors. When all defined behaviors have an equal weight, they all have the same chance of being chosen.
MinDurationinteger10Minimal duration in seconds during which this behavior is active. When duration time expires, behavior is chosen. If algorithm chooses the same behavior as is the active, the behavior duration is be extended.
MaxDurationintegerMaximal duration in seconds during which this behavior is active. If value of this field is less than MinDuration or is undefined, this field is ignored.
ConditionstringCondition when this behavior can be applied. Matching conditions is expensive operation, use them sparingly.

If you let IdleBehaviors fields empty or undefined, the Idle behavior type will be forced when companion become idle.

{
  "Format": "2.0",
  "Name": "Abigail",
  /* ... */
  "IdleBehaviors": [
    {
      "Behavior": "Animate",
      "Animations": [
        "abigail_sit_ground",
        "abigail_flute" 
      ],
      "Tendency": 5,
      "MinDuration": 10,
      "MaxDuration": 30
    },
    {
      "Behavior": "Lookaround",
      "FaceMinSeconds": 2,
      "FaceMaxSeconds": 5,
      "Tendency": 2,
      "MinDuration": 10,
      "MaxDuration": 30
    }
  ]
}

Animate behavior

Animate behavior type includes the common behavior fields above and this extra fields:

FieldTypeDefault valueDescription
Animationsstring[]REQUIRED! Names of referenced animations from SDV content asset Data/animationDescriptions which companion plays during this behavior. Companion chooses one of these animations and may change it to another one animation during idle state.

Adding custom idle animations

You can add your custom idle animations for your companions. Just edit Data/animationDescriptions and add entries with frames of your animation. Animation frame references the coresponding sprite frame in current loaded NPC sprite sheet.

Example of adding custom animations with Content Patcher

{
  "Changes": [
    {
      "LogName": "Load NPC Adventures companion animation descriptions",
      "Action": "EditData",
      "Target": "Data/animationDescriptions",
      "Entries": {
        "abigail_sit_ground": "26 26 26 26/27/26 26 26 26",
        "alex_reading": "36 36 38 38/35/38 38 36 36",
        "alex_sit_ground": "36/36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 37 37 37 37 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36/36",
        "elliott_read_alt": "32 32 33 33/33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33/33 33 32 32",
        "harvey_read_alt": "39/42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43 43/39",
        "shane_warmup": "0/19 19 30 30 30 30 30 31 31 31 31 31 31 31 31 31 31 0 0 0/0",
        "elliott_sideFish": "40/40 42/42"
      }           
    }
  ]
}

Choose behavior flow Abigail spritesheet frames