plasmaBolt
A slow, self-lit bolt crossing a span. A round pulsing core carries a short wake behind it, sheds motes as it goes and drags a point light along with it, so it reads as energy in flight rather than as a round.
effects.play("@builtin::systems.effects.combat.plasmaBolt", {
params = { from = emitter.position, to = target.position, color = { 0.6, 0.3, 1.0 } },
})
Parameters
| Parameter | Type | Default | Range | What it changes |
|---|---|---|---|---|
from | vec3 | {0, 0, 0} | world space | Where the bolt is fired from. |
to | vec3 | {0, 0, 25} | world space | Where it ends. |
speed | number | 42.0 | 1.0 – 400.0 | How fast it crosses the span, in metres per second. Slow enough to watch is what makes it a bolt. |
size | number | 0.34 | 0.03 – 4.0 | Radius of the glowing core, in metres. The wake, the motes and the light's range are proportioned off it. |
color | color | {0.34, 0.82, 1.0} | linear 0..1 | Colour of the plasma. Cold runs blue, ion runs green, antimatter runs violet. |
pulseRate | number | 7.0 | 0.0 – 40.0 | How many times a second the core swells and dims. 0 holds it steady. The rate is in hertz whatever the flight time is. |
light | number | 1.0 | 0.0 – 8.0 | Strength of the light it carries. At 0 no light entity is spawned. |
Cost
<!-- cost: quoted verbatim from effect.yaml -->| gpuMs | vramBytes | measuredOn |
|---|---|---|
| 0.01 | 76020 | see effect.yaml |
The size is what the effect's own backends report they hold at a representative
instant — handle:stats().bytes — read identically on every engine, in every
scene and on every repeat. The emitter vertex buffers an effect draws from come
out of a pool shared across the process that grows in chunks, so a
renderer.gpuMemory() delta taken around one play is that pool's growth as much
as the effect's; what those buffers cost at the declared slot counts is below.
The span is the median of five interleaved idle/loaded windows of the frame's
measured GPU pass sum, which read 0.000 ms with a spread of about 0.008 ms: the
effect costs less GPU time than that instrument resolves, and 0.01 is the bound
the reading supports.
76,020 bytes of emitter simulation state, plus 68,400 bytes of emitter vertex geometry — the mote emitter's 90 declared slots at 760 bytes each. Both are the same at every size and speed.
Telling it apart from the tracer
stats() reports coreRadius, pulseRate, pulse and motesAlive, none of
which a tracer has, and its flightTime over the same span is roughly six times
a tracer's at the declared defaults. The bolt leases an emitter and spawns a
moving light; the tracer leases geometry and nothing else.
What it draws with
| Asset | Role |
|---|---|
combat/materials/combat_glow | the family's one additive material — the core's bloom form and the wake's bolt form |
combat/glow | the module that leases the rod and writes the lanes |
See also
@builtin::systems.effects.combat.tracer— the ballistic round.guides { path: "topics/visual-effects" }.
Scoped to this part · feeds back into the world's score.