Skip to content

Response Curves

Overview

Response curves map input values to output values using mathematical functions. They’re used primarily in NPC AI decision-making to evaluate conditions like health percentage, distance to target, and threat level.

File Location

Server/ResponseCurves/*.json

Schema

FieldTypeRequiredDescription
TypestringYesCurve type: Exponential, Linear, Logistic, Constant
SlopenumberNoSteepness of the curve
ExponentnumberNoPower for exponential curves
XRangeobjectNoInput range with Min and Max

Curve Types

Linear

Output changes proportionally with input.

{ "Type": "Linear", "Slope": 1.0, "XRange": { "Min": 0, "Max": 1 } }

Exponential

Output accelerates or decelerates based on exponent.

{ "Type": "Exponential", "Exponent": 2.0, "Slope": 1.0, "XRange": { "Min": 0, "Max": 1 } }

Logistic

S-shaped curve — slow at extremes, steep in the middle.

{ "Type": "Logistic", "Slope": 10.0, "XRange": { "Min": 0, "Max": 1 } }

Usage in AI

Response curves convert raw sensor values into utility scores for NPC decision-making:

{
"Type": "OwnStatPercent",
"Stat": "Health",
"Curve": "Linear"
}

When an NPC has 30% health, the Linear curve outputs 0.3. The AI system uses this score to weight actions like fleeing vs. fighting.