What do you want to achieve? Alright, so i’ve got a infinite (ish) map that player can walk around, terraform, and do other stuff. I need a way to save the map to a datastore.
What is the issue? I need a way to translate cordinates (420, 420 for example) into a number, for use in datastore. I can’t do x..y because I need to be able to load it and save it from a datastore. I also need to be able to get the datastore key of any chunk at any time, throught the use of… something…
What solutions have you tried so far? Googled it, no results. i’ve tried using a spiral algorithim to map it in a spiral (here’s a demo: https://scratch.mit.edu/projects/583274038/), but I don’t know of any other way. Any suggestions are appreciated.
Also in the demo, you notice that the spiral has gaps in between the lines. I’m not sure why this happens. thanks for any ideas/awnsers - chowder fish
tl;dr use a hash map from positions (Vector3Ints) to chunks for memory and disk (or DataStore). Optionally compress each chunk for storage. Don’t compress for memory (although they do also do that eventually but it’s probably not worth the added complexity for you)
I’m using a flat plane but users can edit the plane by holding down their mouse. When they do this, it allows them to “terraform” the terrain, kinda like roblox’s terrain tools. Also, I do have a saving system for chunks, I just need a system to assign a unique number for every chunk.
edit: i’m looking at hash maps but I’m not exactly sure if they’re the solution.