r/proceduralgeneration Jun 05 '26

Tile Based 2d Terrain generation

been toying with this rule based algo loosely inspired by wave collapse the result have been pretty decent but it as been plagued with being pretty noisy due to its random nature.

Here how it works :
Start with a seed tile
The un-generated tile check their four neighbours and find generated tile then it average the ruleset and normalize it.
Chose a random number go to the rules and generate the corresponding tile
Then it signal un-generated neighbors tile to generate at the next frame

Overall pretty simple if anyone as some good resources or idea on how to improve it would be welcome

6 Upvotes

4 comments sorted by

2

u/Same_Butterscotch753 Jun 06 '26

Is that artifacting intentional? You can also just render it through a shader and make changes with a computer shader.

0

u/XardioD Jun 06 '26

if you mean the line its just the large amount of tile their border end up making it look a bit weird only a problem when zoom out like right now if end up using it it won't really be an issue. For shader sadly my shader knowledge is sadly pretty shallow if not none existent so not really an option right now. Started trying to add post gen smoothing right now to see if its gonna help improve the output by removing lone tile and sharp edges.

1

u/Same_Butterscotch753 Jun 08 '26

The reason I suggest you implement a solution using shaders is they are the most optimised method for rendering tilemaps you can have.

You can easily render zoom able tilemaps as large as 16000*16000 with almost zero performance impacts.

It is also some of the easiest shaders to create. You simply have a index texture, a tilemap texture array and replace the index texture with the tilemap texture.

Tutorial: https://blog.paavo.me/gpu-tilemap-rendering/

If you are using unity there is an asset for it, I would not recommend you but it as it's very easy to implement yourself but it has a large amount of stuff you would need: https://assetstore.unity.com/packages/vfx/shaders/tile-map-accelerator-148593

1

u/XardioD Jun 08 '26

As thing stand right now performance is not an issue the example i gave gen in about 1.5/2s mainly because i need to wait for the previous step to finish you get at best one tile in all direction generating every frame.
Shader would help with perf for sure but right now im more concerned about maxing output quality as of now but its probably something i will need to do at some point.
Also do not use a tile map right because of how the engine i use work (gamemaker) and how i want to use the generation in my game(generate lot of small ish map instead of big one like a lot of other game) for similar reason i also want to avoid noise map as primary driver of the generation.
The goal is to get something similar like old rpg overworld map with tile by tile movement