Portponky / better-terrain

Terrain plugin for Godot 4
The Unlicense
473 stars 23 forks source link

Transition between terrain types inside category #93

Closed pawel-marciniak closed 1 month ago

pawel-marciniak commented 1 month ago

Hi,

I'm using your great plugin for my 2D game. It helped me a lot, especially categories functionality. I have a question tho - is there a way to make some smooth transition between terrains in category? I mean for example in case from your video tutorial - two types of blobs, one yellow, other one pink and let's say I would like to make some smooth transition when one terrain changes into another, like gradient.

Best regards, Paweł

Portponky commented 1 month ago

Do you have an example tileset you would use for this? There are a number of ways of doing it. For example, the yellow blobs could have some tiles with a pink gradient edge, and then it could be set up to place those in bordering cells.

Remember even if two terrains share a category and can connect with that, you can still use specific connectors too. So you can have a tile that connects to the 'blob' category (either yellow or pink) on some edges, but only connects to, say, the yellow blob on another edge.

pawel-marciniak commented 1 month ago

Thanks a lot! I think I understand, more or less ;) I'm pretty fresh in Godot, so I will need to figure it out, but it's enough to know that it's possible with this plugin :) I'm trying to create river, with different levels of depth, each depth with slightly brighter color. I'm using some standard tileset, I will need to modify to my needs for sure. image

the-old-one commented 1 month ago

Awesome! I've had the same question.

Portponky commented 1 month ago

So there's a number of ways to approach this. I would not attempt to draw connections between every tile type, because very rapidly you will need hundreds of different tiles. Instead I would use as many tricks as possible to build up a scene with very little effort. Here's an example using 32 tiles only.

https://github.com/Portponky/better-terrain/assets/33663279/9865b570-d3c2-445f-9466-6efe8910c18a

Edit: the video didn't capture my mouse pointer - oops

First of all I'd use layers. Layering gives you really cheap tile composition and it is one of the most powerful tools you have. Here I have a ColorRect for a general water colour in the background. The tilemap has two water layers which are modulated with different kinds of transparent blue. The water tiles are white, so they only become blue when placed in this layer. This allows me to use the same tiles in different contexts (e.g. swamp, lava, etc..). On top of that there is a 'ground' layer, which contains the grass as well as some animated waves for the water. Animation always makes a game world seem more alive.

Next up, I've used the symmetry tools to reduce the number of tiles needed. No need to copy paste tiles and rotate/mirror them in the editor, we can do that automatically. I forgot to show them in the video but here's the water symmetry setup:

image

For the ground, I kept it simple and used decorations for the borders. That puts a shoreline around every grass tile I place. That means I can focus on making interesting grass tiles without having to make tons of different shorelines. For the example I got pretty lazy and just used one grass tile, and used symmetry again for the shorelines. In practice you might not want to use symmetry for the shorelines, as you might have specific graphical detail that makes them distinct.

Note that the edges of the scene are untidy, but that really doesn't matter. If it's offscreen and the player never sees it, it doesn't matter at all.

So this is an example of how I would build up this kind of scene. It's all about combining different tools and effects. Terrain is useful, but it is only one of these tools. Hope this helps.

pawel-marciniak commented 1 month ago

Thanks a lot! This is massively helpful!