Portponky / better-terrain

Terrain plugin for Godot 4
The Unlicense
433 stars 21 forks source link

Help understanding categories #76

Closed no-na closed 4 months ago

no-na commented 4 months ago

Hello, I have two categories, with my half-cube tiles in the purple category and my full-cube tiles in the blue category. image

I am having issue with my 'full-flat' terrain, which is a member of the blue full-cube category. There are four tiles in this terrain. image

I've set up their connecting types within the full cube category like this, so that outlines appear along the northern edges of the continuous terrain, and when painting, it appears as expected. image image

But when I add their connecting types to the half cube category, it causes ambiguity when painting, even though no half cube category terrains are present. image image

Do you know why this is happening, and what I should be doing instead? My goal is to be able to get this look: image

Thank you for this plugin and any advice you can give!

Portponky commented 4 months ago

Hi, this is quite a complicated setup, so I'm not sure I fully understand what is going on. I think I see what the problem is, which is to do with how multiple peering bits are applied. If I understand it right, these are the peering bits for one of the flat tiles for both categories:

image

This means it will look for purple matches in NW and NE, and it will look for purple or blue matches in SW and SE. If any of these matches aren't present, it will score negatively, and if they are present, it will score positively. Unset peering bits are not scored.

First up, you don't need to match SW and SE because they don't affect the tile choice.

Second, you don't need to match against half-height tiles, because whether they are present or not shouldn't change which tile is chosen.

For the half height tiles, you should match both blue and purple in the NW and NE directions where appropriate.

I'm not sure how this will affect the different sloped pieces, let me know how you get on.

no-na commented 4 months ago

Thanks for explaining! I got it working now: image