Reduce lag in Voxel game (Need Help)

If the player won’t be able to modify the aleready existing terrain, you can add a density system to your map generator to avoid creating lots of blocks that won’t be seen

Parts are also frustum culled as well. Here’s a good video demonstrating it by Clonetroper1019. https://www.youtube.com/watch?v=99kCiZyzJJM

1 Like

Yeah the player can modify the terrain btw What is a density system?

Is a way to avoid generating parts under the visible terrain so the client doesn’t have to use extra memory.

How would i do this if i want underground terrain and cave systems aswell?

For the cave system you can use Perlin Worms, and then you can make a script that generates parts when the player digs a block, like Mining Simulator did, there is a tutorial for that, you can check it here

1 Like

But wouldnt this eventually cause lag in the long run?

If the players mine lot of blocks yes, but keep in mind that is a better option than instantly generating all the parts.

Yes. This is very helpful but players would be able to see that its only 1 layer if they glitched trough the map. Should i just do 2 layers or just 1 ?

No I don’t. I don’t know how many tringles a part has.

Well I tested that out. I made a terrain invisible to the players, I played the game and the terrain was still there. (I saw the terrain by a camera part that I inserted)

What do you mean by that you made it invisible?

No. I only hide it from players.

Sorry i am having a hard time understanding what you are saying could you explain a little bit more in detail sorrymy english is not the best

My english is not the best too.
I made a terrain under the map, so you can’t see it no?
Then I saw the terrain with a camera placed under the map, and I saw the terrain.
Simple no?

i am using a cube mesh with 12 triangles is there any way that i can reduce the lag?

Oh i dont use blender and the i dont have any builds rn its just cubes

There’s a program too!
It’s called simplygon: link

Here is the game so you guys can get an idea of what im trying to do.

When adding each part, do you have a wait() between adding each part or chunk of parts?