pub struct WaveLane {
pub waypoints: Vec<AnchorId>,
pub aggro_radius: u32,
}Expand description
Tower-defense lane routing for a wave (spec-0016 §6), built on vanilla’s
Raider patrol system — the intended primitive, live-verified on 1.21.11
(docs/notes/td-routing-spike.md).
The squad spawns Patrolling:1b with one PatrolLeader:1b and a snake_case
patrol_target int-array; a compiler-emitted clock walks the shared waypoint
index forward, and per mob a player-proximity check releases Patrolling:0b.
From that instant the mob is a plain native hostile. “Combat preempts
routing” is engine semantics — vanilla’s patrol goal is hard-gated on having
no target — so the owner’s rule (march while distant, fight with NATIVE AI
once aggroed, never brush past) falls out of the primitive unforced.
Lanes are raider-family only (DW0382), squad ≥ 2 (DW0383), and a lane
pillager must keep its crossbow (DW0384).
Fields§
§waypoints: Vec<AnchorId>The lane polyline, in march order: anchors some area’s prefab provides.
At least one; consecutive legs (counting the wave anchor as the origin)
must be more than 10 blocks apart — vanilla re-rolls a patrol target
within 10 blocks of arrival, so a tighter lane is a lane the engine
quietly stops following (DW0386).
aggro_radius: u32The release radius, in blocks: the compiler sets every lane mob’s
follow_range attribute to exactly this and releases Patrolling:0b
at the same distance. The two MUST be equal — a patrolling raider that
targets a player it cannot engage holds ground instead of marching, so a
per-mob attributes.follow_range that disagrees is DW0381.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WaveLane
impl<'de> Deserialize<'de> for WaveLane
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for WaveLane
impl JsonSchema for WaveLane
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more