World Generation Help

Not sure if anyone here has done what I am trying but I need a lot of help.

I am creating a super accurate backrooms games with the lore down to an almost 1:1, however I have started trying to create a world generation system through Wave Collapse Function. With the method being a bit more complex I am struggling with a lot of things:

  • How to index the chunks in such a way that I can easily call back on them.
  • What the index would look like I have been think it was something like this

In a module script called GeneratedChunks I would have the index with the cordinates like (0,1) or (1,5) like in a graph. The index would go something like this
Folder
Name
DicitionaryEntry
CFrame or Location in Roblox

  • How I would resolver each chunk when generating new ones with a major performance hit.
  • Picking chunks and actively resolving surrounding chunks with new options and elimination of options.

The way I have everything setup or the way I hope to have it is with a folder in Workspace called GeneratedChunks holding a dictionary with all the generated chunks in the game, then the assets for each chunk in a folder from ReplicatedStorage which also holds the dictionary with each chunk and what can and can not generated next to each other.

If I explained this poorly or failed to mention something I will link the video I learned most this from below and an example project someone made based on the same topic on Itch.

Video by Martin Donald on YouTube
Itch Example

1 Like

Standard wave function collapse is not really a great implementation of the infinite backrooms. And even settling for a large map is going to hurt performance

Generation is not deterministic and it will change based on the order you explore the map in because the new generation depends on the previous state, so its hard to get the same map even with the same seed and players cant share any discoveries. But the biggest problem is that you cant go back and generate previous parts of the world if they were unloaded. Storing them in memory is not possible since we dont have access to disk like minecraft, and storing them in memorystore/datastore is probably possible but expensive and rate limited

It looks like this person achieved what you are looking for Generating an infinite world with the Wave Function Collapse algorithm | Marian's Blog

Maybe also look into these for maze/dungeon like infinite generation:

Whatever algorithm you choose, you want to be able to refer back to previous tiles by generating them statelessly, so you need some kind of generator that works with a hash. Then you can index previous ones and also guarantee determinism

2 Likes