Portponky / better-terrain

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

Corner Tiles Aren't Correct #54

Closed nightblade9 closed 10 months ago

nightblade9 commented 10 months ago

Hi,

Thanks for making this plugin, it's quite amazing.

I noticed that inner corner tiles (e.g. L shape) with simpler tilesets (e.g. 3x3 set of tiles only) don't tile correctly. I see that this is the case in your intro video, too, with your 4x4 platformer tiles.

Is there an easy way to make corner tiles draw correctly, instead of using the center/fill tile?

image

Portponky commented 10 months ago

With those tiles, that is the best fit. There isn't a different tile that would fit there better.

Adding in the tiles required to fill the inner corners, and expanding the peering bits to match them correctly, gives a good result:

Tileset with 4 additional inner corners

However this tileset also has a lot of situations that aren't handled. A full tileset like this would typically have 47 tiles. Here's a template:

47 tile template

Of course, it's up to you if your game needs every tile.

nightblade9 commented 10 months ago

Hi,

Thanks for the prompt response. If I understand correctly, that set of 9 outer + 4 inner tiles is sufficient? That's similar to what I needed with a different tool that I used for Godot 3.

May I recommend putting something like this in your readme? I found your plugin via assetlib, and even after watching the video, it's hard to get a simple example working.

nightblade9 commented 10 months ago

Can you also show the terrain setup for the inner tiles please, like in my screenshot?

Portponky commented 10 months ago

Thanks for the prompt response. If I understand correctly, that set of 9 outer + 4 inner tiles is sufficient? That's similar to what I needed with a different tool that I used for Godot 3.

It can only make terrain from the tiles it has. If the 9 + 4 works for your use case, then do that. It won't handle every possible way neighboring tiles can connect. For example, it can't handle these:

Examples of missing tiles

However, it depends on your game whether or not that is a problem. If you want to handle all possible cases, you'll need to make 47 tiles like in the template above. Every game is different, so there's not one correct answer for what the ideal tile setup is.

May I recommend putting something like this in your readme? I found your plugin via assetlib, and even after watching the video, it's hard to get a simple example working.

That's a good idea. I should work on updating the documentation with examples of different terrains.

Can you also show the terrain setup for the inner tiles please, like in my screenshot?

It's visible at the bottom of the image. The peering color is orange.

EricDoherty commented 10 months ago

I am having a tough time getting the 47 tileset working. My bit masking looks to match the template, but as you see my results don't work. I am using 48x48 sized tiles.

image
Portponky commented 10 months ago

Are you using tiles larger than the tileset tile size?

Size difference

Using larger tiles is in Godot is a little odd. They might be larger graphically, but they still only take up one cell. If you want stuff to autotile well, ensure that your tiles match the tileset tile size.

nightblade9 commented 7 months ago

My auto-tiles broke again today and the info in this thread wasn't enough to recover my work. So, attached is a sample tileset and map. I hope this will work as a reference for anyone else who stumbles on it.

Sample: sample.zip

Floor: image

Wall: image