Hi there! I am the OP of Pushing the limits of Terrain/Voxel Compression.
This is a topic that I have done a lot of research on! So from what I am understanding, you have a pre-designed terrain map that you want to publish but can’t. Following that logic, here is a recommendation if you haven’t tried them already:
If you already have the terrain inserted into your Studio, you could potentially use Terrain Regions! These cool little guys basically compress terrain into instances that you can keep in ServerStorage or wherever you want. Please paste the code below to get an idea of what the instances look like in ServerStorage:
workspace.Terrain:CopyRegion(Region3int16.new(Vector3int16.new(0, 0, 0), Vector3int16.new(100, 100, 100))).Parent = game.ServerStorage
The second solution I suggest involves a more tedious solution that, judging from what you have said, is a very complex topic that is not meant for beginner developers. However it is still a fascinating topic should you want to pursue it.
Solution #1 (the easiest)
Edit: I just read some sub posts after making this section. From my personal experience, it doesn’t hurt to try TerrainRegions. I know of many games that use this method and it is much more effective than saving the voxel data manually as these instances get stored using engine-made instances that don’t involve the bloat that you see if you are trying to save them with Luau.
As the documentation suggests, you would simply create a for loop of regions following the Region3int16 limits all the way til you reach your 20000 or so map size! Then what you can do is completely wipe the terrain from the map and only load in the chunks near any players! One way I suggest “testing” it out is by creating a copy of the studio and doing it on that one just in case you run into any issues or if the method doesn’t work
.
If it does, your next course of action could be making a different place that holds the terrain part of your game. Then, make your edits on there and every time you are done, run the scrips and replace all your TerrainRegion instances with the new one! You can ever go as far as making it a package so you can simply have it update on the other game whenever it’s changed!
Solution #2 (a slightly harder implementation)
Another, more painful solution, would be to compress the chunks you already have. This can be done with BitBuffers. There are many modules out there that do this for you! I personally had mine made in-house due to specific specifications that I needed. However you may find that one works for you that someone else has made! A great place to start would be wally which hosts many community made modules of all different purposes!
Once you have your module and method of compression, I’d look into finding ways to store it. Some that come to mind immediately would be a set of Module Scripts for each chunk (that way you don’t put it all in one module script. That would take quite a long while to require). Then, you can easily require each one in accordance to which chunks you want to load! Another, much harder, way of doing it, would to be use DataStore. I say it is harder because you have to use primitive types (JSON types only) and base all of your data to be compressed enough on order for you to not go above the DataStore limit (this was the pain point I described in my post).
I also don’t recommend doing with DataStore because from what I understand you are not changing this terrain in any way during runtime. This is a great thing for you because it removes the pain of having to deal with DataStore limits.
In Conclusion
That is all the advice I can think of for now! I’d love to hear if any of the two solutions works as I am always fascinated when people find unique workarounds with the limited Terrain utilities we are provided.
Thank you as well for shouting me out in your post! I am glad that terrain compression is getting more attention!
I hope your project goes well!