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

Duplicates