Incrementally Loading Terrain

At the moment, I’m loading in my map’s terrain like this:

workspace.Terrain:PasteRegion(game.ReplicatedStorage.Maps[GameStuff.MapName.Value].Map.TerrainRegion,workspace.Terrain.MaxExtents.Min,true)

Sometimes, this crashes the game because the load is too heavy. Is there a way I can incrementally load in all the terrain so it takes more time to load all of it in?

2 Likes

You could try loading it in on each individual client rather than from the server, note that this will not replicate.

Can I incrementally load the terrain (chunk by chunk) from the server? I’ve seen this happen before but I don’t know how to do it.

You can use StreamingEnabled to do this, it is a built in ROBLOX feature and can be toggled in the workspace properties.

Can you do it with paste region?

I don’t know why you would as it makes the chunks and such for you.

The whole point of this thread was to do it with pasteregion.

I was under the illusion that you were asking how to make a chunk loading system. Please be more clear on what exactly you are trying to accomplish.

Edit: I think I know of a way you can accomplish this, you could set the coordinates of the main square that you are trying to load, and instead divide it into sections.

i.e divide the vector values in a way like this, and have a loop load each chunk in order

Kinda made a drawing of how you could split up the chunks and then load them doing something like this, note this is pseudocode:

local ChunkDivisor = 3
for i = OriginalPositionY / ChunkDivisor, EndPositionY, OriginalPositionY / ChunkDivisor do
     for i = OriginalPositionX / ChunkDivisor, EndPositionX, OriginalPositionX / ChunkDivisor do
      -- Load particular chunk then move over 3
     end
end
2 Likes

How does this apply to the “corner” argument of pasteregion?

Can you explain what the corner argument is used for so that I can possibly modify my code to help you?

This is all the information there is on the wiki. I don’t know what they even mean by corner.

So I found out what the corner is, it’s basically this:

image http://i.imgur.com/QxYW8RM.png

And we would create a value like this:

Region3int16.new(Vector3int16.new(MinCorner),Vector3int16.new(MaxCorner))

It’s basically like a box created by using two corner coordinates to my understanding.

But the argument in PasteRegion is a Vector3int16 not a Region3int16, so how can we use both corners?

Is it even possible to do what im trying to do with Terrain region and paste region method?