Motion
Get Motion
Vent Garden, a still

DocsExample scenesParticles and 3D

Example scene · Particles and 3D

Vent Garden

Bubbles and glowing spores rise from vents on the deep-sea floor, jostling as they go and gathering under an overhang of rock before they slip round it. A click lets a burst go from the nearest vent. It's dark, green and quiet.

Advanced13 layersA scriptHeaviest layer: Picture or video, heavy

Main feature: Objects and templates, with physics. Also uses: Logic as code (a TypeScript script spawns them), The pointer, clicks and time (a click lets a burst go), Sound (a beat lets a few go), Effects and masks (heat haze over the vents), Layers and folders.

What you'll learn

  • How templates work: each is a picture layer for its look and a circle body, with its own size, weight and bounce, and the script makes as many objects from them as it likes.
  • How physics can run upside down: the scene's gravity points up, so everything rises, and fixed bodies give the bubbles rock to pile up under.
  • How objects get behaviour: fading out with age or on a hit, and bursts on a click or a beat.

How it's built

The layers, bottom to top: Deep water, Far water, Glow of the vents, Living light, Specks in the water, Vents, Haze over the vents, Small bubble, Bubble, Big bubble, Spore, Near specks, Finish.

  1. The water: Deep water, a Gradient, Far water, Fog and clouds, Glow of the vents and Living light, Glow orbs, and Specks in the water, Motes.
  2. Vents is vents.png, a picture (Picture or video) of the chimneys, their glowing mouths and the overhang, as silhouettes against the water. Haze over the vents shimmers above the chimneys.
  3. Templates. SmallBubble, Bubble, BigBubble and Spore are templates: each is a picture layer for its look (Small bubble, Bubble, Big bubble and Spore) and a circle body, with its own size, weight and bounce. The script makes as many objects from them as it likes.
  4. Physics, upside down. The scene's gravity points up (pick Scene and open Physics: Gravity (2D, down) is -240), so everything rises, and a little to the right (Gravity (2D, right) is 18), so they drift with the current. Linear damping keeps them slow, as in water. The overhang is four fixed circles, the chimneys are fixed boxes, two tall fixed boxes keep them in at the sides, and there's a fixed "surface" far above: the bubbles pile up under the overhang, slide round it, and fade when they reach the surface.
  5. Objects with behaviour. Each object fades out after half a minute or so, or when it hits the surface (the script's onHit); past 140 at once, the oldest fades. A click finds the nearest vent and lets a burst of fourteen go; each beat of the music lets four go from the middle vent.
  6. Near specks, more motes, and Finish, an Adjustment layer, go on top.
Picture: Vent Garden up to step 1, showing Deep water, Far water, Glow of the vents, Living light and Specks in the water
Step 1
Picture: Vent Garden up to step 2, showing Deep water, Far water, Glow of the vents, Living light, Specks in the water, Vents and Haze over the vents
Step 2
Picture: Vent Garden up to step 3, showing Deep water, Far water, Glow of the vents, Living light, Specks in the water, Vents, Haze over the vents, Small bubble, Bubble, Big bubble and Spore
Step 3
Picture: Vent Garden up to step 4, showing Deep water, Far water, Glow of the vents, Living light, Specks in the water, Vents, Haze over the vents, Small bubble, Bubble, Big bubble and Spore
Step 4
Picture: Vent Garden up to step 5, showing Deep water, Far water, Glow of the vents, Living light, Specks in the water, Vents, Haze over the vents, Small bubble, Bubble, Big bubble and Spore
Step 5
Picture: Vent Garden up to step 6, showing every layer
Step 6

vents.png, bubble.png and spore.png are in the scene's Assets panel (Alt+3). The rock in vents.png is drawn where the fixed bodies are, so the bubbles meet it where you see it: move a fixed body and move the rock in the picture with it. The scene's script is TypeScript: pick Scene at the top of the Outliner and click Open the editor on its Script card.

Look in Studio

Open it from Studio's start page, under Start from one of Motion's.

  • Open the Outliner: the fixed objects are listed (Overhang 1 to 4, Chimney 1 to 3, The surface, far above, and Left edge and Right edge, which keep them on the screen). The bubbles the script makes aren't: while it plays, the bar under the preview counts them, as so many objects and bodies.
  • Pick Overhang 1 to see a body: under Has a body, it Moves Never, and its Shape and Radius match the rock in the picture. The four templates' looks are the Small bubble, Bubble, Big bubble and Spore layers, hidden while the scene plays; each object made from a template gets a copy.
  • Open the script (pick Scene at the top of the Outliner and click Open the editor on its Script card): Garden lets bubbles go from each vent at its own pace; Rising is what every bubble and spore does.
  • Pick Scene and open Physics: Gravity (2D, down) is below zero, so it points up, and Gravity (2D, right) is the current.

Make it yours

  • Set Gravity (2D, down) to 600 in the scene's Physics and add a floor (an object with a body that Moves Never: a wide Box along the bottom). It becomes a fountain of falling glass beads.
  • Turn Gravity (2D, right) up to 300 for a strong current: the bubbles lean to the right as they rise and crowd into the top right-hand corner.
  • Tint the spores: pick the Spore layer, the template's look, and add a Tint effect. Every spore made from it has it too.
  • Add a fifth fixed circle to the overhang (duplicate Overhang 4 and move it), then paint the rock into vents.png where it goes: right-click vents.png in Assets, pick Show in Explorer (Show in the file manager on Linux), and open it in your image editor.

Settings people can change

SettingWhat it does
How often the vents breatheSeconds between bubbles, more or less
Haze over the ventsThe shimmering haze above the chimneys
Specks in the waterThe drifting specks behind
Glow of the ventsHow brightly the vents light the water
BloomHow much the bright parts bloom over everything
Ask about this page on the forumAsk a question in Help