-
Notifications
You must be signed in to change notification settings - Fork 307
TileMapLayers and TileSets
The layout and landscapes of the levels in Threadbare are primarily built out of a stack of TileMapLayer nodes. Each layer contains a different type of terrain or decoration, rendered on top of the layers below. As well as determining the level's physical appearance, certain tiles contain physics and occlusion layers that affect where the player-character can walk, where projectiles can float without bouncing, and where guards' torchlights can shine and detect the player-character.
We have different TileSet resources for different kinds of landscape features, all stored in the res://tiles/ folder:
| Resource filename | Purpose |
|---|---|
| bridges.tres | Bridges, and shadows under bridges |
| decoration.tres | Decorations to place on top of cliffs |
| elevation_2.tres | Cliffs |
| elevation.tres | An older cliff TileSet which is harder to use. This will be removed once all scenes are updated to use elevation_2. |
| exterior_floors.tres | Grass, dirt, and sand |
| foam_2.tres | Foam, for where land meets water |
| shadows.tres | Shadows cast by cliffs |
| void_chromakey.tres | The Void, a starry backdrop of nothingness. This TileSet must be used together with a shader; see below. |
| water.tres | It's wet. |
Tip
If you are making a StoryQuest, the Create StoryQuest from Template… tool makes copies of all the tilesets listed above into the tiles/ subfolder of your StoryQuest folder.
Visually, there is only one water tile: a solid blue square. This tile has a physics shape in the non_walkable_floor layer that blocks the player from walking across it, but allows projectiles to cross it. Together with cliffs, this is the main way that we block out levels in Threadbare.
There are two alternatives of this tile, which you can choose between when drawing water:
They differ in the shape of their Physics Layer 2 (non_walkable_floor). While the base tile is fully covered on this layer, the first alternative has no physics, and the second is only non-walkable on its bottom half. It is a little hard to see in the TileSet editor because Godot draws the collision shapes in blue, and water is also blue:
The purpose of these alternatives is to make bridges work. You can see all three tiles in Fray's End. In the screenshot below, the tiles marked with a yellow box use the first alternative (no collision shape), so that you can walk across the bridge; while the tile marked with a red box uses the second alternative (collision shape at the bottom), so that you can walk up to the end of the bridge but no further:
Making a bridge can involve 5 or more layers working together:
-
Water: use thewater.tresTileSet. Use the appropriate alternative tile for the water tiles under the bridge; and use the base water tile elsewhere so that the player cannot walk over the water. -
Shadows: for horizontal bridges, use thebridges.tresTileSet, and draw shadow tiles under the appropriate square. -
Stone: if the bridge is above sea level, use 1 or more layers with theelevation_2.tresTileSet to draw the raised stone. Like water, you must use the appropriate alternative tile where the bridge meets land, so that the player can walk across it. -
Grass/Paths: generally you will use one or moreexterior_floors.treslayer to draw grass, dirt, and paths layered upon each other -
Bridges: usebridges.tresand draw the actual bridge.
Whenever water meets land (or stone) you should use a Foam TileMapLayer, with the foam_2.tres TileSet, to draw foam. Place one tile of foam underneath the land/stone.
When the land is raised, bear in mind that the fake perspective means that the (invisible) top cliff meets the water 1 tile further down than the edge of the visible land. Look carefully at the island in this screenshot for an example:
Consistently add shadows below cliffs. Add a Shadows TileMapLayer, with the shadows.tres TileSet. One per cliff elevation.

The PNG asset for the void_chromakey.tres TileSet looks like this:
In-game, it looks very different: it's a starfield that does not move when the camera moves, implying the stars are a great distance away:
This effect is achieved by configuring void_chromakey_material.tres as the TileMapLayer's Material. This material uses a shader to replace the red area of the texture with the starfield.