data/locomotion/
A locomotion profile: how a creature moves and how pathfinding plans for it. It names a locomotion class (whose navigation data the paths use), the body size, speeds, step, jump and drop limits, the turn rate, and extra costs per kind of terrain or surface block, so a boar avoids water and never walks through fire. An archetype’s manifold-nav:locomotion component names its profile. A body larger than its class fails to load; a profile stricter than its class loads with a warning, because its reachability answers become searches. The blocks surface_malus names must exist (DATA010). Loaded by the server only.
| Registry | manifold-nav:locomotion |
| Files | data/locomotion/*.ron, *.update.ron, *.final.ron |
| Sides | server: only the server loads it |
| Reads | nothing |
| Contract | Navigation, data stage |
Entry
A record, written LocomotionProfile(..); the name before the parentheses is optional.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The profile’s key, <mod-id>:<name>. | |
class | string | yes | The locomotion class: manifold:walker_small (under 1 × 1 blocks), manifold:walker (1 × 2), manifold:walker_large (2 × 3, no gap jumps or climbing), manifold:swimmer (1 × 1, only in water) or manifold:flyer (1 × 2, in free air). | |
body | BodySize | yes | The body, which must fit the class. | |
speed | Speeds | yes | Speeds, m/s. | |
step | f32 | no | 0.5 | How high it steps up without jumping, in metres. |
jump | f32 | no | 1.1 | The jump’s apex, in metres; the jump speed follows. |
max_drop | u8 | no | 3 | How many blocks a planned drop may fall. |
gap_jump | GapJump | no | Auto | How wide a gap it jumps. |
turn_rate_deg_per_s | f32 | no | 360.0 | The fastest it turns, degrees per second. Abilities may only turn it slower. |
arrive_radius | f32 | no | 1.0 | Within this many metres of its goal it slows to a stop. |
strafe | bool | no | false | true for a biped that moves in any direction; false for a quadruped that moves the way it faces. |
can_swim | bool | no | true | Whether it may swim. The swimmer class needs it. |
can_fly | bool | no | false | Whether it flies: true exactly when the class is manifold:flyer. A flyer cruises at speed.walk (sprint when sprinting). |
can_climb | bool | no | false | Whether it climbs ladders and other climbable blocks. It needs a climbing class (manifold:walker_small or manifold:walker) and a positive speed.climb. |
can_open_doors | bool | no | false | Whether it opens closed doors, fence gates and trapdoors on its path. Without it, a closed door is impassable. |
dig | DigProfile or None | no | none | Digging through blocks (a later phase): a profile with it makes an unreachable answer a search instead. |
malus | map of PathType to malus | no | none | Extra path cost per path type, or Impassable. A cost on a hazard its class avoids (DamageFire) makes it passable. |
drop_malus | DropMalus | no | 3 blocks free, then 12 per block | The cost of planned drops. |
surface_malus | list of SurfaceMalus | no | none | Extra costs for cells by the block underfoot: a standing cell takes its support’s block, a water cell its fluid’s. |
search | SearchSettings | no | a follow range of 32 blocks | Path search limits. |
avoidance | Avoidance | no | Separation | How it keeps apart from others. |
flock | FlockWeights | no | separation 1, alignment 0.3, cohesion 0.2 within 4 metres | The flocking weights, used with avoidance: Flock. |
knockback | KnockbackSettings | no | 8 ticks | What knockback does to its movement. |
Example
From tools/test-mods/guide-creature/data/locomotion/razorback.ron:
LocomotionProfile(
id: "guide-creature:razorback",
class: "manifold:walker_small",
body: (width: 0.9, height: 0.9),
speed: (walk: 3.0, sprint: 6.5, swim: 1.2),
turn_rate_deg_per_s: 600.0,
malus: {
Water: 12,
DangerFire: 8,
},
)
Types
BodySize
A body’s size, in metres.
A record: BodySize(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
width | f32 | yes | The width. | |
height | f32 | yes | The height. |
Speeds
Speeds, m/s.
A record: Speeds(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
walk | f32 | yes | Walking, above 0. | |
sprint | f32 | no | 0 | Sprinting. |
swim | f32 | no | 0 | Swimming. |
climb | f32 | no | 0 | Climbing, above 0 with can_climb. |
GapJump
How wide a gap a profile jumps.
| Variant | Written | Description |
|---|---|---|
Auto | Auto | From the walk speed and jump: floor(walk · 2v / g − 0.5) blocks. |
Blocks | Blocks(u8) | This many blocks. |
DigProfile
Digging through blocks.
A record: DigProfile(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
hardness_limit | f32 | yes | The hardest block it digs. | |
seconds_per_hardness | f32 | yes | Seconds per point of hardness. |
PathType
A kind of cell, as pathfinding classifies it for a body.
| Variant | Written | Description |
|---|---|---|
Blocked | Blocked | The body does not fit. |
Open | Open | It fits, but nothing supports it. |
Walkable | Walkable | It fits and is supported. |
WaterShallow | WaterShallow | Walkable, with shallow fluid. |
Water | Water | The body would swim. |
HazardFluid | HazardFluid | A fluid that cannot be swum, or that hurts. |
DangerFire | DangerFire | Next to fire. |
DamageFire | DamageFire | In fire. |
DangerOther | DangerOther | Next to another hazard. |
DamageOther | DamageOther | In another hazard. |
DoorClosed | DoorClosed | A closed door. |
DoorOpen | DoorOpen | An open door. |
Climbable | Climbable | Climbable, without support: only climbing profiles enter it. |
Slow | Slow | Slow ground. |
Unloaded | Unloaded | Not loaded; never stored, so a malus here does nothing. |
DropMalus
The cost of planned drops.
A record: DropMalus(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
free_blocks | u8 | yes | Blocks a drop may fall at no extra cost. | |
per_block | u16 | yes | The cost per block beyond them. |
SurfaceMalus
An extra cost for cells over one kind of block.
A record: SurfaceMalus(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
mask | string | yes | The block (<mod-id>:<name>), until block masks replace block names. An unknown block fails the data stage (DATA010). | |
cost | i16 | yes | The extra cost of entering such a cell; negative to prefer it (a road). Every step still costs at least 4. |
SearchSettings
Path search limits.
A record: SearchSettings(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
follow_range | u16 | yes | The farthest it plans to follow a target, in blocks. | |
max_nodes | u32 or None | no | follow_range × 16 | The most nodes one search expands, 16 to 4096. |
Avoidance
How an agent keeps apart from others. Every agent separates; the others add to it.
| Variant | Written | Description |
|---|---|---|
Separation | Separation | Pushes away from neighbours. |
Orca | Orca | Velocity obstacles (ORCA) in a dense fight: at full AI detail, within 16 blocks of a player, with at least 4 others within 3 blocks. Separation otherwise. |
Flock | Flock | Separation, alignment and cohesion with agents of the same profile (pets following an owner, herds, birds), weighted by flock. |
FlockWeights
Flocking weights, each a share of the agent’s speed.
A record: FlockWeights(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
separation | f32 | no | 1.0 | Push away from neighbours. |
alignment | f32 | no | 0.3 | Match the flockmates’ mean velocity. |
cohesion | f32 | no | 0.2 | Steer toward the flockmates’ centre. |
radius | f32 | no | 4.0 | Flockmates within this many metres count. |
KnockbackSettings
What knockback does to movement.
A record: KnockbackSettings(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
lock_ticks | u16 | yes | Ticks without steering after a knock. |
Value forms used here: malus.