Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

data/threat_profiles/

A threat profile: how a creature that can be tanked keeps its hate list, an MMO threat table whose top entry becomes its target. Damage, heals, blocks and E’s threat effect parts add threat; the creature switches targets only when another entry beats the current one by a margin, and evades home when pulled too far. An archetype opts in with the manifold-ai:threat-table component, (profile: "<key>"). Amounts are milli-threat. Loaded by the server only.

Registrymanifold-ai:threat-profile
Filesdata/threat_profiles/*.ron, *.update.ron, *.final.ron
Sidesserver: only the server loads it
Readsnothing
ContractPopulation, data stage

Entry

A record, written ThreatProfile(..); the name before the parentheses is optional.

FieldTypeRequiredDefaultDescription
idstringyesThe profile’s key, <mod-id>:<name>.
max_entriesu8no12The most entries the table holds, 1 to 16.
aggro_radiusf32no12.0An idle creature adds initial_threat for each hostile it perceives within this many blocks: the pull.
initial_threati64no1000The milli-threat a pull adds.
heal_factorf32no0.5The share of a heal credited to the healer, 0 to 4, split across every table that holds the healed entity.
block_threati64no400The milli-threat a blocked or parried hit credits the defender.
positionalPositionalnoa 90° arc, 3 blocks, 250 a secondThreat for what stands in front of the creature while it attacks.
decayThreatDecayno2 % a second after 8 s without an eventHow quiet entries decay.
switchThreatSwitchnoabove 110 % within 4 blocks, above 130 % beyondWhen the creature switches targets.
leashThreatLeashno48 blocks from home; unreachable entries dropped after 6 sHow far it follows, and how long it chases what it cannot reach.
evadeEvadeno1.5 × speed, manifold:state.invulnerable, healing onThe return home. arrival.

Example

No bundled file declares one yet. From the reference’s test fixture, crates/manifold-server-state/tests/data-reference-fixture/data/threat_profiles/standard.ron, which the data stage loads in its tests:

ThreatProfile(id: "dataref-fixture:threat/standard")

Types

Positional

Positional threat: entities in the creature’s front arc gain threat while it attacks.

A record: Positional(..) or (..).

FieldTypeRequiredDefaultDescription
front_arc_degf32no90.0The arc, in degrees, 0 to 360.
radiusf32no3.0Within this many blocks.
rate_per_seci64no250Milli-threat per second.

ThreatDecay

How threat decays.

A record: ThreatDecay(..) or (..).

FieldTypeRequiredDefaultDescription
per_sec_fractionf32no0.02The fraction of an entry lost per second of decay, 0 to 1.
after_secs_without_eventf32no8.0Seconds without an event before an entry decays.

ThreatSwitch

When a creature switches targets.

A record: ThreatSwitch(..) or (..).

FieldTypeRequiredDefaultDescription
melee_ratiof32no1.10A candidate within melee_range must exceed the current target by this ratio, at least 1.
ranged_ratiof32no1.30The same beyond melee_range, at least 1.
melee_rangef32no4.0In blocks.

ThreatLeash

How far a creature follows: beyond the leash, or with an empty table, it evades home.

A record: ThreatLeash(..) or (..).

FieldTypeRequiredDefaultDescription
radiusu16no48It evades beyond this many blocks of its home.
max_secs_unreachablef32no6.0An entry navigation cannot reach for this many seconds is dropped.

Evade

The return home: the table clears and new threat is ignored until the creature arrives.

A record: Evade(..) or (..).

FieldTypeRequiredDefaultDescription
return_speed_multf32no1.5Its speed multiplier on the way back.
immune_tagstringno"manifold:state.invulnerable"The tag (manifold:tag key) granted while it evades. An unknown key fails the data stage (DATA010).
heal_on_returnboolnotrueWhether it heals when it arrives.