A7: Visual effects, hit marker and hurt flash

EffectsView (src/client/effects/) draws muzzle flashes at the held
weapon's muzzle, tracer ribbons to each pellet's impact (and streaks
behind projectiles in flight), hit bursts on players, chips and dust by
material or ground, keg blasts with fireball, debris, smoke and a light,
build dust, collapse clouds for broken pieces, splashes and surge spray.

Particles are simulated on the CPU in packed arrays and drawn by two
MultiMeshes (blended and added) through a small billboard shader that
reads each particle's size from custom data (the stock billboard modes
drop the instance scale) and converts Palette's sRGB colours. Pools are
allocated once at the preset's budget (256/512/1024 particles, 64
tracers, 4 lights): three draw calls whatever happens.

The HUD gains a reticle, four ticks round it when your shot strikes a
player (HitFeedback), and a rust flash at the screen's edge when hurt.

Tests: test_effects_view (12), including a 24-shooter stress scene that
stays inside each budget and never adds nodes. Captures: make
effects-captures (fight, blast, work, stress), checked by eye, and the
blast in the Compatibility renderer.

Closes #47

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 11:45:19 -05:00
co-authored by Claude Opus 5.5
parent 8af068c625
commit e8414fde9a
22 changed files with 1506 additions and 12 deletions
+6
View File
@@ -484,6 +484,12 @@ weights from the island's elevation bands, with rock on steep ground.
sea, points of interest, props, built pieces and `EntityView`, which draws players, the
barge, items and chests. All of it reads one `Simulation` and never writes to it, and a
new match gets a new view. The camera sits on a player's shoulder through `CameraRig`.
`EffectsView` (`src/client/effects/`, A7) draws the match's visual effects from the
server's FX records and from changes it sees in the world (pieces gone, players in the
water, surges). Its particles are simulated on the CPU in packed arrays and drawn by
two MultiMeshes (blended and added) of camera-facing quads, sized per instance by a
small shader, with tracers as a third; everything is allocated once at the preset's
budget, so a big fight costs a fixed three draw calls and never adds nodes or grows buffers.
The figures, barge and items are stand-in shapes for the art pass to replace.
In play, the simulation it reads is the client's own copy of the world: the
+8 -5
View File
@@ -132,11 +132,14 @@ you set it). Delete that file to go back to the defaults.
Settings → Graphics → Quality.
| Preset | Sun shadows | Shadow cascades | 3D resolution | Anti-aliasing |
|---|---|---|---|---|
| Low | Off | n/a | 75% of the window | FXAA |
| Medium | Up to 200 m | 2 | 100% | FXAA |
| High (default) | Up to 400 m | 4 | 100% | MSAA 2x |
| Preset | Sun shadows | Shadow cascades | 3D resolution | Anti-aliasing | Effect particles |
|---|---|---|---|---|---|
| Low | Off | n/a | 75% of the window | FXAA | 256 at once |
| Medium | Up to 200 m | 2 | 100% | FXAA | 512 |
| High (default) | Up to 400 m | 4 | 100% | MSAA 2x | 1,024 |
The particle budget only limits how much smoke, dust and spray a big fight shows at
once. Muzzle flashes, tracers, hit flashes and the hit marker are there on every preset.
No preset changes how far trees, rocks, wrecks or built pieces are drawn. A lower
preset never lets anyone see a player through cover that a higher one would still
+22
View File
@@ -190,6 +190,28 @@ collision box, give or take a few centimetres of lap or trim.
- Layout is Tidewall's own. The tide gauge sits top centre, because the tide is the
clock.
## Effects (A7)
Effects are painted, not photographic: round soft spots of flat Palette colour and thin
gilt streaks, so they sit with the woodcut print pass rather than fight it.
- **Muzzle flash:** a small `LAMP` core with `OILSKIN` petals along the aim and a wisp
of `STONE` smoke that drifts off the line, so the shooter's own view stays clear.
- **Tracers:** a short `GILT` streak running from the muzzle to where each pellet
landed; projectiles in flight trail `OILSKIN`.
- **Hits on a player:** a `LAMP` flash, a ring of `SALT` puffs and `OILSKIN` sparks.
No blood: folk are knocked about, not wounded on screen. The shooter also gets four
paper ticks round the reticle (a shape, not only a colour).
- **Hits on things:** chips and dust in the material's colour (driftwood, dressed stone,
salvage iron with gilt sparks; bark for trees; the ground's own colour; foam on water).
- **Building and collapse:** a ring of dust where a piece is set down; a piece that
breaks comes apart in a cloud of its material's dust and falling chips.
- **Powder keg:** a `LAMP` flash, an `OCHRE_RED` to `OILSKIN` fireball, `TAR` debris and
a column of weathered smoke, with a light that lights the ground for a moment.
- **Water:** `SEA_FOAM` splashes when someone goes in, and spray along the shore round
the camera when a surge starts.
- **Being hurt:** the screen's edge flushes `WARNING` and fades; the health number falls too.
## Audio palette
All synthesized by scripts in the repository.