Skip to content

Spooky Action at a Distance Games

devlog

  • Blog
  • Game: Stepsons
  • About us

Month: September 2024

The traditional first enemy: a rat. Our rats are descendants of lab rats that escaped during The Event.

Posted on 2024-09-242024-10-02 By Timophiy
Uncategorized

We got animated doors! #pixelart #gamedev

Posted on 2024-09-242024-09-24 By Timophiy
Uncategorized

Walk in a “forest”: good hunt!

Posted on 2024-09-14 By hugh
Uncategorized

Walls and y-order in Tiled maps

Posted on 2024-09-14 By hugh

This post talks about 2d maps created in Tiled, and how we implemented walls and
Y-order. You may think about it as Z-order, but as our maps are flat, we only need to arrange things by their Y coordinate.

On thin walls in Tiled

How do I know which tile in Tiled is passable, and which is not?

Especially that we have such a luxury as thin walls.

My answer is Tiled feature – Terrains (https://doc.mapeditor.org/en/stable/manual/terrain/),
AKA Wang tiles (a good article for gamedevs: https://dev.to/joestrout/wang-2-corner-tiles-544k).

If a side of a tile has a terrain named “wall”, it’s not passable – as simple as that.

This way, our level designers don’t have to mark up the map – the walls are already in the tileset.

On Y-order

So, our objects (and object layers in Tiled) do have Y coordinate, so we know in what order
to draw them.

But what about tiles on a map?

What if our maps have multiple complex layers, maybe even a tree of layers?

What if these layers have similar objects with different Y coordinates, like multiple trees
or pillars or whatever?

Shall the level designer split each object into a separate layer and assign it a Y-order property?
This sounds like too much manual work, prone to error.

Our answer is – automatically split layers into “island” segments, and internally set
each segment’s Y-order according to the lowest tile (with the highest Y).

3 segments for 3 trees on a single layer, with a different Y-order

The next step is to only assign Y-order to segments based on the walls
assigned to tiles of that segment. The engine reasonably assumes that
a wall is on a floor level, and everything above it is fluff – tree top,
wall bottom, and so on.

Think of a door mat:

This is more precise, because sometimes our wall tiles have tiles
both above and below them.

Uncategorized
  • May 2025 (1)
  • April 2025 (7)
  • March 2025 (8)
  • February 2025 (7)
  • January 2025 (1)
  • December 2024 (6)
  • November 2024 (8)
  • October 2024 (3)
  • September 2024 (4)
  • August 2024 (2)
  • July 2024 (1)
  • March 2024 (1)
  • November 2023 (2)
  • October 2023 (1)
  • August 2022 (1)
  • July 2022 (2)
  • August 2021 (2)
  • July 2021 (1)
Log in
  • Discord
  • Twitter
  • TikTok
  • Reddit
  • Facebook
  • YouTube
  • Instagram

Copyright © 2025 Spooky Action at a Distance Games.

Powered by PressBook Dark WordPress theme