Skip to content

Tutorials · Particle Effects · Chapter 16

A gallery of effects

45 minutes Uses: ParticleEmitter, ParticleAttractor, Light, AmbientLight, Collider, restart, set_number, anneal_number, wait

By the end

  • Six scenes in scenes, each finished and playing: snow with depth, an explosion, waterfall mist, falling leaves, a portal and dust in a shaft of light
  • Two new scripts, boom.rgs, that sets a blast off on a timer, and flash.rgs, that flashes a light with it, and two things you had not met: the Subtract blend and a Freeform light
  • For each, its values in one table with the reason for each, what it costs, and which controls change it in your own game
On this page

The first fifteen chapters taught the controls one at a time, in one town. A game uses them together, in many small places. This chapter builds six of those places, each a case you will meet again: snow that has depth, an explosion, the mist at the foot of a waterfall, leaves in the wind, a portal and dust in a shaft of light. Every control in them is one you have used, but for two: the Subtract blend and a Freeform light. There are two short scripts, boom.rgs, that sets a blast off on a timer, and flash.rgs, that flashes a light with it.

The project’s scenes folder holds the six, beside town.ron. They came with the starter, composed and still: the pictures are placed, each scene has a camera of its own, and nothing moves. You open one, add its particles, and play it by itself.

SceneThe caseWhat carries it
SnowA snowy level with depth, or a cold title screen.Two emitters on two Sort Layers, Noise, and Collision on the near flakes
An explosionA barrel or an enemy going up.Six one-shot emitters set off by one script, a light that flashes from another, a Subtract scorch and an attractor that pushes
Waterfall mistWater meeting a pool.A stretched stream, a Screen mist moved by Noise, and a spray
Falling leavesAutumn wind over a menu, a cutscene or the edge of a forest.Rotation Over Life, Noise and a gradient that fades each leaf in and out
A portalA magic door, a level exit or a teleporter.An Edge Only box, a Swirl attractor, a sheet of runes and Additive glow
Dust in a shaft of lightA quiet room: a crypt, an attic, a library.Light Only motes and a Freeform light
  1. In Assets, open scenes and double-click the scene the recipe names. If you changed the open scene, press Ctrl+S first.
  2. Click Look through, so that the Viewport shows the scene as its own camera sees it.
  3. Build the recipe, and press Ctrl+S.
  4. Press F5 to play the open scene, and F5 again to stop.

An exported game opens the project’s startup scene, the town, so these six are for lifting and not for shipping. Build a scene of your own the same way.

Every recipe has the same parts, in the same order:

  • What it is for: the case, in a game.
  • The steps, with a picture at each place the result changes.
  • Why: a note wherever the result is not what you would guess.
  • The values, in one table, each with the reason for it. Every control was defined in the chapter where you first used it.
  • What it costs: the most particles it can draw at once, its largest particle, and any light, attractor or script that comes with it.
  • Make it yours: which control gives which result in your own game.

Snow

What it is for. A snowy level, or a title screen in the cold: snow that has depth, with small dim flakes far away and big bright ones close by, and flakes that settle where they land. It joins five controls you know: two emitters on two Sort Layers, a Line shape, Noise, a gradient and Collision.

snow.ron holds a row of grey houses under mountains and a forest, a lamp, a low wall with a lantern, and a street of yellow tiles along the bottom. The street’s ground is a Collider just under the tiles’ top edge, the solid the near flakes will land on. Nothing falls yet.

  1. Open snow.ron and click Look through.
  2. Select Snow, press + Add node and choose Particles. Rename it snow_far, and set its Position to 160 and -8: above the top of the view, so the flakes are born out of sight.
  3. Set Rate to 30, Lifetime to 9, Speed to 14, Direction to 0.2 and 1, Spread to 0.3 and Gravity to 4.
  4. Set Start Color and End Color to 0.85, 0.9, 1, alpha 0.6, Start Size and End Size to 1.5, Capacity to 300, Prewarm to 9 and Sort Layer to -23.
  5. Under Sprite, set Texture to soft-dot.png. Under Emission Shape, set Shape to Line and its Length to 360.
  6. Tick Noise and set Strength to 6, Frequency to 0.05, Scroll to 4 and 0, and Seed to 1.

The near flakes are a second emitter in the same place, with its own numbers.

  1. Select Snow, press + Add node and choose Particles. Rename it snow_near, and set its Position to 160 and -8.
  2. Set Rate to 12, Lifetime to 9, Speed to 22, Direction to 0.15 and 1, Spread to 0.3 and Gravity to 6.
  3. Set Start Color and End Color to 1, 1, 1, alpha 0.95, Start Size and End Size to 3.5, Capacity to 120, Prewarm to 9 and Sort Layer to 5.
  4. Under Sprite, set Texture to snowflake.png. Under Emission Shape, set Shape to Line and its Length to 360.
  5. In Over Lifetime, tick Color Over Life and open it. Leave its colour stops empty, so it stays white, and set three alpha stops: at 0 alpha 1, at 0.85 alpha 1 and at 1 alpha 0.
  6. In Rotation, set Rotation Spread to 6.3, Angular Velocity to 0.8 and Angular Velocity Spread to 1.6.
  7. Tick Noise and set Strength to 10, Frequency to 0.03, Scroll to 6 and 0, and Seed to 2.
  8. In Collision, tick Collision and set Bounce to 0 and Friction to 1.
  9. Press Ctrl+S.
snow_far selected, its Inspector narrowed with the search box, layer, to its Particle Emitter’s Sort Layer, set to Custom, -23, under a Node group that shows only an Advanced row with Sort childre…, cut off by the box, unticked; in the Viewport the snow scene seen through its camera, mountains and a forest behind four grey houses, a lamp and a low wall with a lantern, and a green arrow pointing down from above the top of the picture with two small blue handles under it
The snowy street at night, half a second in: four grey houses with yellow windows, a lamp and a low wall with a lantern under dark mountains; big white snowflakes spread over the whole picture, small dim flakes among them in the sky, and flakes lying along the top edge of the yellow street tiles
Half a second in. Prewarm 9 means the snow is already falling when the scene opens.

The two layers are the depth. Close up on two houses, the far flakes are behind the town and the near flakes are in front of it.

Two grey houses close up, their walls and roofs dark teal and slate with yellow windows and a lit lantern at the bottom right: a few big white snowflakes over the walls and the roof, and no small flakes on the walls at all
Close up, as you built it: only the near flakes show on the houses. The far flakes are behind them.
The same two houses with a dozen small dim specks over the walls and in front of the windows, among the same big white flakes
For comparison, the far flakes on Sort Layer 5: they are in front of the houses, small dim specks on the walls, and the depth is gone.
The street close up ten seconds in: yellow-green tiles along the bottom and, along their top edge and just above it, white snowflakes lying in a row, a few of them grey where they are fading out
Close up, ten seconds in: near flakes lying where they landed, fading out.

The snow, in one table

NodeValuesWhy this value
snow_far, a Particles nodePosition 160, -8, Rate 30, Lifetime 9, Speed 14, Direction 0.2, 1, Spread 0.3, Gravity 4, Start Color and End Color 0.85, 0.9, 1, alpha 0.6, Start Size and End Size 1.5, Capacity 300, Prewarm 9, Sort Layer -23, Texture soft-dot.png, Shape Line, Length 360, Noise Strength 6, Frequency 0.05, Scroll 4, 0, Seed 1Small, dim and slow: far away. Behind the houses and in front of the forest. A Capacity of 300 is Rate times Lifetime, 270, and a little more, and a Prewarm of its whole Lifetime opens the scene in snow. The noise is a light drift.
snow_near, a Particles nodePosition 160, -8, Rate 12, Lifetime 9, Speed 22, Direction 0.15, 1, Spread 0.3, Gravity 6, Start Color and End Color 1, 1, 1, alpha 0.95, Start Size and End Size 3.5, Capacity 120, Prewarm 9, Sort Layer 5, Texture snowflake.png, Color Over Life alpha stops 0 → 1, 0.85 → 1, 1 → 0, Rotation Spread 6.3, Angular Velocity 0.8, Angular Velocity Spread 1.6, Shape Line, Length 360, Noise Strength 10, Frequency 0.03, Scroll 6, 0, Seed 2, Collision Bounce 0, Friction 1Big, bright and quicker: close. A flake is a picture of a snowflake, born at any angle (Rotation Spread 6.3 is a whole turn) and turning slowly, all one way. A stronger Noise than the far flakes, so they wander more. It stops dead on the ground, and the gradient fades it at the end.

What it costs. 420 particles at most, 300 and 120, and the largest is a near flake at 3.5 units: many small particles, which is the cheap kind. The near flakes’ Collision looks at the room’s solids each step, and this room has one Collider, so it costs almost nothing here.

An explosion

What it is for. A barrel or an enemy going up: a flash of light, a fireball, sparks, a ring that races outward, chips of stone that fall and bounce, grey smoke that drifts up, and a scorch mark left on the wall. It is six emitters, a light and an attractor, set off together by two short scripts. It joins most of what the tutorial taught: One Shot, the Add blend, Stretch, Collision, an attractor, a light and two scripts.

explosion.ron holds a brick house with a window, a rubble heap at each side and a street of stone, with a ground Collider along the street. Nothing is lit and nothing goes off yet. Two short scripts do the work, since a script changes only the components on its own node: one restarts a node’s emitter, and one flashes a node’s light. Write the first now.

  1. In Assets, click Assets in the path bar over the tree, so the script is written at the project’s top, then press Create, choose New script, type boom, and press Enter.
  2. In the Code tab, replace everything in boom.rgs with the script below, and press Ctrl+S.
rgs boom.rgs
/// A blast on a timer. Every `every` seconds this node's emitter fires again
/// from the start, as the Particles panel's Restart does.
component Boom {
    /// Seconds from one blast to the next.
    #[suffix("s")]
    every: f32 = 4.0,

    fn loop() {
        restart();
        await wait(every);
    }
}
The Code panel with boom.rgs open: the Scripts list at the left names bat.rgs, boom.rgs, cough.rgs, fireworks.rgs, flash.rgs, shooting_star.rgs and wish.rgs, and the file is shown whole, its two-line comment, component Boom with its one field every, which has a doc comment, and fn loop with restart and await wait(every); the status line reads Up to date, and the Hierarchy beside it shows no warning marks

loop runs for ever. It calls restart, which empties this node’s emitter and lets its One Shot fire again, as the Particles panel’s Restart does. Then it waits every seconds and starts again. The first pass runs as the room opens, so the first blast goes off at once.

restart
Empties this node’s particle emitter at the end of the step and lets a One Shot fire again. It reaches the emitter on its own node and no other.
wait
Suspends the hook for that many seconds, then carries on from the same line. It is awaited: await wait(every).
Every
Seconds from one blast to the next: 4.

The flash is the second script. The light is a node of its own, and a script changes only the components on its own node, so the light needs a script of its own rather than a share of Boom.

  1. In Assets, click Assets in the path bar over the tree, so the script is written at the project’s top, then press Create, choose New script, type flash, and press Enter.
  2. In the Code tab, replace everything in flash.rgs with the script below, and press Ctrl+S.
rgs flash.rgs
/// A light that flashes on a timer. Every `every` seconds this node's Light
/// leaps to `brightness` and fades out over a third of a second. Give it the
/// same `every` as the blast's Boom and the flash and the blast stay in step.
component Flash {
    /// Seconds from one flash to the next.
    #[suffix("s")]
    every: f32 = 4.0,
    /// How bright the Light flashes: its peak.
    brightness: f32 = 3.0,

    fn loop() {
        set_number("LightComponent", "intensity", brightness);
        anneal_number("LightComponent", "intensity", 0.0, 0.35, .OutQuad);
        await wait(every);
    }
}

loop sets the node’s Light to brightness at once and eases it back to zero over 0.35 seconds. Then it waits every seconds and starts again. Like Boom, its first pass runs as the room opens, so with the same every the flash and the blast start together and stay in step.

set_number
Writes a number onto a field of another component on this node. Here the Light’s Intensity, straight to brightness.
anneal_number
Takes a number field to a value over a time, along a curve. Here the Light’s Intensity back to 0 in 0.35 seconds along .OutQuad, which starts fast and slows to a stop, so the flash leaps and dies away.
Every
Seconds from one flash to the next: 4, the same as every Boom.
Brightness
The peak the Light leaps to: 3. The Light’s own Intensity holds the same 3, because the editor warns of a Light switched on at 0, which lights nothing. In play, the first blast sets it to 3 as the room opens.

The scene starts with its lights: an ambient, and the flash, a warm light that leaps with each blast and dies away.

  1. Open explosion.ron and click Look through.
  2. Select Explosion, press + Add node and choose Ambient Light. Rename it ambient. Set its Position to 8 and 8 and its Color to 0.5, 0.48, 0.5, alpha 1.
  3. Press + Add node and choose Light. Rename it flash. Set its Position to 160 and 140, and leave Kind on Point. Set Radius to 160, Intensity to 3 and Color to 1, 0.75, 0.45, alpha 1.
  4. Press Add component and choose Flash. Set Every to 4 and Brightness to 3.

Then the chips of stone: twenty flung up in a fan that fall back and bounce on the street.

  1. Select Explosion, press + Add node and choose Particles. Rename it debris, and set its Position to 160 and 150.
  2. Tick One Shot and set Burst to 20 and Capacity to 20: a one-shot fires its whole burst at once, so its pool needs exactly that many. Set Lifetime to 2.5, Speed to 150, Spread to 1.6 and Gravity to 420. Leave Direction at 0 and -1, straight up.
  3. Set Start Color and End Color to 1, 1, 1, alpha 1, Start Size and End Size to 6 and Sort Layer to 3. Under Sprite, set Texture to debris.png.
  4. In Rotation, set Rotation Spread to 6.3, Angular Velocity to 6 and Angular Velocity Spread to 8.
  5. In Collision, tick Collision and set Bounce to 0.35 and Friction to 0.6.
  6. Press Add component and choose Boom. Leave Every at 4.

The smoke is grey puffs that swell and rise, born across a small disc.

  1. Add a Particles node smoke at 160 and 150. Tick One Shot and set Burst to 30 and Capacity to 30.
  2. Set Lifetime to 3.6, Speed to 14, Spread to 7, Gravity to -16 and Drag to 3.
  3. Set Start Color to 0.05, 0.05, 0.055, alpha 0.85 and End Color to 0.16, 0.16, 0.17, alpha 0.85. Set Start Size to 16, End Size to 56 and Sort Layer to 2. Under Sprite, set Texture to soft-dot.png.
  4. In Over Lifetime, tick Color Over Life and set three alpha stops, with no colour stops: at 0 alpha 1, at 0.6 alpha 1 and at 1 alpha 0.
  5. Under Emission Shape, set Shape to Circle and its Radius to 16.
  6. Add Boom, with Every 4.

The fireball is the white-hot core, and the scorch is the mark it leaves on the wall. The scorch is the one place the tutorial uses the Subtract blend, so it has a section of its own below. Build both now.

  1. Add a Particles node fireball at 160 and 150. Tick One Shot and set Burst to 10 and Capacity to 10.
  2. Set Lifetime to 0.45, Speed to 10, Spread to 7, Gravity to 0 and Drag to 8.
  3. Set Start Color to 1, 0.95, 0.8, alpha 1 and End Color to 1, 0.4, 0.08, alpha 0. Set Start Size to 26, End Size to 56 and Sort Layer to 3.
  4. Set Blend to Add and tick Unshaded. Under Sprite, set Texture to soft-dot.png.
  5. Add Boom, with Every 4.
  6. Add a Particles node scorch at 160 and 142. Tick One Shot and set Burst to 5 and Capacity to 5.
  7. Set Lifetime to 3.8, Speed to 0, Spread to 7 and Gravity to 0.
  8. Set Start Color to 0.14, 0.1, 0.07, alpha 1 and End Color to 0.14, 0.1, 0.07, alpha 0. Set Start Size to 36, End Size to 44 and Sort Layer to 0.
  9. Set Blend to Subtract and tick Unshaded. Under Sprite, set Texture to soft-dot.png.
  10. In Over Lifetime, tick Velocity Over Life and open it. Set both of its points to 0: at 0 the value 0, and at 1 the value 0.
  11. Under Emission Shape, set Shape to Circle and its Radius to 14.
  12. Add Boom, with Every 4.

The sparks are thin streaks, and the shockwave is a ring of forty dots.

  1. Add a Particles node sparks at 160 and 148. Tick One Shot and set Burst to 36 and Capacity to 36.
  2. Set Lifetime to 0.9, Speed to 220, Spread to 7, Gravity to 200 and Drag to 1.5.
  3. Set Start Color to 1, 0.95, 0.7, alpha 1 and End Color to 1, 0.5, 0.15, alpha 0. Set Start Size to 2.5, End Size to 1 and Sort Layer to 4.
  4. Set Blend to Add and tick Unshaded. Under Sprite, set Texture to spark.png, tick Stretch and set Length Scale to 1 and Speed Scale to 0.01. In Rotation, tick Align To Velocity.
  5. Add Boom, with Every 4.
  6. Add a Particles node shockwave at 160 and 150. Tick One Shot and set Burst to 40 and Capacity to 40.
  7. Set Lifetime to 0.6, Speed to 0, Spread to 7 and Gravity to 0.
  8. Set Start Color to 1, 0.9, 0.7, alpha 0.8 and End Color to 1, 0.8, 0.6, alpha 0. Set Start Size to 4, End Size to 2 and Sort Layer to 4.
  9. Set Blend to Add and tick Unshaded. Under Sprite, set Texture to soft-dot.png.
  10. Under Emission Shape, set Shape to Circle, Radius to 6, and tick Edge Only.
  11. Add Boom, with Every 4.
shockwave selected, its Inspector narrowed with the search box, shape, to its Particle Emitter’s Emission Shape: Shape Circle, Radius 6.00 and Edge Only ticked; in the Viewport the brick house with its window, warmly lit round the middle, a rubble heap at each side, a thin pale circle, the flash’s Radius, round the middle, and at the foot of the wall the shockwave’s node inside a small violet ring, its Circle, with a violet line rising from it to a small blue square; the Hierarchy shows no warning marks, and the status bar reads 1 node selected

The last node is the push. A Repel at the middle of the blast gives everything born near it a shove outward.

  1. Select Explosion, press + Add node and choose Particle Attractor. Rename it blast, and set its Position to 160 and 150.
  2. Set Kind to Repel, Radius to 14 and Strength to 3000. Leave Enabled ticked.
  3. Press Ctrl+S, and press F5.

The blast goes off as soon as the room opens and again every four seconds. Four moments of it:

The brick house with a white-hot ball at the foot of its wall and a ring of short spokes round it, a dark patch on the bricks either side of the ball, a black rim round it, and a warm light on the wall
A fifteenth of a second in: the fireball, white hot, with the first sparks round it and the scorch beginning to darken the wall.
The same wall a fifth of a second in: three bright orange-white fireballs in a cluster, thin sparks flying out in every direction, a dotted ring round them, an arc of grey chips thrown up above, and a dark smoke and a black scorch on the wall at the right of the fireballs
A fifth of a second in: the fireball broken into three glowing lumps, the sparks flying, the shockwave’s ring out, and chips thrown up.
The same wall two thirds of a second in: grey chips of stone in arcs across the wall as far as the window and the two pillars, grey puffs of smoke rising from the foot of the wall, a black scorch mark on the bricks behind them, and a few faint sparks
Two thirds of a second in: chips in the air, smoke rising, and the scorch left on the wall.
The same wall a little over a second in: the chips have come down onto the street and lie along its top edge, some close to the rubble heaps, and a column of grey smoke has climbed the middle of the wall in front of the dark scorch mark
A little over a second in: the chips down on the street, bounced and skidded, and the smoke climbing the wall.

The push is why the ring is a ring. The next two pictures leave the fireball out of both, since it covers the middle, and cut to the core at a fifth of a second.

The core of the blast with the fireball and the push left out: a small ring of about a dozen bright dots round the wall’s middle, a lump of dark smoke round it with the black scorch beside it at the right, thin sparks flying out at the sides, and an arc of grey chips above
For comparison, the fireball left out and the blast’s push off: the shockwave’s ring stays small, where it was born, and the smoke stays in a lump round it.
The same core with the fireball left out and the push on: a wide ring of bright dots round the middle of the wall, a ring of dark smoke inside it round the black scorch, and the sparks and the chips flying past it
The fireball left out and the push on: the ring is thrown wide, and the smoke with it.

The scorch is what is left. It is the only emitter here that darkens the wall behind it, and that needs a blend you have not used.

scorch selected, its Inspector narrowed with the search box, particleemitter, to the Particle Emitter from its top: Emitting ticked, Rate 20.00, Lifetime 3.80, Speed 0.00, Direction x 0.0 and y -1.0, Spread 7.00, Gravity 0.00, a brown Start Color swatch and an End Color swatch over a checkerboard, Start Size 36.00, End Size 44.00, One Shot ticked, Burst 5, Capacity 5, Prewarm 0.00 s, Trail 0, Sort Layer Default 0, Blend Subtract, Unshaded ticked, Light Only unticked, and the Sprite group with Texture soft-dot.png; the Viewport, the Hierarchy and the status bar as in the picture before, but with the scorch’s node a little higher up the wall inside a larger violet ring, its Circle
Blend Subtract
Takes the particle’s colour away from what is behind it: red from red, green from green, blue from blue, scaled by the particle’s alpha, and never below black. It is the opposite of Add. Where particles overlap, each takes its share again. Use it for a mark that must darken a wall, a stain or a hole. Its Color is an amount to take away, not a colour to paint.
Velocity Over Life
A curve that multiplies a particle’s whole velocity across its life, as chapter 5 set it. Here it is 0 from birth to death, so the scorch’s five dots do not move at all, whatever pushes them.
The core of the wall half a second after the blast, with grey smoke puffs over the bricks and a faint pale tan haze among them: no dark mark on the wall
For comparison, the scorch as Alpha: the same colour painted over the wall is a pale tan haze that lightens the bricks a little. There is no burn.
The same core with the scorch as Subtract: a black patch with a dark red rim burned into the wall behind the grey smoke puffs, as wide as the blast
The scorch as Subtract, as you built it: the wall itself is darkened, black where the dots overlap.

The explosion, in one table

NodeValuesWhy this value
ambient, an Ambient LightPosition 8, 8, Color 0.5, 0.48, 0.5, alpha 1Half strength, so the wall is lit but the flash still stands out.
flash, a Light, with FlashPosition 160, 140, Kind Point, Radius 160, Intensity 3, Color 1, 0.75, 0.45, Flash Every 4, Brightness 3A warm light that leaps to 3 as a blast goes off, then dies in a third of a second. Its own Intensity holds the peak, so the editor has nothing to warn of.
debris, a Particles node, with BoomPosition 160, 150, One Shot, Burst 20, Capacity 20, Lifetime 2.5, Speed 150, Direction 0, -1, Spread 1.6, Gravity 420, Start Color and End Color 1, 1, 1, alpha 1, Start Size and End Size 6, Sort Layer 3, Texture debris.png, Rotation Spread 6.3, Angular Velocity 6, Angular Velocity Spread 8, Collision Bounce 0.35, Friction 0.6, Boom Every 4Chips thrown up in a quarter-circle fan, tumbling at 2 to 10 radians a second, that fall hard and bounce on the street. White, so the picture’s own grey shows.
smoke, a Particles node, with BoomPosition 160, 150, One Shot, Burst 30, Capacity 30, Lifetime 3.6, Speed 14, Spread 7, Gravity -16, Drag 3, Start Color 0.05, 0.05, 0.055, alpha 0.85, End Color 0.16, 0.16, 0.17, alpha 0.85, Start Size 16, End Size 56, Sort Layer 2, Texture soft-dot.png, Color Over Life alpha stops 0 → 1, 0.6 → 1, 1 → 0, Shape Circle, Radius 16, Boom Every 4Grey, soft puffs that swell and rise. The alpha is kept in the gradient, so the End Color’s alpha can stay 0.85.
scorch, a Particles node, with BoomPosition 160, 142, One Shot, Burst 5, Capacity 5, Lifetime 3.8, Speed 0, Spread 7, Gravity 0, Start Color 0.14, 0.1, 0.07, alpha 1, End Color 0.14, 0.1, 0.07, alpha 0, Start Size 36, End Size 44, Sort Layer 0, Blend Subtract, Unshaded, Texture soft-dot.png, Velocity Over Life 0 → 0, 1 → 0, Shape Circle, Radius 14, Boom Every 4The amount to take off the wall, in a patch as wide as the blast, held still, fading out over its life. Sort Layer 0 is above the house’s -10.
fireball, a Particles node, with BoomPosition 160, 150, One Shot, Burst 10, Capacity 10, Lifetime 0.45, Speed 10, Spread 7, Gravity 0, Drag 8, Start Color 1, 0.95, 0.8, alpha 1, End Color 1, 0.4, 0.08, alpha 0, Start Size 26, End Size 56, Sort Layer 3, Blend Add, Unshaded, Texture soft-dot.png, Boom Every 4Ten big soft dots with almost no speed of their own: Drag 8 takes it at once, so the ball is where the blast is, and the push splits it into lumps. It swells and cools from white to orange as it fades.
sparks, a Particles node, with BoomPosition 160, 148, One Shot, Burst 36, Capacity 36, Lifetime 0.9, Speed 220, Spread 7, Gravity 200, Drag 1.5, Start Color 1, 0.95, 0.7, alpha 1, End Color 1, 0.5, 0.15, alpha 0, Start Size 2.5, End Size 1, Sort Layer 4, Blend Add, Unshaded, Texture spark.png, Stretch Length Scale 1, Speed Scale 0.01, Align To Velocity, Boom Every 4Fast, in every direction, falling and slowing. A spark at full speed is stretched to about three times its width and points the way it flies.
shockwave, a Particles node, with BoomPosition 160, 150, One Shot, Burst 40, Capacity 40, Lifetime 0.6, Speed 0, Spread 7, Gravity 0, Start Color 1, 0.9, 0.7, alpha 0.8, End Color 1, 0.8, 0.6, alpha 0, Start Size 4, End Size 2, Sort Layer 4, Blend Add, Unshaded, Texture soft-dot.png, Shape Circle, Radius 6, Edge Only, Boom Every 4Forty dots on a rim, born still. The push is what makes them a ring that grows.
blast, a Particle AttractorPosition 160, 150, Kind Repel, Radius 14, Strength 3000A short, hard shove at the middle: just past the ring’s birth circle of 6, strong enough to throw a ring and a fireball out in a few frames.

What it costs. 141 particles at most: 20, 30, 5, 10, 36 and 40. The costliest pixels are the smoke and the fireball, each up to 56 units across and 30 and 10 of them overlapping, so a phone feels this one even though it is brief. It also carries one light, which is off between blasts, one attractor, a Collision on the chips and seven small scripts.

Waterfall mist

What it is for. Water meeting a pool: a fall of streaks, mist that rises where it lands and spray thrown up at its foot. Use it for a level’s waterfall, a dam, a broken pipe or a fountain. It joins a Line shape, Stretch, Prewarm, a Screen blend and Noise.

waterfall.ron holds a cliff of six stone pillars at the left, mountains and a forest behind, and a pool of water along the bottom. The water is a picture, with the cliff’s edge at its left and the pool’s top edge at 164. Nothing falls yet.

  1. Open waterfall.ron and click Look through.
  2. Select Waterfall, press + Add node and choose Particles. Rename it falls, and set its Position to 104 and 40, at the lip of the cliff.
  3. Set Rate to 160, Lifetime to 1, Speed to 20, Direction to 0.2 and 1, Spread to 0.1 and Gravity to 300.
  4. Set Start Color and End Color to 0.75, 0.9, 1, alpha 0.85, Start Size and End Size to 4, Capacity to 176, Prewarm to 1 and Sort Layer to -1.
  5. Under Sprite, set Texture to raindrop.png, tick Stretch and set Length Scale to 1 and Speed Scale to 0.02. Under Emission Shape, set Shape to Line and its Length to 14.

The mist is a second emitter at the foot of the fall, and the spray a third.

  1. Add a Particles node mist at 130 and 160, on the water. Set Rate to 6, Lifetime to 4, Speed to 8, Direction to 0.3 and -1, Spread to 0.8 and Gravity to -4.
  2. Set Start Color to 0.8, 0.9, 0.95, alpha 0.3 and End Color to the same three numbers with alpha 0. Set Start Size to 20, End Size to 44, Capacity to 24, Prewarm to 4 and Sort Layer to 2.
  3. Set Blend to Screen. Under Sprite, set Texture to smoke-puff.png. Under Emission Shape, set Shape to Box and its Size to 90 and 8.
  4. Tick Noise and set Strength to 8, Frequency to 0.02, Scroll to 5 and -2, and Seed to 4.
  5. Add a Particles node spray at 110 and 164. Set Rate to 40, Lifetime to 0.6, leave Speed at 60, and set Direction to 0.4 and -1, Spread to 0.9 and Gravity to 260.
  6. Set Start Color to 0.85, 0.95, 1, alpha 0.8 and End Color to the same three numbers with alpha 0. Set Start Size to 1.5, End Size to 1, Capacity to 32 and Sort Layer to 2. Under Sprite, set Texture to soft-dot.png. Under Emission Shape, set Shape to Box and its Size to 24 and 2.
  7. Press Ctrl+S.
The waterfall scene: a stone cliff of mossy blocks at the left, a narrow white fall of streaks running down from its lip to the pool, pale grey mist rising in soft clumps from the pool on the right of it under dark mountains and a forest, and a few fine drops where the water lands
Half a second in.
The waterfall a second and a half later: the same white fall of streaks into the pool, and the mist in other places, clumps drifting up and to the right from the foot of the fall
A second and a half later: the fall the same, the mist in new places.
mist selected, its Inspector narrowed with the search box, particleemitter, to the Particle Emitter from its top: Emitting ticked, Rate 6.00, Lifetime 4.00, Speed 8.00, Direction x 0.3 and y -1.0, Spread 0.8, Gravity -4.00, Start Color and End Color swatches, Start Size 20.00, End Size 44.00, One Shot unticked, Burst 24, Capacity 24, Prewarm 4.0 s, Trail 0, Sort Layer Custom 2, Blend Screen, Unshaded and Light Only unticked, and the Sprite group with Texture smoke-puff.…, cut off by the box; in the Viewport the waterfall scene, with the emitter’s handle at the left of the pool’s top edge, in the middle of its Box, a thin violet rectangle along that edge with a small blue handle on each corner, and three thin violet lines fanning up from the emitter to two small blue handles above it
The foot of the waterfall without the mist: the white fall running down into the dark pool, a few fine drops above the water at the fall’s foot, and dark forest on the right, empty
For comparison, no mist: the water just stops at the pool.
The same foot of the waterfall with the mist: soft pale clumps of mist rising from the pool and drifting up the dark forest on the right of the fall and a little to its left, over the same fine drops
Mist rising from the foot of the falls.

The waterfall, in one table

NodeValuesWhy this value
falls, a Particles nodePosition 104, 40, Rate 160, Lifetime 1, Speed 20, Direction 0.2, 1, Spread 0.1, Gravity 300, Start Color and End Color 0.75, 0.9, 1, alpha 0.85, Start Size and End Size 4, Capacity 176, Prewarm 1, Sort Layer -1, Texture raindrop.png, Stretch Length Scale 1, Speed Scale 0.02, Shape Line, Length 14A dense stream, 160 a second, with a little lean and almost no spread, so it holds together. Capacity is Rate times Lifetime, 160, and a little more. Pale blue and mostly solid: water.
mist, a Particles nodePosition 130, 160, Rate 6, Lifetime 4, Speed 8, Direction 0.3, -1, Spread 0.8, Gravity -4, Start Color 0.8, 0.9, 0.95, alpha 0.3, End Color 0.8, 0.9, 0.95, alpha 0, Start Size 20, End Size 44, Capacity 24, Prewarm 4, Sort Layer 2, Blend Screen, Texture smoke-puff.png, Shape Box, Size 90, 8, Noise Strength 8, Frequency 0.02, Scroll 5, -2, Seed 4Few, slow, faint and growing. The Box is a strip 90 wide along the water, most of it to the right of the fall. A Prewarm of its whole Lifetime has the mist up when the scene opens.
spray, a Particles nodePosition 110, 164, Rate 40, Lifetime 0.6, Speed 60, Direction 0.4, -1, Spread 0.9, Gravity 260, Start Color 0.85, 0.95, 1, alpha 0.8, End Color 0.85, 0.95, 1, alpha 0, Start Size 1.5, End Size 1, Capacity 32, Sort Layer 2, Texture soft-dot.png, Shape Box, Size 24, 2Fine drops thrown up and back down within 0.6 of a second, at the water’s edge, from a strip a little wider than the fall.

What it costs. 232 particles at most: 176, 24 and 32. The streaks are many but thin. The mist is the larger price: at most 24 puffs, each growing to 44 units across and overlapping the others.

Falling leaves

What it is for. Autumn wind: leaves falling past a village on a menu screen, a cutscene or the edge of a forest level. Each leaf tumbles at its own pace, the wind pushes them all sideways, and they fade in and out rather than pop. It joins Rotation, Rotation Over Life, Noise and a gradient.

leaves.ron holds a village under a stormy sky, drawn from 256 by 144, a smaller view than the other scenes’ 320 by 180, so everything is larger on the screen. Nothing falls yet.

  1. Open leaves.ron and click Look through.
  2. Select Leaves, press + Add node and choose Particles. Rename it leaves, and set its Position to 128 and 20, above the top of the view.
  3. Set Rate to 5, Lifetime to 9, Speed to 12, Direction to 0.4 and 1, Spread to 0.5, Gravity to 14 and Drag to 0.4.
  4. Set Start Color to 0.95, 0.55, 0.18, alpha 1 and End Color to 0.55, 0.25, 0.1, alpha 1. Set Start Size and End Size to 5, Capacity to 48, Prewarm to 9 and Sort Layer to 2. Under Sprite, set Texture to leaf.png.
  5. In Over Lifetime, tick Color Over Life and set four alpha stops, with no colour stops: at 0 alpha 0, at 0.08 alpha 1, at 0.9 alpha 1 and at 1 alpha 0.
  6. Tick Rotation Over Life and open it. Set three points: at 0 the value 1, at 0.5 the value 0.3 and at 1 the value 1.
  7. In Rotation, set Start Rotation to 45.84, Rotation Spread to 1.2, Angular Velocity to 1 and Angular Velocity Spread to 4. The Inspector shows Start Rotation in degrees, and 45.84 degrees is 0.8 radians, the number the scene holds. The other three are in radians.
  8. Under Emission Shape, set Shape to Box and its Size to 300 and 8.
  9. Tick Noise and set Strength to 22, Frequency to 0.03, Scroll to 8 and 0, and Seed to 5.
  10. Press Ctrl+S.
leaves selected, its Inspector narrowed with the search box, rotation, to its Particle Emitter: an Over Lifetime group holding a ticked Rotation…, cut off by the box, with a small curve beside it that dips in the middle, and a Rotation group holding Start Rotation 45.84° and Rotation Sp…, cut off by the box, 1.2 on a slider, and above them the Node group’s Rotation 0°; in the Viewport the village under stormy yellow-green clouds seen through the camera, with a green arrow pointing down from above the top of the picture and two small blue handles
The village under a stormy sky, half a second in: small orange-brown leaves scattered over the clouds, the roofs and the trees, some lying flat, some on their ends, no two at quite the same angle
Half a second in.
The same village a second after the first picture: the leaves in other places, further down, and turned to other angles
A second later: each leaf further down and turned further, and some turning the other way.
The same village with the leaves not spinning: every leaf lying nearly flat and leaning the same way, with none standing on its end
For comparison, no spin: every leaf keeps the tilt it was born with, and they all lean the same way.

The leaves, in one table

NodeValuesWhy this value
leaves, a Particles nodePosition 128, 20, Rate 5, Lifetime 9, Speed 12, Direction 0.4, 1, Spread 0.5, Gravity 14, Drag 0.4, Start Color 0.95, 0.55, 0.18, alpha 1, End Color 0.55, 0.25, 0.1, alpha 1, Start Size and End Size 5, Capacity 48, Prewarm 9, Sort Layer 2, Texture leaf.png, Color Over Life alpha stops 0 → 0, 0.08 → 1, 0.9 → 1, 1 → 0, Rotation Over Life 0 → 1, 0.5 → 0.3, 1 → 1, Start Rotation 45.84 degrees, 0.8 radians, Rotation Spread 1.2, Angular Velocity 1, Angular Velocity Spread 4, Shape Box, Size 300, 8, Noise Strength 22, Frequency 0.03, Scroll 8, 0, Seed 5Slow and light: a small Speed, a gentle Gravity, a little Drag. Orange at birth and browner as it falls. A Start Rotation of 0.8 with a spread of 1.2 leans every leaf the same way, by different amounts. A Capacity of 48 is Rate times Lifetime, 45, and a little more.

What it costs. 48 particles at most, each 5 units across: almost free.

A portal

What it is for. A magic door, a level exit or a teleporter: sparks that crawl round a doorway and are swept into a swirl, a dark void in its middle and a ring of runes that turns slowly. Three emitters and an attractor.

portal.ron holds a dark stone hall: a stair at the left, a gargoyle over an arch in the middle and a wall at the right, with a floor of stone below. Nothing glows yet.

  1. Open portal.ron and click Look through.
  2. Select Portal, press + Add node and choose Particles. Rename it frame, and set its Position to 200 and 112, the middle of the arch.
  3. Set Rate to 70, Lifetime to 1.4, Speed to 2, Spread to 7, Gravity to 0 and Drag to 1.
  4. Set Start Color to 0.75, 0.45, 1, alpha 1 and End Color to 0.35, 0.2, 1, alpha 0. Set Start Size to 3, End Size to 1, Capacity to 100 and Sort Layer to 4.
  5. Set Blend to Add. Under Sprite, set Texture to soft-dot.png. Under Emission Shape, set Shape to Box, its Size to 44 and 72, and tick Edge Only.
  6. Press + Add node and choose Particle Attractor. Rename it swirl, and set its Position to 200 and 112. Set Kind to Swirl, Radius to 48 and Strength to 90.

The void is a dark puff behind the sparks, and the runes are a turning ring in front of them.

  1. Add a Particles node void at 200 and 112. Set Rate to 4, Lifetime to 2.5, Speed to 3, Spread to 7 and Gravity to 0.
  2. Set Start Color to 0.08, 0.02, 0.12, alpha 0.9 and End Color to the same three numbers with alpha 0. Set Start Size to 36, End Size to 52, Capacity to 12 and Sort Layer to 3. Under Sprite, set Texture to smoke-puff.png.
  3. In Rotation, set Rotation Spread to 6.3 and Angular Velocity to 0.5.
  4. Add a Particles node runes at 200 and 112. Set Rate to 1.2, Lifetime to 2.4, Speed to 0, Spread to 0 and Gravity to 0.
  5. Set Start Color and End Color to 0.8, 0.6, 1, alpha 1. Set Start Size to 40, End Size to 56, Capacity to 4, Sort Layer to 5 and Blend to Add.
  6. Under Sprite, set Texture to rune-ring-sheet.png, tick Texture Sheet and set Columns to 4, Rows to 1, First to 0, Last to 3 and Driver to Lifetime.
  7. In Over Lifetime, tick Color Over Life and set three alpha stops, with no colour stops: at 0 alpha 0, at 0.3 alpha 1 and at 1 alpha 0. In Rotation, set Angular Velocity to 0.6.
  8. Press Ctrl+S.
frame selected, its Inspector narrowed with the search box, shape, to its Particle Emitter’s Emission Shape: Shape Box, Size x 44.0 and y 72.0, and Edge Only ticked; in the Viewport the dark stone hall with its chandelier, stair and pillars, and round the gargoyle’s arch a thin violet rectangle, the Box, with a blue handle on each corner, the emitter’s handle at its middle with a violet line rising from it to another handle above the rectangle and a green arrow pointing down, and a thin orange circle, the swirl’s Radius, round it all
The dark stone hall with a glowing portal in front of the gargoyle at the right: a ring of pale lilac light with a dotted inner ring of runes and a dark purple middle, lilac sparks swept round it in curved streams, and a few soft purple smudges drifting away from it
Two and a half seconds in.
The portal a second later: the ring of runes turned to another frame, the lilac sparks in other places in curved streams round it, and the soft purple smudges moved
A second later: the runes turned, the sparks and the smudges elsewhere.
The portal and the two pillars either side with the swirl switched off: the ring of runes and its dark middle as before, and the sparks sitting in a thin rectangle round it, standing still along the box’s outline
For comparison, no swirl: the frame’s sparks stay on the rectangle they were born on.
The same portal with the swirl on: the sparks carried round the doorway in curved streams that spread into a loose cloud round the ring, and soft purple smudges drifting beside it
The swirl carries the sparks round the door.

The portal, in one table

NodeValuesWhy this value
frame, a Particles nodePosition 200, 112, Rate 70, Lifetime 1.4, Speed 2, Spread 7, Gravity 0, Drag 1, Start Color 0.75, 0.45, 1, alpha 1, End Color 0.35, 0.2, 1, alpha 0, Start Size 3, End Size 1, Capacity 100, Sort Layer 4, Blend Add, Texture soft-dot.png, Shape Box, Size 44, 72, Edge OnlyMany, small and almost still: born on the rim at a Speed of 2, so they stay near it unless something moves them. Lilac fading to blue. Capacity is Rate times Lifetime, 98, and a little more.
swirl, a Particle AttractorPosition 200, 112, Kind Swirl, Radius 48, Strength 90Reaches the whole frame and a little past it, and is strong enough to carry the sparks round in about a second.
void, a Particles nodePosition 200, 112, Rate 4, Lifetime 2.5, Speed 3, Spread 7, Gravity 0, Start Color 0.08, 0.02, 0.12, alpha 0.9, End Color 0.08, 0.02, 0.12, alpha 0, Start Size 36, End Size 52, Capacity 12, Sort Layer 3, Texture smoke-puff.png, Rotation Spread 6.3, Angular Velocity 0.5A few big, slow, dark puffs, each turning a little, so the middle of the door is a darkness that moves. Capacity is Rate times Lifetime, 10, and a little more.
runes, a Particles nodePosition 200, 112, Rate 1.2, Lifetime 2.4, Speed 0, Spread 0, Gravity 0, Start Color and End Color 0.8, 0.6, 1, alpha 1, Start Size 40, End Size 56, Capacity 4, Sort Layer 5, Blend Add, Texture rune-ring-sheet.png, Texture Sheet Columns 4, Rows 1, First 0, Last 3, Driver Lifetime, Color Over Life alpha stops 0 → 0, 0.3 → 1, 1 → 0, Angular Velocity 0.6One ring about every 0.8 seconds, born still at the middle and turning slowly as it grows, in front of everything else.

What it costs. 116 particles at most: 100, 12 and 4. The count is modest, the sizes are not: the void’s puffs reach 52 units and the runes’ rings 56. It also carries one attractor, which tests each particle in its reach once a step.

Dust in a shaft of light

What it is for. A quiet, dusty room: a crypt, an attic, a library, with sunlight coming through a window and dust turning in it. The dust fills the whole room and only the light shows it, so the shaft appears to be full of it. It joins an ambient light, a Freeform light, Light Only, a gradient and Noise.

dust.ron holds a dark hall: a wall at the left, a tall window and a stair at the right, over a floor of stone. Nothing is lit yet.

  1. Open dust.ron and click Look through.
  2. Select Dust, press + Add node and choose Ambient Light. Rename it ambient. Set its Position to 8 and 8 and its Color to 0.06, 0.06, 0.09, alpha 1: so dark that the hall hardly shows.
  3. Press + Add node and choose Light. Rename it shaft. Set its Position to 116 and 92, and its Kind to Freeform. Set Radius to 0, Intensity to 8 and Color to 1, 0.92, 0.75, alpha 1.
  4. Under the Freeform group, beside Outline, press the + four times, and type the four points of the table below: the window’s opening, and where the shaft lands on the floor. Set Falloff to 10.
Pointxy
[0]-12-20
[1]12-20
[2]11468
[3]7468
Kind Freeform
Lights a shape you draw, which is what light through a window is: its opening, and then a slanting band across the floor. Light and Shadow builds a shaft like this one in full.
Outline
The shape, as points in the node’s own units from its middle: -12, -20 is twelve to the left and twenty up. The first two points are the window’s opening, 24 across, and the last two are where the band meets the floor. Three or more are needed.
Falloff
How far in from the outline the light reaches full brightness, in world units. 0 is a hard-edged cut-out, and above it the light fades in across that band: 10 here. Keep it under half the outline’s narrowest width.
Radius
For a Freeform light, only how far its shadows reach. 0 casts none.

The dust is an emitter that fills a box round the whole shaft, and is drawn only where the light falls.

  1. Select Dust, press + Add node and choose Particles. Rename it motes, and set its Position to 160 and 116.
  2. Leave Rate at 20. Set Lifetime to 6, Speed to 3, Spread to 7 and Gravity to -1.
  3. Set Start Color and End Color to 1, 0.95, 0.85, alpha 0.9, Start Size and End Size to 3, Capacity to 128, Prewarm to 6 and Sort Layer to 5. Tick Light Only.
  4. Under Sprite, set Texture to soft-dot.png. In Over Lifetime, tick Color Over Life and set four alpha stops, with no colour stops: at 0 alpha 0, at 0.2 alpha 1, at 0.8 alpha 1 and at 1 alpha 0.
  5. Under Emission Shape, set Shape to Box and its Size to 130 and 90.
  6. Tick Noise and set Strength to 5, Frequency to 0.05, Scroll to 2 and 1, and Seed to 6.
  7. Press Ctrl+S.
motes selected, its Inspector narrowed with the search box, light, to its Particle Emitter: Unshaded unticked and Light Only ticked, then the Sprite group with Stretch unticked; in the Viewport the dark hall with a slanting band outlined in yellow from the window down to the floor at the right, the shaft’s Outline, the emitter’s handle in the shaft, and the Box, a thin violet rectangle round it all with a small blue handle on each corner
The dark hall with a pale shaft of light slanting from the window down to the floor at the right, lighting a stack of green-grey stone where it lands, and small white dots drifting in the shaft only; the rest of the room almost black
Half a second in: a shaft of light with dust in it, and a dark room.
The shaft two seconds later: the same pale band from the window to the floor, and the white dots in other places in it
Two seconds later: the shaft the same, the dust elsewhere in it.
The shaft and the room round it with the motes not Light Only: the same pale shaft with its dots, and as many dim white specks again scattered all over the dark room, up to the corners of the picture
For comparison, the motes not Light Only: specks all over the dark room.
The same cut with Light Only on: the pale shaft slanting from the window to the floor with its white dots in it, and no specks anywhere else in the dark room
Light Only, as you set it: motes only in the shaft.

The dust, in one table

NodeValuesWhy this value
ambient, an Ambient LightPosition 8, 8, Color 0.06, 0.06, 0.09, alpha 1A cold near-black, so the shaft is the one lit thing in the room.
shaft, a LightPosition 116, 92, Kind Freeform, Radius 0, Intensity 8, Color 1, 0.92, 0.75, Outline -12, -20, 12, -20, 114, 68, 74, 68, Falloff 10A warm band from the window to the floor, soft at its edges. A Radius of 0 casts no shadows, and nothing stands in its way.
motes, a Particles nodePosition 160, 116, Rate 20, Lifetime 6, Speed 3, Spread 7, Gravity -1, Start Color and End Color 1, 0.95, 0.85, alpha 0.9, Start Size and End Size 3, Capacity 128, Prewarm 6, Sort Layer 5, Light Only, Texture soft-dot.png, Color Over Life alpha stops 0 → 0, 0.2 → 1, 0.8 → 1, 1 → 0, Shape Box, Size 130, 90, Noise Strength 5, Frequency 0.05, Scroll 2, 1, Seed 6Slow, small and warm white, drifting up a little. They fill a box round the shaft and fade in and out, so none pops. Capacity is Rate times Lifetime, 120, and a little more, and Prewarm its whole Lifetime.

What it costs. 128 particles at most, each 3 units across: almost free. The one thing it adds is a light, a Freeform one: one light draw a frame, as Light and Shadow counted them.

What each costs

Each recipe priced its own scene. Here they are together.

SceneMost particlesLargest particleAlso
Snow4203.5 unitsCollision on the near flakes, against one Collider.
An explosion14156 unitsOne light, off between blasts, one attractor, Collision on the chips and seven small scripts.
Waterfall mist23244 unitsNothing more.
Falling leaves485 unitsNothing more.
A portal11656 unitsOne attractor.
Dust in a shaft of light1283 unitsOne Freeform light.

The count alone misleads. Chapter 15’s rule is that a phone pays for pixels, so the explosion’s smoke and the portal’s runes cost more than all the snow, though they are a few dozen particles beside its 420. When you lift a recipe, read its Largest particle first, and thin the big soft ones before the small ones.

Check it works