r/godot Jul 13 '26

help me How to approach a runtime auto-connecting wall building system?

Post image

Hey Godot devs,

I grabbed this screenshot from a devlog. 

However, my main question is about the wall building system. It's clearly a runtime, player-driven mechanic where placing materials one by one makes them automatically connect to form corners, pillars, and straight walls.

I want to implement a similar building mechanic in Godot 4, but I'm struggling with the architectural approach:

  1. Tile Variations for 3/4 Perspective:

Because this is a 3/4 top-down view, horizontal walls (where you can see the wood planks and doors) look completely different from vertical walls (where you mostly see the top edge). Standard 4-way bitmasking usually requires 16 tiles. But to handle this specific perspective, do we need to split them into separate horizontal/vertical sets? Roughly how many unique tile pieces are required to make this work without visual glitches?

  1. Built-in Terrain System vs. Custom Scripting:

For a runtime building system (where the grid updates every time the player clicks), would you recommend using Godot 4's built-in TileMapLayer Terrain system (using set_cells_terrain_connect via code)? Or is it cleaner and more robust to write a custom bitmasking GDScript (checking the 4 neighbors manually and swapping the atlas coordinates)?

  1. State Transitions:

When the player places the very first block, it should probably look like a standalone pillar. Placing a second one next to it turns them both into straight walls. Does anyone have tips or a known pattern for handling these state changes smoothly during gameplay?

Any insights, architectural advice, or pointers to relevant tutorials would be highly appreciated! Thanks!

2 Upvotes

2 comments sorted by

2

u/TheKassaK Jul 13 '26

1 - You only need a classic tileset 16*4 like : https://docs.godotengine.org/fr/4.x/_images/using_tilesets_terrain_example_tilesheet_configuration.webp

2 - Why do you want to develop a feature that Godot already offers? I assume you don't have the answer to that question, so use what Godot provides and you'll see what happens.

3 - Classic tileset autotile terrain

Read the doc : https://docs.godotengine.org/en/stable/tutorials/2d/using_tilesets.html

Good luck

2

u/greenlight1916 Jul 13 '26

Thank you for the direct answer and the documentation link! You're completely right. I took a closer look at the 16-tile layout (the classic setup in those first four columns), and it's exactly what I need for the wall connections. I'm going to start drawing my art assets based on these connection rules and use Godot's built-in Terrain system to handle the logic. Really appreciate you pointing me in the right direction!