Home Combat Raycast & Attack FX

Combat raycast & attack FX

Authoritative attack footprints drawn on the gfx map. Designer notes: docs/combat-fx.md. Related: 36 complete combat system.

Behavior

Every resolved attack (and truncated LoS beams) emits one or more CombatFx records from the same geometry used to validate hits. AOI carries combat_fx on snapshots / tick deltas. Gfx draws them for 18 sim ticks (0.6 s at 30 Hz) with a damage-type tint.

DoT tick damage does not emit map FX.

Kinds

Kind Source effect_shape Drawn as
melee_arc melee_arc Wedge from caster yaw
cone cone Wider wedge / cone
sphere sphere Circle at caster or target (aoe_origin)
beam beam Line caster → terminus (or LoS block)
hit_marker embedded in hits[] Feet ring (~0.4× cell) + X on struck entity

Hit feedback

For each entry in hits[] (and standalone hit_marker):

  1. Small ring at the victim’s feet
  2. X / cross flash

Both use the parent FX damage-type tint. No full-entity red wash.

Damage-type tint

damage_type Color hint
fire orange-red
frost / cold cyan
poison green
pierce yellow
slash / blunt / physical warm orange
other / empty pale gold

Wire model

CombatFx {
  id, kind, ability_id, caster_id,
  origin [x,y,z],
  end?, yaw?, reach_m?, arc_deg?, radius_m?,
  hits[], until_tick, damage_type
}

Emit path: ability resolve in region_combat after geometry validate. Beams walk LoS samples and set end to the hit or occlusion point. Failed casts that die on LoS may still emit a stub beam to the block cell.

Code

  • Protocol: CombatFx on Snapshot / TickDelta
  • Sim: crates/sim/src/region_combat.rs, los.rs, abilities::EffectShape
  • Gfx: world overlay in crates/gfx map pass (under HUD, over terrain)

Out of scope (later)

  • Client-only VFX not backed by sim
  • Homing projectiles with mid-flight collision every tick
  • Ground-target click AoE placement UX