Hiding large chunks of terrain for certain players

I’m making a space game where you warp to different places around space. These places are actually all at the same position and I just hide the stuff inside it whenever the player changes room (I can’t just put them very far away in real scale because things too far away from Vector3.new(0,0,0) usually get all glitchy due to floating point precision.

Some of these “rooms” will have terrain on them since you’ll be able to land on planets, and that terrain will be generated with perlin noise. Now, I’d like if possible for the terrain to be stored on the server as well because there will be mobs and I’d rather the server to do physics works so every player sees it the same. If the client has terrain, the server does not, and the physics for mobs are being calculated by the server, it’d get weird, possibly making the mobs fall through the terrain.

So, how would I go about this? I want the terrain to be on the client and on the server, but I don’t want other clients seeing it, therefore I want clients that should not see the terrain to hide it locally somehow. The terrain has also to switch somewhat fast so the loading times aren’t a pain.

If this isn’t possible, can you think of any other solutions? I also thought of not putting the “rooms” not at the same position, but slightly away, somewhere around 5000-10000 studs, but I still have the same problem. How can I hide terrain locally?

EDIT: Made a quick sketch of my second idea

Rooms 3, 4 and 5 have terrain in it. The others have only parts that I can just move to ReplicatedStorage when the player swaps room. What I’m trying to solve is, how could I make a player in Room 1 not see the terrain in let’s say Room 3?

If you want to hide/remove the terrain locally StreamingEnabled might be of help. Though there are some downsides to it.

You could make use of Terrain:CopyRegion() and Terrain:PasteRegion() to save and load terrain. Then use Terrain:Clear() or Terrain:FillRegion() with air. This can be slow depending on how big the maps are, so be careful. If the maps are very big you could look into using Universes maybe.

Damn, didn’t know these existed! Thanks!

My game is already using Universes, but I’d rather keep each place with multiple rooms :slight_smile:

1 Like

Bumping, sorry!

Did this work for you in the end? Using a similar concept for my game.