Portponky / better-terrain

Terrain plugin for Godot 4
The Unlicense
509 stars 24 forks source link

95% sure it's not an issue but want to confirm #63

Closed codeSmithDave closed 6 months ago

codeSmithDave commented 9 months ago

First of all, just want to say that I really appreciate the plugin and I'm pretty certain that I am not understanding tilemaps and / or terrain functionality properly but just wanted to check in since googling did not seem to yield much (at least not the keywords I searched).

I am working on procedurally generating a world. The basic landscape (ocean, some biomes) generate well enough and quite fast I would say. 500x300 2D map takes maybe a couple seconds with my machine.

My issue: I am trying to eventually generate some random cities but currently working on setting up some houses with the terrain functionality for autotiling. Currently, I seem to either have no door, or have multiple doors generated. Sometimes only 1 door, but I want to force it to always have 1 door:

image

Like I said before, I am fairly certain that the issue is probably how I am setting up the terrain logic for the door, but I cannot figure out. Would I need to modify a setting in a menu somewhere? Is this functionality available?

Follow-up question, in the image, you see a house with a massive roof, could I do some configuring in the tile Terrain to make it so the house would have a higher wall and a shorter, "more normal" roof?

Portponky commented 9 months ago

The terrain can only check neighboring tiles, which is a design decision for speed/simplicity. That means it can't have logic that covers more than one tile.

In the door example, both the door and the wall fit equally well. In terms of roof size, the terrain can't use logic about tiles 2 or more cells away.

My advice would be to rethink how the terrain works. It's more like a finishing touch to tiles rather than a full system for generation. I would make three terrain types: roof, wall and door. I'd make the wall and door connect together. Then, I would make a function which places a house by assigning most cells to be roof, a row or two at the bottom to wall, and then place a single door somewhere along the bottom row. When calling update, the exact roof, wall and door tiles will be picked automatically.

I know this isn't ideal for your situation but hopefully you can get some good results.