Skip to content

Tutorials · Worlds and Levels · Chapter 1

Block it out

45 minutes Uses: Shape

By the end

  • The starter open in the editor: the vale, the pilgrim, his camera and the chapel door, and nothing to stand on
  • Eight sorting layers, Sky to Words, named back to front in the Project settings window
  • Six Blocks where he walks, each a Shape and a Collider sized as one by its handles, and twenty Shapes where he does not
  • The vale walked end to end on grey, from the hut to the chapel door, with no leap
On this page

The vale you start from

Worlds and Levels builds one level, Hollowmere, seen from the side: a vale ten screens wide, from a hut at its west end to a chapel at its east, and a crypt under the chapel. A pilgrim walks it. Nothing in it is made yet. This chapter blocks the whole vale out in grey, and each chapter after it replaces grey stand-ins with the real thing, so the vale can be walked end to end at every step.

The starter is worlds-and-levels.zip. It holds the project, its two scenes, the vale and the crypt, the chapel door’s script, the pilgrim and every picture drawn for the tutorial. The five pictures and the font that chapters 2, 6, 7, 10 and 14 ask you to download are not in it.

  1. Download the starter and unzip it somewhere outside your other projects. You get one folder, worlds-and-levels.
  2. Open Rengy. In the launcher, choose Open project… and pick the worlds-and-levels folder.
  3. The editor opens the project’s startup scene, scenes/vale.ron. Press Look through in the toolbar: the Viewport shows the vale through its camera, as the game will.
The editor on the starter’s vale, looking through its camera: the pilgrim standing alone in the middle of a slate-blue field with nothing under his feet; the Hierarchy lists vale with pilgrim, camera and chapel-door and nothing else; nothing is selected
The starter’s vale, looked through: the pilgrim, and nothing else.

One unit is one art pixel, and y grows downward: the vale’s walking line is y 0, and a place above it has a negative y. The vale is 3200 units wide, ten screens of 320, and the pilgrim walks it at 160 a second. Its nodes:

NodeWhat it isWhere
pilgrimhim: his clips and their State Machine, and a Character Body the keys drive96, 0, his feet
camerahis camera, 320 by 180 of the vale at four screen pixels to a unit, with a rig that follows him96, -24, 24 above his feet
chapel-dooran Area 32 by 48 whose script takes him down into the crypt3040, 0, the vale’s east end

He walks with A and D or the arrow keys, and leaps with Space, W or the up arrow. The crypt, scenes/crypt.ron, holds the same: him at 64, 0, where chapter 2’s stair will rise, his camera, and nothing else.

  1. Press Run game. The game opens in its own window, 1280 by 720, on the vale. Close the window when you have seen it.
The game: the pilgrim stands in a slate-blue sky with nothing under him, drops at once, and keeps falling, his camera following him down so that he sinks to the bottom edge of the picture and stays there
With nothing built, he falls. Watch him drop the moment the game starts: nothing is under his feet, and his camera follows him down.

A second in, his feet are past y 400, straight below where he stood, and he is still falling. The camera stands at his framed point from the first frame, so it has nothing to catch up on; it follows him down into nothing. The first thing to make is something to stand on.

Grey boxes first

A level designer blocks a level out before any art exists: a box for every floor, wall and thing, in grey, so the level can be walked, its distances felt and its pieces moved while moving them still costs nothing. + Add node has two presets for it. A Shape draws an untextured rectangle, circle or capsule and holds nothing up. A Block is a Shape and a Collider of one size: what you see is what he stands on.

Reach for a Block wherever he walks, and a Shape wherever he does not. Later chapters replace the grey with the tool each thing wants: tiles for the buildings, painted from a grid of art (chapters 2 to 4); a Sprite Shape for the hills, a curve with edges (chapter 5); a Polygon for the mere, a flat outline (chapter 6); a Mesh for the sky, a shape you colour and map yourself (chapter 7); and a MultiMesh for the meadow, many copies of one shape (chapter 8).

The sorting layers

Front and back are the Sort Layer first. Every node that draws stores one, a number, and a higher number draws in front; the project names the numbers. The starter names one, Default. Hollowmere uses eight, named once, back to front, and never reordered.

  1. Choose File → Project settings… and click its Layers tab.
  2. Double-click the Default row’s name, type Sky, and press Enter.
  3. Click the box beside Add layer, type Far, and press Add layer. Add Back, Water, Ground, Props, Figures and Words the same way, in that order, each in front of the last.
  4. Close the window.
Project settings on its Layers tab: the dim note Each name labels a Sort Layer number: its place in this list, counted from 0 at the top; the line Back of the scene at the top, nearest the camera at the bottom; the rows Sky, Far, Back, Water, Ground, Props, Figures and Words, ids 0 to 7, each with a delete button and up and down arrows; the empty box beside Add layer; and the line Saved to worlds-and-levels/sorting-layers.ron
The eight sorting layers, back to front.
NumberLayerWhat stands on it in this chapter
0Skythe grey sky
1Farthe sun
2Backthe hut and the cliff
3Waterthe mere
4Groundthe ground, the ravine’s walls, the bridge and the chapel’s floor
5Propsthe meadow, the carts, the stalls, the banner and the signposts
6Figuresthe pilgrim
7Wordsnothing yet: chapter 10’s words

The names are written to sorting-layers.ron; the project file is left as it was. A node stores the number, not the name. The starter’s pilgrim was already at 6, so he is on Figures from now on without being touched. And moving a node up or down the Hierarchy never brings it in front of a node on a later layer.

The Layers tab’s rename
A double-click on a row’s name makes it a field: type, and press Enter. It renames the layer for every node at that number, since nodes keep the number.
The Layers tab’s Add layer
Adds the name typed in the box beside it as a new row at the bottom, with the next number, in front of every row above it. The rows’ arrows and bins reorder and remove, and draw nothing differently: each node keeps its number and shows whichever name is at that place now. Hollowmere never uses them.

A Block where he walks

The ground first. He walks the vale on one slab of grey, 320 deep, with the ravine cut out of it near the east end and bridged level, so D alone takes him from the hut to the chapel door. That is six Blocks, every one hung from the middle of its top, so its node is on the walking line.

  1. In the Hierarchy, select vale. Press + Add node: the menu says Add child of vale. Choose Block.
The starter’s Hierarchy, vale selected over pilgrim, camera and chapel-door, and the Add node menu open under it: Add child of vale lit, Add as root, a box to type a filter, and the presets Node, Sprite, Shape, Block, Animated Sprite, Camera, Collider, Area, Character, Pixel Perfect Camera, Camera Rig, Light and Light Shader, the pointer on Block
+ Add node with vale selected: Block, beside Shape.
  1. Rename it ground-block-west: double-click its row in the Hierarchy, or press F2, then type the name and press Enter. Every later rename is done the same way.
  2. In the Inspector’s Node section, set Position to 912 and 0. Click a number to type into it, and press Enter.
  3. Press Snap in the toolbar. The grid beside it reads grid 16.
  4. Press Q for the Select tool. Drag the small ring at the Block’s middle, its anchor, up to the middle of its top edge: Snap puts it there, and the Shape’s Anchor reads 0.5, 0.
  5. Drag the Block’s bottom-right corner to 1888, 320. The strip under the Viewport reads its size, 1952.0, 320.0: the anchor keeps the Block centred on its node, so the left edge goes out to -64 with it.
  6. In its Shape, set Outline to 1, Outline Color to 0.25, 0.25, 0.28, alpha 1, and Sort Layer to Ground. When you click a colour, if the button at the top left of the picker reads U8, press it so that it reads F: each channel then runs from 0 to 1, as this tutorial gives every colour. Color stays the preset’s grey, 0.5, 0.5, 0.5.
bridge-block selected and framed at 513%: one blue outline round the grey bridge between the ravine’s two walls, a ring at the middle of its top edge and two small square handles at its bottom corners; the Inspector shows its Collider: Kind Rectangle, Size 160.0 and 16.0, Offset 0.0 and 8.0, Solid ticked
A Block, the bridge: one outline and one set of handles for its Shape and its Collider.

A Block’s Shape and Collider are one box. The Collider’s size is the Shape’s, and its offset is the Shape’s middle: 0, 8 on the bridge, half its 16 below a node hung from its top. While they match, the Viewport draws them as one outline with one set of handles, and a drag writes both. The bridge shows two corners, its bottom two: the anchor on its top edge pins the top two, so they are no handles.

Drag the anchor with the Select tool. A fresh editor starts on the Move tool, and under it the ring sits under the gizmo’s middle square, which takes the drag; the corners work under every tool. Make the other five Blocks the same way, each a child of vale:

NodePositionBottom-right cornerSize
ground-block-west912, 01888, 3201952 × 320
ravine-block-west1904, 01920, 32032 × 320
bridge-block2000, 02080, 16160 × 16
ravine-block-east2096, 02112, 32032 × 320
ground-block-east2656, 03200, 3201088 × 320
chapel-block3040, 03200, 16320 × 16

All six have Anchor 0.5, 0, Sort Layer Ground, the grey, and an Outline of 1 in 0.25, 0.25, 0.28. Every corner is on the 16 grid, and every top is the walking line: the ground runs from x -64 to 3200 with the ravine’s 160 cut out of it, bridged level, and the chapel’s grey floor lies on the east ground’s top. Nothing he walks on rises above y 0.

Block
A preset of + Add node: a Shape and a Collider of one size on one middle, 64 square and grey as it comes. What is drawn is what he stands on.
The Block’s linked handles
While its Shape and Collider match, one outline and one set of handles for both. A corner writes the Shape’s size and the Collider’s size and offset together; the anchor ring writes the Shape’s anchor and the Collider’s offset; each drag is one step to undo. A size typed into either, or the node turned or scaled, parts them, and each shows its own handles again.
Snap
The toolbar’s toggle, off as the editor opens. With it on, a drag puts a node or a corner on the grid, 16 units as it comes (grid 16 beside it sets the spacing); a turn snaps to 15°; and an anchor ring snaps to its shape’s edges, thirds and middle.
The anchor ring
The small ring a Shape draws at its anchor while it is selected. Drag it with the Select tool, Q, to move the anchor; under the Move tool, W, it sits under the gizmo’s middle square.

A Shape where he does not

Everything he walks past and does not stand on is a Shape alone: the sky, the sun, the hut, the cliff, the mere, the meadow, the carts, the stalls, the banner and the four signposts. A Shape draws and holds nothing up, so its values are typed: there is no Collider to keep in step.

They go under the six Blocks, each a child of vale, in the order of the table: the sky and the sun first, then the hut. Each is named …-block, so the made thing that takes its place in a later chapter can take the plain name, and each is grey with an Outline of 1 in the darker grey, but the sun. All are Rectangles but the sun, a Circle, and the carts, Capsules. A signpost’s post goes under its board, as the board’s child.

NodeSort LayerPositionAnchorSize
sky-blockSky1600, 00.5, 13584 × 400
sun, a CircleFar600, -800.5, 0.540 × 40
hut-blockBack96, 00.5, 1128 × 96
cliff-blockBack1200, 00.5, 1256 × 160
mere-blockWater1200, 00.5, 1320 × 28
meadow-blockProps1640, 00.5, 1400 × 12
cart-block-1, a CapsuleProps2300, 00.5, 148 × 32
cart-block-2, a CapsuleProps2340, 00.5, 148 × 32
cart-block-3, a CapsuleProps2420, 00.5, 148 × 32
stall-block-1Props2560, 00.5, 164 × 56
stall-block-2Props2650, 00.5, 164 × 56
banner-blockProps2480, -1120.5, 0128 × 48
sign-hutProps240, -320.5, 0.540 × 16
sign-hut-post, under sign-hutProps0, 32 in it0.5, 14 × 24
sign-mereProps980, -320.5, 0.540 × 16
sign-mere-post, under sign-mereProps0, 32 in it0.5, 14 × 24
sign-marketProps2180, -320.5, 0.540 × 16
sign-market-post, under sign-marketProps0, 32 in it0.5, 14 × 24
sign-chapelProps2820, -320.5, 0.540 × 16
sign-chapel-post, under sign-chapelProps0, 32 in it0.5, 14 × 24
  1. For each row in turn, select vale, or a post’s board, press + Add node and choose Shape. Rename it, and set its Position. A post’s is in its board’s own units: the board’s middle is 32 above the walking line, so at 0, 32 the post stands on it.
  2. In its Shape, set the Kind where the table names one, and Size, Anchor and Sort Layer from the table; Color 0.5, 0.5, 0.5, alpha 1, Outline 1 and Outline Color 0.25, 0.25, 0.28, alpha 1.
  3. The sun is the one in colour: Color 1, 0.93, 0.7, alpha 1, Outline 3 and Outline Color 1, 0.98, 0.9, alpha 1, a paler ring 3 wide inside its edge.

The hut, the third, shows a Shape’s rows: Size 128, 96, and Anchor 0.5, 1, so it stands on its foot, the middle of its bottom edge, on the walking line; on Back.

The Inspector with the word shape typed in its search box: hut-block, 7 of 19 rows, and its ShapeComponent: Kind Rectangle, Size 128.0 and 96.0, Anchor 0.5 and 1.0, a light grey Color swatch, Outline 1.0, a darker grey Outline Color swatch, Sort Layer Back and 2, then Add component
The hut’s stand-in. The search box at the top of the Inspector, here shape, shows only the rows that match.
The Shape’s Kind: Rectangle, Circle or Capsule
What it draws. A Rectangle fills its size; a Circle is the largest circle inside it; a Capsule is a rectangle with round ends on its longer side, the carts’ shape. Rectangle as it comes.
The Shape’s Size
Its width and height in units, before the node’s scale. 64 by 64 as it comes.
The Shape’s Anchor
The point of the Shape that stands on its node, from 0, 0, its top-left corner, to 1, 1, its bottom-right; 0.5, 0.5, its middle, as it comes. A thing that stands on the ground has 0.5, 1, its foot; a Block he walks on has 0.5, 0, so its node is on the walking line.
The Shape’s Color
Its fill. Every stand-in is the same grey, 0.5, 0.5, 0.5, but the sun; a lower alpha would make it see-through.
The Shape’s Outline
A line drawn inside its edge, this many units thick; 0, as it comes, draws none. It follows the Kind: four bars round a Rectangle, a ring round a Circle or a Capsule. A round Shape with an outline is drawn as a mesh, which matters to its sorting: see the sun, below.
The Shape’s Outline Color
The outline’s colour. A darker grey on every stand-in, so grey boxes that touch still read apart.
The Shape’s Sort Layer
The sorting layer it draws on, chosen by name, its number beside it. A higher number draws in front, whatever the Hierarchy’s order. Sky, 0, as it comes.

The grey vale

  1. Press Ctrl+S. Select vale, move the pointer over the Viewport and press F to frame it.
vale selected and framed at 22.9%: a long grey band of sky over the walking line, the grey ground under it with the ravine cut out of it near the right and bridged, the small pale sun, and thin outlines on the grey where the hut, the cliff, the mere, the carts, the stalls and the signposts stand; the Hierarchy lists vale with pilgrim, camera, chapel-door and the stand-ins from ground-block-west down
The whole vale in grey, the twenty-six stand-ins.

The grey sky ends at the walking line, so the ravine shows the camera’s Background under the bridge. The sun is the one stand-in in colour, its ring 3 wide inside its edge:

A part of the game: the sun, a pale gold disc with a paler ring of even width round its edge, in the grey sky
The sun in the game: its ring is as wide all round.

The sun is on Far, not on Sky where it belongs by sense, because of how it is drawn. A round Shape with an outline is drawn as a mesh, and on one Sort Layer a mesh is drawn before a box it ties with: on Sky the grey sky’s box, drawn after it, would cover it. Far is in front of Sky, so the sun is drawn after the sky, whatever the Hierarchy says. Front and back are always the Sort Layer first.

What collides, what draws, what sorts

Every kind of thing this tutorial draws answers the same three questions differently, and each chapter asks them of its own. Of the grey stand-ins:

  • What collides: a Block, through its Collider. A Shape alone collides with nothing.
  • What draws: both, their fill and their outline.
  • What sorts: the Sort Layer first; on one layer, a round outlined Shape, a mesh, before a box. Never the Hierarchy.
mere-block selected and framed at 256.5%: its thin outline on the walking line in front of the cliff’s grey; the Inspector lists its Node, its Metadata and a ShapeComponent, Kind Rectangle, Size 320.0 and 28.0, Anchor 0.5 and 1.0, Outline 1.0, Sort Layer Water and 3, and no Collider
The mere’s stand-in: a Shape, and no Collider.

Put him 60 above the middle of the mere and he falls straight through it and lands on the ground beneath, at y 0. The mere is drawn and holds nothing up, as the real mere will: he walks past it, not on it.

Walk the vale

  1. Press Run game and hold D.
The game: the pilgrim runs east from in front of the hut’s grey outline over the grey ground, past a signpost and under the sun, and the view follows him, the walking line level across the picture
The grey vale, walked. Watch the walking line: the view follows him east over the grey ground, past the hut’s grey box, a signpost and the sun, his feet on the walking line all the way.

Held all the way, D takes him to the chapel door within 25 seconds. His feet never sink under the walking line, over the bridge and onto the chapel’s floor too, and no seam between two Blocks stops him or turns him back: at the door, the game changes to the crypt, where he falls, for nothing is built there yet. Chapter 2 gives it a floor.

The stand-ins

WhatComponentFieldValue
The projectLayers tabrowsSky, Far, Back, Water, Ground, Props, Figures, Words
Every stand-in but the sunShapeColor0.5, 0.5, 0.5, alpha 1
Outline1
Outline Color0.25, 0.25, 0.28, alpha 1
The six BlocksShape, with its ColliderAnchor0.5, 0, by the ring
Sizeby the corners, with Snap on
Sort LayerGround
sunShapeKindCircle
Color1, 0.93, 0.7, alpha 1
Outline, Outline Color3; 1, 0.98, 0.9, alpha 1
Sort LayerFar

Check it works