Portponky / better-terrain

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

Solution for correct tiling between different tilemaps? #73

Closed mickeyordog closed 4 months ago

mickeyordog commented 4 months ago

Hello, thanks for the addon. I was wondering if you know of any solution for the following problem:

image

Here I have two different tilemaps next to each other. However, the trees obviously don't tile properly between them since terrains only work within one tilemap.

Is there any way I can get my tree terrain to treat an empty tile in its tilemap as another tree? This way, my different tilemaps would all tile properly with each other as they assume that any empty space they're touching contains another tree, which I will manually ensure by placing a tree in the adjacent tilemap.

If not, do you know of any other way to solve this problem? Thank you.

Portponky commented 4 months ago

It depends what your terrains looks like. One option would be to make the tree tile that has trees on all sides the base tree tile (no peering bits used), and then just put peering bits for grass or other tiles where you don't want tree connectors. If you can post an example tileset I can give a visual example.

mickeyordog commented 4 months ago

Thanks for the help. Sure, here is the spritesheet for the trees

image
mickeyordog commented 4 months ago

Hi @Portponky , were you still able to help with this?

Portponky commented 4 months ago

Oh, I meant to post some examples but I have been very sick the last couple weeks. I'll see what I can do tomorrow.

mickeyordog commented 4 months ago

All good, hope you feel better. I was actually messing around with it a bit and I found a decent solution. I put the trees in a group along with an empty tile that acts like a tree, then i use that empty tile to surround each separate tilemap and it solved the problem. I’d like to have some way to show the empty tile in the inspector but not in game, but for now seems to work fine.

Portponky commented 3 months ago

Hi, I'm finally a bit better. The three things I was going to suggest were:

1 - A blank tile which acts like a tree, which is what you have done

2 - Make everything that's not a tree into a category. Make the tree tiles only match in their blank areas against the non-tree category. So this is like inverting the way trees work.

3 - Make the trees match against decorations. Decorations are empty tiles, so they can be used as a way to match against empty space. If you are not using layers, this might work very well.

I was going to do examples but I have been too unwell to manage. Apologies!