Skip to content

Web v2 — capsule spider trails + new web look

Web v2 — capsule spider trails + new web look

Section titled “Web v2 — capsule spider trails + new web look”

BUILD 242 ATV telemetry (session ea95b29da82d728b, samples with < 60 enemies, bucketed by web count): 0 webs 58.4 fps / 17.1 ms; 100-200 → 50.3 / 20.4; 200-300 → 38.5 / 29.3; 300+ → 41.4 / 25.8. sim_ms +<1 ms and render_cpu_ms flat (~0.7) ⇒ GPU fill cost of the web layer, ~+12 ms at 250 webs with ~10 enemies.

Cause: the passive spider trail (ElementalSystem.drop_webs) still lays radius-38 circle webs every WEB_SPACING 34 px, so a trail shades each pixel ~2.5x, and each circle runs on a square quad. Toby’s capsule webs (2026-09-30) only cover the Elite Spider landing.

  • In drop_webs, when a spider is NOT within WEB_SPACING of any web (unchanged test), it first looks (same coarse grid) for an extendable trail capsule: a web flagged "trail": true, half_len < TRAIL_MAX_HALF_LEN (≈ 85 px, i.e. ≤ ~170 px long), one of whose ends is within TRAIL_JOIN_DIST (≈ 1.5 × WEB_SPACING) of the spider, and where the new point is roughly in line (the turn angle between the capsule dir and end→spider is ≤ TRAIL_MAX_TURN ≈ 30°; a circle trail web, half_len 0, accepts any direction and takes it). If found, the capsule is stretched so that end reaches the spider (recompute pos, dir, half_len; the far end stays fixed) and its remaining resets to WEB_DURATION (web never disappears earlier than today; the far end may live up to ~2 s longer). Otherwise a new circle trail web is added (as today, plus "trail": true).
  • Deterministic: candidate search order must be deterministic (lowest sequence number wins ties — or nearest end, ties by sequence), no new RNG draws.
  • Slow strength (Chris’s call, 2026-10-01: keep today’s feel). On a circle trail the player usually stands in ~2 overlapping webs (WEB_SLOW_PER^2 = 0.36). A web dict gains an optional "slow_w" weight (default 1); a trail capsule with half_len > 0 counts as 2 in web_slow_mult (pow(WEB_SLOW_PER, sum_of_weights), still floored at WEB_SLOW_MIN). Elite capsules and lone circles stay weight 1. Make the trail weight a tunable/const.
  • Grid filing: an extended capsule must be re-filed (its AABB grew) so later spiders in the same call see it; keep the evicted bookkeeping correct.
  • Expect the seed-1234 determinism baselines to move if spiders appear in them → re-pin via skill bh-determinism-repin with a written justification. Pure-render work must not move them.
  • Tests: trail of a spider walking a straight line produces 1-2 capsules instead of ~5 circles per 170 px; turning > 30° starts a new web; max length respected; remaining refreshed; slow mult on a trail capsule == 0.36 (two-web equivalent); Elite capsules unaffected; web count for a scripted 60 s spider swarm drops ≥ 2x vs. the old algorithm.
  • New runtime switch VisualLook.web_look (int/enum): v1 (today’s render/web_field.gdshader, unchanged), A, B, C. A Debug Settings cycle row “Web Look” AND a matching Remote Console dev command (Debug Settings ↔ console parity rule). Switchable live mid-run. Default stays v1 until Chris picks.
  • Each candidate is a canvas_item shader on the SAME MultiMesh web layer (ZoneRenderer web layer, same INSTANCE_CUSTOM layout: radius, fade, grown half_len, + one free channel — may carry a per-web seed/age), one draw call, shared material per look.
    • A — Dewy silk: real spider-web structure: radial spokes from the capsule’s anchor points, spiral / catenary cross threads, dew drops that glint in sequence (hot > 1.0 so the existing HDR bloom picks them up). Faint pale silk.
    • B — Venom pulse: sickly violet-green strands with light pulses running along them; a web the player is standing in ripples/brightens (player position uniform, set once per frame — readable slow).
    • C — Snare lattice: taut neon hex mesh, crackling edge that flickers brighter as the web nears expiry (uses fade).
  • Perf rules (all candidates): no fbm / texture noise (hash only); compute the capsule distance first and discard / early-out outside it before any pattern maths; interior near-transparent so enemies stay readable; quad tight to the capsule (existing _web_transform). Must be ≤ v1’s cost per web in tools/perf_probe/look_bench (or justify) at 400 overlapping webs on the Mac.
  • Fade in/out using the existing fade channel; capsule growth as today.
  • VFX library: an entry + 0-5 score per look in tools/vfx_library/library_manifest.gd (pinned by tests/test_vfx_library_manifest.gd). Shader prewarm/baker coverage for the new shaders (see render/ prewarm families) so first use doesn’t stall.
  • Capture: an isolated harness PNG (v1 | A | B | C, real HDR/glow WorldEnvironment from main.gd) with circle webs, a capsule trail, and an Elite landing (pad + 3 corridors), over the real background.
  • Shader compile check windowed under --rendering-method mobile AND gl_compatibility.

The dev build keeps the Perf tab webs arm (render-only hide toggle, ABBA). Chris runs arm webs, webs=250 on the ATV. If capsules + the chosen look still cost > ~3 ms, the next step is a half-res web layer behind its own toggle (not in this spec).

Half-res layer; changing WEB_CAP/WEB_DURATION; Elite Spider landing geometry.