Corrupted terrain geometry (but not collisions) when using StreamingEnabled in streaming scenarios

When using terrain in a StreamingEnabled game, it looks corrupted in certain cases (low-memory, I presume). With the new memory limit emulator in Studio this can be reliably reproduced, but this happens on real devices a lot too.

Reproducing/illustrating with an example;

Put this script in ServerScriptService on a baseplate, then enable StreamingEnabled in Workspace (default settings), then run the game.

local material, occupancy = {}, {}

math.randomseed(0)
for x = 1, 100 do
	material[x] = {{}}
	occupancy[x] = {{}}
	for z = 1, 100 do
		local spawn_water = math.random() < 0.5
		material[x][1][z] = spawn_water and Enum.Material.Water or Enum.Material.Air
		occupancy[x][1][z] = spawn_water and 1 or 0
	end
end

workspace.Terrain:WriteVoxels(Region3.new(Vector3.new(), Vector3.new(400, 4, 400)), 4, material, occupancy)

If you have enough memory (or use the emulator with a high memory setting, such a 64 GB), it’ll look correct:

With a lower memory setting (even 8 GB is too little?), or simply one of the phone/tablet options:

Notice the inverted normals, random slices of disconnected geometry and in general inaccurate geometry, even close to the player. In real games it can look very, very corrupted, with spikes all over the place, depending on the terrain.

The appearance will change as the terrain changes too, or as you move around:

The terrain material does not matter. Collisions will continue working correctly. Even moving into it will not load higher quality/correct visual geometry either.

Disabling StreamingEnabled will prevent this issue from occurring.

This started happening about 2 months ago.

This was tested on Windows 10, but this issue seems to occur on all devices (at least on Windows 10 and iOS).

16 Likes

Thanks for the report! We’ve filed this internally and we’ll follow up here when we have an update for you.

2 Likes

I am in the process of checking over bug reports and following up on some bugs that haven’t received any activity in a while.
Is this issue still occurring or can you confirm that this bug has been resolved? We are having a hard time reproducing this issue.

2 Likes

This is still occurring. I still get bug reports about this nearly daily for my games from players having this issue.

The reproduction steps mentioned above also still reliably reproduce this for me.

2 Likes

Alright, As soon as there is an update i will pass it on.

1 Like

Hey! I believe this issue is caused because there is low LOD terrain too close to the player in low memory situations. We recently enabled a fix that should alleviate this issue some of the time, but you may still see weird terrain visuals farther away from the player’s streaming focus (we try and guarantee as much high LOD terrain as memory allows around the streaming focus, but it’s harder to make guarantees the farther you get from the streaming focus).

The repro you provided now seems fixed (I tested via device emulation).

2 Likes