Skip to content

NPC Attitudes

Overview

Attitude files define the social and combat disposition of an NPC type toward other groups of NPCs and toward item categories. Each file corresponds to a specific NPC role or family and lists named groups mapped to attitude values. The engine reads these files at runtime to determine whether an NPC should attack, flee, ignore, or befriend another entity it detects.

File Location

  • Assets/Server/NPC/Attitude/Roles/**/*.json — Attitude toward NPC groups
  • Assets/Server/NPC/Attitude/Items/**/*.json — Attitude toward item categories

Schema

Role Attitude file

FieldTypeRequiredDefaultDescription
GroupsobjectYesMap of attitude names to arrays of NPC group IDs.

The Groups object keys are attitude names. The recognized attitude names are:

AttitudeMeaning
FriendlyThis NPC considers those groups as allies — will not attack them and may assist them.
HostileThis NPC will attack members of these groups on sight.
NeutralPassive awareness — neither attacks nor assists.
IgnoreCompletely disregards members of these groups.
ReveredHighest positive regard — may follow or protect.

Item Attitude file

FieldTypeRequiredDefaultDescription
AttitudesobjectYesMap of attitude names to arrays of item category IDs.

Item attitude names follow the same vocabulary as role attitudes (Friendly, Hostile, Dislike, Love, etc.).

Examples

Predator attitude (Critters file)

Critters consider most categories hostile (flee from them) but are friendly toward Fen_Stalker.

{
"Groups": {
"Friendly": [
"Fen_Stalker"
],
"Hostile": [
"Vermin",
"Birds",
"Predators",
"PredatorsBig",
"Void"
]
}
}

Prey attitude (Predators file)

Predators treat prey as neutral (trackable but not attacked proactively) and ignore other large predators.

{
"Groups": {
"Neutral": [
"Prey"
],
"Ignore": [
"Predators",
"PreyBig"
]
}
}

Faction attitude (Trork)

Trorks are friendly to their own kind, hostile to Kweebecs, ignore prisoners, and revere their chieftain.

{
"Groups": {
"Friendly": [
"Trork"
],
"Hostile": [
"Kweebec"
],
"Ignore": [
"Kweebec_Prisoner"
],
"Revered": [
"Trork_Chieftain"
]
}
}

Living world attitudes

The LivingWorld/ attitudes provide simple relationships for ambient creatures:

Aggressive (aggressive creatures treat passive ones as hostile):

{
"Groups": {
"Hostile": ["Passive"]
}
}

Neutral (neutral creatures treat aggressive ones as hostile):

{
"Groups": {
"Hostile": ["Aggressive"]
}
}

Item attitude

{
"Attitudes": {
"Dislike": ["Weapon"],
"Love": ["Food"]
}
}

Empty attitude (no relationships defined)

{
"Groups": {}
}

Relationship to Role Files

The AttitudeGroup parameter in a role’s template (e.g. "AttitudeGroup": "Prey") declares which group that NPC belongs to. When another NPC detects it, the engine looks up the detecting NPC’s attitude file to see how it maps that group.

  • NPC Roles — Role files that declare DefaultNPCAttitude, DefaultPlayerAttitude, and AttitudeGroup
  • NPC Groups — Group definitions referenced in Groups arrays
  • NPC Templates — Templates that set default attitude parameters