#Cellular Procedural Generation for Roguelike Maps!
6 messages · Page 1 of 1 (latest)
The map is designed to be non-circular, no room will lead to a room that you have already previously entered using a different door.
The shape and size of the map can also be easily altered by some variable changes — say if I want to make the map more branch-like, I can increase the weight of up-down and left-right rooms in the random sampling so they will appear more frequently.
This is cool. Is it available to the public?
I'll open source it after I have done polishing a few things. Right now it works fine but is run by dirty code smell that needs refactoring 😅
This looks awesome! I can't wait to try to use it once it's public
Some updates: Rewrote the code to only start spawning closer rooms (cells with only 1 opening) as you approach a declared and modifiable max cell count variable. Or if the cell is surrounded by 4 or more cells already (so it doesnt infinitely try and fail to spawn a room with more than 1 opening till closer rooms become available to spawn)
This prevents the ocasional unlucky 5 room map, and also allows you to dictate the general amount of rooms you want the generator to produce. With this addition, the map is also more evenly distributed from the origin.
I managed to get rid of some redundancies too so now it works much faster and is able to spawn 500+ cells without much issue.
Though this method uses Area2D collision to check if a room can spawn so the performance drops a bit on larger scales.
I'll try a new method with RayCast2Ds instead and see how it goes.