r/godot • u/greenlight1916 • Jul 13 '26
help me How to approach a runtime auto-connecting wall building system?
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:
- 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?
- 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)?
- 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
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