How to reload an infinite world from any point using WFC?
How to reload an infinite world from any point using WFC?
I started delving into world and dungeon generation with different techniques.
The one I want to try is wave function collapse.
There are several videos and repos explaining and showcasing how it works and how it can be used to generate an infinite world.
One question I have and haven't seen any mention about is, how do I recreate/reload the map from any point other than the original starting one?
So, AFAIK the algorithm start from a few tiles/pixels in a starting position, or picking their position at random, and then can collapse the rest of the map with the set of rules given to the building blocks, but if these starting tiles/pixels are far away after a player saves, then I can only think about having to start from them again to reach the saved point to be able to show the same world which of course could mean a very long loading screen.
Maybe the save can include the current seed, but then it can advance differently when the player goes back, which means the algorithm would generate a different portion of the map.
How can I ensure the world would be regenerated as it was?
While writing this I'm thinking I could be generating the seed of a block of tiles/pixels based on the seed of neighboring blocks and the coordinates in the map, something like left: seed+X, right: seed-Y, where X and Y are calculated based on the coordinate of the block.
This way I can save the seed of the current block and easily recalculate the seed used to generate all the adjacent blocks.
What do you think about this approach?