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.
| Registry | manifold-ai:threat-profile |
| Files | data/threat_profiles/*.ron, *.update.ron, *.final.ron |
| Sides | server: only the server loads it |
| Reads | nothing |
| Contract | Population, data stage |
Entry
A record, written ThreatProfile(..); the name before the parentheses is optional.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The profile’s key, <mod-id>:<name>. | |
max_entries | u8 | no | 12 | The most entries the table holds, 1 to 16. |
aggro_radius | f32 | no | 12.0 | An idle creature adds initial_threat for each hostile it perceives within this many blocks: the pull. |
initial_threat | i64 | no | 1000 | The milli-threat a pull adds. |
heal_factor | f32 | no | 0.5 | The share of a heal credited to the healer, 0 to 4, split across every table that holds the healed entity. |
block_threat | i64 | no | 400 | The milli-threat a blocked or parried hit credits the defender. |
positional | Positional | no | a 90° arc, 3 blocks, 250 a second | Threat for what stands in front of the creature while it attacks. |
decay | ThreatDecay | no | 2 % a second after 8 s without an event | How quiet entries decay. |
switch | ThreatSwitch | no | above 110 % within 4 blocks, above 130 % beyond | When the creature switches targets. |
leash | ThreatLeash | no | 48 blocks from home; unreachable entries dropped after 6 s | How far it follows, and how long it chases what it cannot reach. |
evade | Evade | no | 1.5 × speed, manifold:state.invulnerable, healing on | The 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 (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
front_arc_deg | f32 | no | 90.0 | The arc, in degrees, 0 to 360. |
radius | f32 | no | 3.0 | Within this many blocks. |
rate_per_sec | i64 | no | 250 | Milli-threat per second. |
ThreatDecay
How threat decays.
A record: ThreatDecay(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
per_sec_fraction | f32 | no | 0.02 | The fraction of an entry lost per second of decay, 0 to 1. |
after_secs_without_event | f32 | no | 8.0 | Seconds without an event before an entry decays. |
ThreatSwitch
When a creature switches targets.
A record: ThreatSwitch(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
melee_ratio | f32 | no | 1.10 | A candidate within melee_range must exceed the current target by this ratio, at least 1. |
ranged_ratio | f32 | no | 1.30 | The same beyond melee_range, at least 1. |
melee_range | f32 | no | 4.0 | In blocks. |
ThreatLeash
How far a creature follows: beyond the leash, or with an empty table, it evades home.
A record: ThreatLeash(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
radius | u16 | no | 48 | It evades beyond this many blocks of its home. |
max_secs_unreachable | f32 | no | 6.0 | An 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 (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
return_speed_mult | f32 | no | 1.5 | Its speed multiplier on the way back. |
immune_tag | string | no | "manifold:state.invulnerable" | The tag (manifold:tag key) granted while it evades. An unknown key fails the data stage (DATA010). |
heal_on_return | bool | no | true | Whether it heals when it arrives. |