Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

I have trouble understanding how actually you draw your map. i.e. which cells are on and which are off.


 My understanding is that the middle of each cell represents the wall itself, and 8 minisquares around it are the presence or not of the neighbours.  So yeah, northen and southen horizontal walls would be the same because both, the void and the floor are marked as empty on above and below the wall. Like A (blue) in pic above: you have wall to the left, and right, nothing up, down and corners.

B (green) is in the other hand void/floor is to the top, but there are wall to the bottom.

(1 edit)

I might be missing something but how I see the wall layer, is that this particular tile maches A rather than B.

(1 edit)

> So it sounds like I might need to render the floor as one sheet and walls as another?

Damn, yeah; this is the misunderstanding. This was my intention: walls and floors on separate layers.


Compare: "When you want to draw the floor" and "When you want to draw the walls" in https://github.com/godotengine/godot-docs/issues/3316#issuecomment-614923124 and you'll see how only one of them resables our walls.

hmm… so my interpretation is white = void and pink = dungeon.

so the cell (a 3x3) that’s full-pink = inner cell/floor.  a full white cell is void.

The north wall (green) states “select me if I am dungeon and am surrounded by dungeon cell on W,SW,S,SE & E as well as having void to the NW,N & NE”

The south wall is essentially the opposite; void to the SW,S,SE and dungeon everywhere else.

Blue is for a dungeon cell surrounded by void to the full north and south.

The reason I do it like this (and it’s my interpretation of it) is because when you fill in any shape it calcs all the walls out correctly… this includes the code I have to fill in the map by setting all the “dungeon” cells. Its very simple to do this approach in code  

However it sounds like in need two layers - one to fill in just the edges/corners on an upper layer and another under it for the inner layers for the floor? Or maybe floor is everything and the “under wall” tiles are partially transparent?

(2 edits) (+1)

I see.

Why, the tiles are wall/no-wall rather than dungeon/non-dungeon.

For the later we'd have to redraw the tiles.

Alternatively you can figure out which cell is an edge in a separate step - each cell that has any dungeon neighbour that is a non-dungeon would be a wall; set them on a separate layer.


---

> However it sounds like in need two layers - one to fill in just the edges/corners on an upper layer and another under it for the inner layers for the floor?

I think this is consistent with what's in my head:

- LAYER ABOVE: walls
- LAYER BELOW: floors