data/brains/
A brain: how an AI agent decides what to do. An archetype brain is a fixed priority list of built-in behaviours (wander, graze, charge, flee); a full brain scores activities by utility and runs each activity’s state tree. A brain names its senses, the memories it uses, and its awareness and LOD profiles, and may inherit from a parent: params merge by key, senses, memories, behaviours and activities merge as keyed lists ("-<key>" removes one), and abstract is not inherited. An archetype’s manifold-ai:brain component names its brain. Brains compile when the data loads, so every error names its file and line. Loaded by the server only.
| Registry | manifold-ai:brain |
| Files | data/brains/*.ron, *.update.ron, *.final.ron |
| Sides | server: only the server loads it |
| Reads | manifold-ai:memory-kind, manifold-ai:curve, manifold-ai:awareness-profile, manifold-ai:lod-profile, manifold-ai:state-tree |
| Contract | Brains, data stage |
Entry
A record, written Brain(..); the name before the parentheses is optional.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The brain’s key, <mod-id>:<name>. | |
parent | string or None | no | none | The brain it inherits from. |
abstract | bool | no | false | true for a template that is only inherited. |
params | map of string to ParamValue | no | none | Typed parameters other fields use as "$name". |
senses | list of Sense | no | none | Its sensors. |
memories | list of string | no | none | The memory kinds it uses (manifold-ai:memory-kind keys). |
awareness | string or None | no | none | Its awareness profile (manifold-ai:awareness-profile key). |
lod | string or None | no | none | Its LOD profile (manifold-ai:lod-profile key). |
presentation_activities | list of string | no | none | The names animation graphs see for what it is doing, by index; the first is shown when nothing else is. |
invariants | list of Cond | no | none | Conditions every candidate behaviour or activity must pass. |
knowledge_cap | u8 | no | 8 | The most things it keeps track of, at most 16. |
trace | TraceMode | no | Off | Its decision trace. |
kind | BrainKind or None | no | none | Its decision maker. An abstract brain may leave it out. |
Example
From game/flagship-game/data/brains/creatures.ron:
Brain(
id: "flagship-game:template_predator",
abstract: true,
params: {
"sight_radius": Float(24.0),
"flee_health": Float(0.25),
},
senses: [
Sight(radius: "$sight_radius", lose_radius: Some(32.0),
cones: { Unaware: 55.0, Engaged: 100.0 },
interval_ticks: 10, targets: HostileTo),
Damage,
],
memories: ["manifold:last_hurt_by", "manifold:unreachable"],
awareness: Some("manifold:default_awareness"),
lod: Some("manifold:ambient_creature"),
)
Types
ParamValue
A typed brain parameter.
| Variant | Written | Description |
|---|---|---|
Float | Float(f32) | A number. |
Int | Int(i64) | An integer. |
Bool | Bool(bool) | true or false. |
Tag | Tag(string) | A tag key. |
Ability | Ability(string) | An ability key. |
Duration | Duration(f32) | Seconds. |
Sense
A sensor.
| Variant | Written | Description |
|---|---|---|
Sight | Sight(radius: .., lose_radius: .., lose_grace: .., cones: .., vertical_half_angle: .., interval_ticks: .., targets: .., gain_per_s: .., falloff: .., eye_height: .., uses_light: .., light: ..) | Sight, in cones that widen with awareness. |
Hearing | Hearing(sensitivity: .., gain: .., falloff: .., targets: .., calls: .., blur: ..) | Hearing: noises and calls, heard within loudness × sensitivity blocks without line of sight. A heard target rises at most to Alert; engaging needs a sense in the awareness profile’s engage_requires. A brain has at most one. |
Damage | Damage | Being hit. |
Owner | Owner(interval_ticks: ..) | The owner’s whereabouts. |
Items | Items(radius: .., interval_ticks: .., write: .., filter: .., owner_clearance: ..) | Dropped items nearby. |
Sight fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
radius | float-or-param | yes | How far it sees, in blocks. | |
lose_radius | float-or-param or None | no | radius | How far it keeps seeing something it already saw. |
lose_grace | u16 | no | 40 | Ticks after the last sighting that lose_radius applies. |
cones | map of AwarenessState to f32 | no | none | The cone’s half-angle in degrees per awareness state; a state without one uses the nearest lower state’s. |
vertical_half_angle | f32 | no | 70.0 | The vertical half-angle, in degrees. |
interval_ticks | u16 | no | 10 | Ticks between looks, 8 to 400. |
targets | TargetFilter | no | HostileTo | Whom it looks for. |
gain_per_s | f32 | no | 1.5 | The awareness meter gained per second at full strength. |
falloff | CurveSpec or None | no | none | How strength falls with distance. |
eye_height | f32 or None | no | the archetype’s | The eye height, overriding the archetype’s. |
uses_light | bool | no | false | Whether the light at the target’s eye scales the gain, so a target in darkness is noticed more slowly. |
light | CurveSpec or None | no | a quarter of the gain in darkness, three quarters at half light, all of it in full light | With uses_light, the gain’s factor by the light level (0 to 15) as a fraction. |
Hearing fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
sensitivity | f32 | no | 1.0 | Scales how far it hears; above 0. |
gain | f32 | no | 0.3 | The awareness meter one noise adds at its source, before the falloff, 0 to 1. |
falloff | CurveSpec or None | no | linear to 0 | How the gain falls with distance / range. |
targets | TargetFilter | no | HostileTo | Whose noise raises awareness. |
calls | list of string | no | ["call"] | The call tags it listens for, with their descendants. Only calls from allies (Friendly) are heard, and each gives second-hand knowledge of the caller’s target. |
blur | f32 | no | 0.15 | How far the heard position may be off on each horizontal axis, as a fraction of the distance. |
Owner fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
interval_ticks | u16 | no | 10 | Ticks between updates. |
Items fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
radius | float-or-param | yes | How far, in blocks. | |
interval_ticks | u16 | no | 10 | Ticks between looks. |
write | string | yes | The Entity memory the nearest accepted drop is written to. | |
filter | ItemFilter | no | All | Which drops it accepts. |
owner_clearance | f32 | no | 0 | Drops this close to the owner are ignored (already delivered). |
AwarenessState
An awareness state.
| Variant | Written | Description |
|---|---|---|
Unaware | Unaware | Has not noticed. |
Suspicious | Suspicious | Noticed something. |
Alert | Alert | Looking for it. |
Engaged | Engaged | Acting on it. |
TargetFilter
Whom a sight sensor looks for.
| Variant | Written | Description |
|---|---|---|
HostileTo | HostileTo | Entities its faction is hostile to. |
Players | Players | Players, whatever the relation. |
Relations | Relations([string]) | Entities in any of these relations: Relations(["Hostile", "Neutral"]). |
CurveSpec
A curve’s shape, over x in 0..1.
| Variant | Written | Description |
|---|---|---|
Linear | Linear(m: .., k: .., b: .., c: ..) | y = m · (x − c)^k + b. |
Polynomial | Polynomial(m: .., k: .., b: .., c: ..) | y = m · (x − c)^k + b, with a fractional k allowed. |
Logistic | Logistic(m: .., k: .., b: .., c: ..) | y = k / (1 + e^(−m · (x − c))) + b. |
Logit | Logit(m: .., k: .., b: .., c: ..) | y = ln(v / (1 − v)) / m + b with v = x − c, rescaled to 0..1. |
Normal | Normal(m: .., k: .., b: .., c: ..) | y = m · e^(−k · (x − c)²) + b: a bell. |
Sine | Sine(m: .., k: .., b: .., c: ..) | y = m · sin(k · π · (x − c)) + b. |
Step | Step(at: ..) | 0 below at, 1 at or above it. |
Piecewise | Piecewise([(f32, f32)]) | Straight lines between (x, y) points, flat outside them; x ascending. |
Inverse | Inverse(CurveSpec) | 1 − curve(x). |
Preset | Preset(string) | A manifold-ai:curve entry by key. |
Linear fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
m | f32 | yes | Slope. | |
k | f32 | yes | Exponent. | |
b | f32 | yes | Vertical shift. | |
c | f32 | yes | Horizontal shift. |
Polynomial fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
m | f32 | yes | Slope. | |
k | f32 | yes | Exponent. | |
b | f32 | yes | Vertical shift. | |
c | f32 | yes | Horizontal shift. |
Logistic fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
m | f32 | yes | Steepness. | |
k | f32 | yes | Height. | |
b | f32 | yes | Vertical shift. | |
c | f32 | yes | Midpoint. |
Logit fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
m | f32 | yes | Steepness. | |
k | f32 | yes | Unused; write 1.0. | |
b | f32 | yes | Vertical shift. | |
c | f32 | yes | Horizontal shift. |
Normal fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
m | f32 | yes | Height. | |
k | f32 | yes | Narrowness. | |
b | f32 | yes | Vertical shift. | |
c | f32 | yes | Centre. |
Sine fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
m | f32 | yes | Amplitude. | |
k | f32 | yes | Frequency. | |
b | f32 | yes | Vertical shift. | |
c | f32 | yes | Phase. |
Step fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
at | f32 | yes | The threshold. |
ItemFilter
Which dropped items the Items sensor accepts.
| Variant | Written | Description |
|---|---|---|
All | All | Every drop. |
Unreserved | Unreserved | Drops no one else has claimed. |
Cond
An AI condition, evaluated with the brain in context.
| Variant | Written | Description |
|---|---|---|
Always | Always | Always holds. |
Never | Never | Never holds. |
All | All([Cond]) | Every condition holds. |
Any | Any([Cond]) | At least one holds. |
Not | Not(Cond) | The condition does not hold. |
MemorySet | MemorySet(string) | The memory (manifold-ai:memory-kind key) is set. |
MemoryOlderThan | MemoryOlderThan(string, f32) | The memory was written more than this many seconds ago, or is unset: MemoryOlderThan("<memory>", 5.0). |
Distance | Distance(from: .., to: .., min: .., max: ..) | The distance between two subjects is within bounds. |
StatBelow | StatBelow(string, float-or-param) | The stat’s current fraction of its maximum is below the value: StatBelow("manifold:health", 0.25). |
HasTag | HasTag(string) | The agent has the tag, or a descendant. |
Aware | Aware(of: .., at_least: ..) | The agent’s awareness of a subject is at least a state. |
Perceived | Perceived(Subject) | The agent perceives the subject now. |
Reachable | Reachable(Subject) | Navigation can reach the subject. |
CandidateTagged | CandidateTagged(string) | The activity or behaviour being considered has the tag. |
InState | InState(string) | The agent’s state tree is in the named state. |
OwnerOnline | OwnerOnline | The agent’s owner is online. |
Distance fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
from | Subject | no | Self | From. |
to | Subject | yes | To. | |
min | float-or-param or None | no | no lower bound | At least this far, in blocks. |
max | float-or-param or None | no | no upper bound | At most this far, in blocks. |
Aware fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
of | Subject | no | Target | The subject. |
at_least | AwarenessState | yes | The least state. |
Subject
A subject an AI condition names.
| Variant | Written | Description |
|---|---|---|
Self | Self | The agent itself. |
Target | Target | The activity’s or behaviour’s target. |
Owner | Owner | The agent’s owner. |
Home | Home | The agent’s home. |
Memory | Memory(string) | A memory’s entity or position (manifold-ai:memory-kind key). |
Carried | Carried | The item the agent carries. |
TraceMode
A decision-trace mode.
| Variant | Written | Description |
|---|---|---|
Off | Off | No trace. |
FlightRecorder | FlightRecorder | A 64-record ring kept at all times. |
BrainKind
A brain’s decision maker.
| Variant | Written | Description |
|---|---|---|
Archetype | Archetype(evaluate_every: .., behaviours: ..) | A fixed priority list of built-in behaviours; behaviours with disjoint control flags run at once. |
Full | Full(keep_ratio: .., min_utility: .., select_interval: .., fallback: .., activities: .., impulses: ..) | Activities scored by utility, each running a state tree. |
Archetype fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
evaluate_every | u16 | no | 10 | Ticks between evaluations. |
behaviours | list of BehaviourEntry | yes | The behaviours. |
Full fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
keep_ratio | f32 | no | 0.75 | Keep the current activity while its score is at least this fraction of the best. |
min_utility | f32 | no | 0.01 | Scores below this never win. |
select_interval | u16 | no | 40 | Ticks between selections, 20 to 160. |
fallback | string or None | no | none | The activity run when none scores. |
activities | list of Activity | yes | The activities. | |
impulses | list of Impulse | no | none | Impulses at the brain level; each names the activity it injects. |
BehaviourEntry
One behaviour of an archetype brain.
A record: BehaviourEntry(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | Its name, the key children merge by. | |
priority | u8 | yes | Its priority, unique in the brain; 0 is highest. | |
controls | list of ControlFlag | no | none | The controls it takes. |
presents | string or None | no | none | The presentation activity while it runs. |
start | Cond or None | no | always | A condition to start. |
keep | Cond or None | no | always | A condition to keep running. |
requires | list of Requirement | no | none | Checks before it starts. |
interrupt_on | list of Event or None | no | new knowledge, a rising or falling state, damage and a lost target | Events that make the brain re-evaluate at once. |
tags | list of string | no | none | Activity tags (ai.activity.combat). |
behaviour | Behaviour | yes | The behaviour. |
ControlFlag
A control a behaviour takes.
| Variant | Written | Description |
|---|---|---|
Move | Move | Movement. |
Look | Look | Looking. |
Jump | Jump | Jumping. |
Target | Target | The target. |
Attack | Attack | Attacking. |
Voice | Voice | Sounds. |
Requirement
A check a behaviour makes before it starts.
| Variant | Written | Description |
|---|---|---|
Reachable | Reachable | Its target is reachable and not given up on. |
LineOfSight | LineOfSight | Its target is in line of sight. |
Event
A change event transitions and interrupts subscribe to.
| Variant | Written | Description |
|---|---|---|
Memory | Memory(string) | The memory (manifold-ai:memory-kind key) changed. |
NewKnowledge | NewKnowledge | The agent perceived something new. |
StateRose | StateRose | An awareness state rose. |
StateFell | StateFell | An awareness state fell. |
TargetLost | TargetLost | The target was lost. |
Damaged | Damaged | The agent took damage. |
CallHeard | CallHeard | The agent heard a call. |
OwnerStateChanged | OwnerStateChanged | The owner’s state changed. |
ActivityEnded | ActivityEnded | The activity ended. |
Signal | Signal | A signal from code. |
Behaviour
A built-in behaviour.
| Variant | Written | Description |
|---|---|---|
Wander | Wander(radius: .., around: .., pause: .., speed: ..) | Wanders about. |
Graze | Graze(duration: .., chance: .., cooldown: ..) | Stops to graze. |
LookAtNoticed | LookAtNoticed(min_state: .., max_distance: .., glance: ..) | Looks at what it noticed. |
ChargeAttack | ChargeAttack(ability: .., min_range: .., max_range: .., recovery: .., approach_speed: ..) | Closes in and uses a charge ability. |
FleeWhen | FleeWhen(when: .., distance: .., speed: ..) | Flees when a condition holds. |
ReturnHome | ReturnHome(leash: ..) | Returns home when it strays too far. |
Investigate | Investigate(min_state: .., radius: .., speed: .., look: ..) | Walks to where a noticed target was last known (a noise, a call, a target that slipped out of sight), re-aiming when a new noise moves it, then looks around there. A target engaged in plain sight is left to the combat behaviours. |
CallAllies | CallAllies(tag: .., radius: .., min_state: .., cooldown: ..) | Calls allies about its best target at or above min_state, then waits out a cooldown. |
Wander fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
radius | float-or-param | no | 8.0 | How far, in blocks. |
around | Around | no | Home | Around what. |
pause | (f32, f32) | no | (2.0, 6.0) | Seconds between moves, (min, max). |
speed | f32 | no | 0.5 | A fraction of walking speed. |
Graze fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
duration | (f32, f32) | yes | Seconds, (min, max). | |
chance | f32 | no | 0.5 | The chance to start when it may. |
cooldown | (f32, f32) | no | (4.0, 10.0) | Seconds before another graze, (min, max). |
LookAtNoticed fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
min_state | AwarenessState | no | Engaged | The least awareness state. |
max_distance | f32 | no | 32.0 | The farthest, in blocks. |
glance | (f32, f32) | no | (2.0, 4.0) | Seconds per glance, (min, max). |
ChargeAttack fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
ability | string | yes | The ability (manifold:ability key), or "$param". An unknown key fails the data stage (DATA010). | |
min_range | f32 | yes | The closest it charges from, in blocks. | |
max_range | f32 | yes | The farthest it charges from, in blocks. | |
recovery | f32 | yes | Seconds of recovery after each charge. | |
approach_speed | f32 | no | 1.0 | A fraction of sprint speed while closing in. |
FleeWhen fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
when | Cond | yes | The condition. | |
distance | f32 | yes | How far, in blocks. | |
speed | f32 | no | 1.0 | A fraction of sprint speed. |
ReturnHome fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
leash | f32 or None | no | the home’s radius | How far, in blocks. |
Investigate fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
min_state | AwarenessState | no | Alert | The least awareness state of the target, Suspicious or above. |
radius | f32 | no | 1.5 | Within this many blocks of the last-known position it counts as there. |
speed | f32 | no | 1.0 | A fraction of walking speed. |
look | (f32, f32) | no | (2.0, 4.0) | Seconds it looks around once there, (min, max). |
CallAllies fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
tag | string | no | "call.help" | The call’s tag. Allies hear it when their Hearing sensor’s calls list the tag or an ancestor. |
radius | f32 | yes | Allies within this many blocks hear it, 1 to 255. | |
min_state | AwarenessState | no | Engaged | The least awareness state of the target it calls about. |
cooldown | f32 | no | 8.0 | Seconds before it calls again. |
Around
Where wandering centres.
| Variant | Written | Description |
|---|---|---|
Home | Home | The agent’s home, else where it first stood. |
Self | Self | Where the agent is. |
Owner | Owner | The agent’s owner. |
Activity
An activity of a full brain.
A record: Activity(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | Its key, the key children merge by. | |
tree | string | yes | The state tree it runs (manifold-ai:state-tree key). | |
entry_state | string or None | no | the tree’s root | The state it starts in. |
rank | Rank | no | Fixed(1) | Its rank: a higher rank always wins over a lower one. |
weight | f32 | no | 1.0 | Its score’s weight within its rank. |
targets | Targets | no | None | Where its candidate targets come from. |
requires_reachable | bool | no | false | Whether a target must be reachable. |
invariants | list of Cond | no | none | Conditions it must pass. |
considerations | list of Consideration | no | none | Its considerations; its score is their compensated product, times weight. |
commit | Commit | no | a 1.25 bonus for 80 ticks | How much it resists switching away. |
on_retarget | Retarget | no | Reenter | What a new target does. |
tags | list of string | no | none | Activity tags (ai.activity.follow). |
presents | string or None | no | none | The presentation activity while it runs. |
impulses | list of Impulse | no | none | Impulses that inject this activity outside the regular selection, such as fleeing the moment it is hurt. |
Rank
An activity’s rank.
| Variant | Written | Description |
|---|---|---|
Fixed | Fixed(u8) | A fixed rank. |
Dynamic | Dynamic(cases: .., default: ..) | The first case whose condition holds, else default. |
Dynamic fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
cases | list of (Cond, u8) | yes | (condition, rank) pairs. | |
default | u8 | yes | The rank when no case holds. |
Targets
Where an activity’s candidate targets come from.
| Variant | Written | Description |
|---|---|---|
None | None | No target. |
Owner | Owner | The agent’s owner. |
Knowledge | Knowledge(filter: .., min_state: .., max: ..) | Things the agent perceived. |
Memory | Memory(string) | A memory’s entity. |
Knowledge fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
filter | TargetFilter | no | HostileTo | Whom. |
min_state | AwarenessState | no | Alert | The least awareness state. |
max | u8 | no | 4 | The most candidates scored. |
Consideration
A utility consideration: an input, normalised by (v − min) / (max − min) and clamped, through a curve.
A record: Consideration(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
input | Input | yes | What it measures. | |
min | f32 | no | 0 | The input that scores 0 before the curve. |
max | f32 | no | 1 | The input that scores 1 before the curve. |
curve | CurveSpec | no | Preset("manifold:linear") | The curve. |
Input
A consideration’s input. The target’s own stats and tags are read only while it is perceived now or known outright (the owner, a memory’s entity); a remembered target out of sight reads 0.
| Variant | Written | Description |
|---|---|---|
TargetDistance | TargetDistance | Blocks to the target. |
OwnerDistance | OwnerDistance | Blocks to the owner. |
HomeDistance | HomeDistance | Blocks to home. |
Reachable | Reachable | 1 when navigation can reach the target, else 0. |
LineOfSight | LineOfSight | 1 when the agent perceives the target now, else 0. It reads what the agent already knows and never casts a new sight ray. |
TargetAwareness | TargetAwareness | The awareness state of the target, 0 to 3. |
TargetConfidence | TargetConfidence | The confidence in the target’s position, 0 to 1. |
TargetRelation | TargetRelation | The agent’s relation to the target when last sensed: Friendly 0, Neutral 0.5, Hostile 1. |
GroupKnows | GroupKnows | Not available yet (Talos D6, group knowledge): refused at load. |
SelfStatRatio | SelfStatRatio(string) | The agent’s stat (manifold:stat key) as a fraction of its maximum. |
SelfStat | SelfStat(string) | The agent’s stat’s current value. |
SelfHasTag | SelfHasTag(string) | 1 when the agent has the tag or a descendant, else 0. |
TargetStatRatio | TargetStatRatio(string) | The target’s stat as a fraction of its maximum. |
TargetHasTag | TargetHasTag(string) | 1 when the target has the tag or a descendant, else 0. |
CooldownReady | CooldownReady(string) | 1 when the ability (manifold:ability key, or "$param") is granted to the agent, idle and off cooldown, else 0. |
MemoryAge | MemoryAge(string) | Seconds since the memory was written (large when unset). |
MemorySet | MemorySet(string) | 1 when the memory is set, else 0. |
TimeOfDay | TimeOfDay | The world’s time of day, 0 to 1. |
TimeInActivity | TimeInActivity | Seconds in the current activity. |
BondStrength | BondStrength(string) | Not available yet (Talos D7, relationship memories): refused at load. |
Threat | Threat | Not available yet (Talos D6, threat tables): refused at load. |
TokenAvailable | TokenAvailable(string) | Not available yet (Talos D6, coordination tokens): refused at load. |
AdScore | AdScore | Not available yet (Talos D6, smart objects): refused at load. |
Constant | Constant(f32) | A constant. |
Custom | Custom(string) | Not available yet (Talos D5, a mod’s consideration-input hook): refused at load. |
Commit
How much an activity resists switching away.
A record: Commit(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
bonus | f32 | no | 1.25 | The score multiplier while committed. |
min_ticks | u32 | no | 80 | Ticks the bonus lasts. |
Retarget
What a new target does to a running activity.
| Variant | Written | Description |
|---|---|---|
Reenter | Reenter | Restarts the activity. |
Rebind | Rebind | Keeps running with the new target. |
Impulse
An impulse: when its trigger fires and when holds, selection runs at the agent’s next step with the activity’s candidates raised to rank. A brain has at most 32: impulses: [(on: Damaged, when: Some(StatBelow("manifold:health", 0.2)), rank: 8)].
A record: Impulse(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
on | ImpulseTrigger | yes | What fires it. | |
when | Cond or None | no | none | A condition that must also hold. |
within | f32 or None | no | as far as the agent hears | For a Stimulus trigger only: stimuli within this many blocks. |
activity | string or None | no | the activity it belongs to | The activity it injects: required on a brain-level impulse; on an activity’s, that activity. |
rank | u8 | yes | The rank its activity’s candidates are raised to. |
ImpulseTrigger
What fires an impulse.
| Variant | Written | Description |
|---|---|---|
Damaged | Damaged | The agent was damaged since its last step. |
Event | Event([Event]) | Any of these change events. |
Stimulus | Stimulus(string) | A heard stimulus with this tag or a descendant (noise.footstep). The brain needs a Hearing sensor, and declares at most 7 distinct stimulus triggers (tag and within). |
Value forms used here: float-or-param.