I’m looking for a way to render prebuilt Smooth Terrain locally -
Currently there is nobuilt in method for replicating Saved Terrain Regions and rendering them on the Client.
I’m looking for any which method, hacky, etc. That I can break down and understand - Essentially work backwards from.
I’ve tried all sorts of methods to obtain Data from a TerrainRegion on the Client none of which has proven successful. However, I’m certain I’ve seen games utilise this method so there must be a method.
I’m looking to create Planets that utilise Smooth Terrain, however I only need the terrain to load once the Player is within range, outside of that it’s removed.
TerrainRegion doesn’t save across Server → Client, but you can use equations or pre-set of data points to determine the shape of the terrain, or save it in some binary data formats and send it to Client. Then just in Client use LocalScript to reconstruct Terrain based on the said data, via Terrain:WriteVoxels() or any other methods - https://create.roblox.com/docs/reference/engine/classes/Terrain#WriteVoxels
There’s lots of possible ways, and you do not provide an example of your own, so it is diffcult to provide an answer tailored to your request/question here. But, you can also just use parts in Server to determine the Terrain and in Client it scans them and build the Terrain so.
Ideally I want to build the map, including SmoothTerrain and store it in ReplicatedStorage.
Only when needed will it be rendered etc. I’m not sure how efficient Parts > Terrain would be?
Turning massive chunks from parts > terrain will cause alot of lag which is why you should in most cases keep the terrain pre-generated and avoid generating it using scripts
If you do end up having to generate it using scripts you should probably divide it into chunks of like 40 studs and then generate only the closest terrain to the player when they get near those certain points
Parts into Terrain will be inefficient if it’s very complex shape, but if it’s simple small shapes it isn’t as bad as you would think so.
“I’m looking to create Planets that utilise Smooth Terrain”
^ Are the planets real tiny or small ones? If they are like real small ones with real simple details, you can put it as Sphere part in the game, and when player is close by, use Terrain:FillBall() for the sphere. If you have more complicated bits like Parts sticking out, you can use Terrain:FillPart() or Terrain:FillWedge() etc.
If you have a guy made in terrain with lots of small planets, you can store each small planet’s Terrain Voxels into JSON and have LocalScript in Client to use Terrain:WriteVoxel() there, using Terrain:ReadVoxels() at each small planets you have already made and transform it into JSON data.
Overall though, you may be better off using Roblox Mesh for Planet terrains instead depend on your usage here.
Surely there’s a method of doing it though.
If even converting the TerrainRegion’s voxels into a ModuleScript that can be accessed by the Client to render Terrain based on that?
That can work, you just need to test it and see which method is the best and suited for your game. There’s not really a universal solution for all, some works better in term of efficiency performance etc to your case.