Part of the
combat-basics skill. The skill links here when your agent needs the detail.Homing
Steer the direction toward the nearest target each frame. Turn rate keeps it from being unavoidable.get_tree().get_nodes_in_group("enemies") and keep the min distance_to. For
hundreds of enemies, cache the list and refresh every few frames, not per bullet.
Piercing
Do not free on first hit; count hits and track who was already hit.Area of effect (explosion)
Spawn an Area with a large CollisionShape for one frame, damage everything overlapping, then free. Scale damage by distance for a shockwave feel.Timer.timeout to
bodies currently inside it, for a lifetime, then frees.
Object pooling (many projectiles)
Instancing and freeing hundreds of bullets per second stutters. Reuse a fixed pool.set_process(false)) instead of freeing; the pool recycles the
oldest. This is how survivors-style games sustain thousands of projectiles.
Traps
- Homing with no turn cap = undodgeable and unfun. Cap
turn_rate. - Pooled bullets that
queue_free()defeat the pool - hide and disable instead. - AoE that reads overlaps in
_processre-damages every frame; do it once. - Distance-scaled damage with no floor (
maxf(t, 0.2)) makes edges deal 0.
Source:
library/skills/combat-basics/references/projectiles-and-aoe.md, rendered from summer-engine@4.3.0 on npm.
