I'm trying to make a voxel-based sandbox game like Minecraft but can't add culling

I’ve been making a Minecraft clone for the past week and I’ve run into some issues. Mainly culling. Culling is like only loading parts visible to the client to increase performance.
This is a video of how the project is right now.


Building and terrain generation work, but culling is giving me a hard time.
Here’s how the system works:

If the player reaches a new chunk, a RemoteEvent is fired to the server to load the surrounding chunks on the server. Since there’s no culling, underneath the grass is empty space.

image
The image above is kinda misleading. the blocks are stored in a folder in ReplicatedStorage for client chunk loading purposes. I moved them up to workspace so you can see. The image on the right accurate tho.

On the client, the chunks are then moved from ReplicatedStorage to Workspace and the chunks closest to the player stay, and the chunks too far away go back in ReplicatedStorage.
image

This itself creates a problem because as more chunks load in the server, the script has to check more chunks at a time, impacting performance.

So about the culling, I can’t find a way to do that without cycling through every single block in the chunk (that lags alot!)

So on the server, I gotta just load the top layer of each chunk. The layers below dont’ even exist yet.

I have no idea how to add culling, since to do that, I have to make all blocks on the server, which causes a huge ping issue. And if i do that somehow and check on the client which blocks should be shown, I have to cycle through every block in that chunk folder which lags also.

Please help!!!

1 Like

Don’t really know much about this topic, but minecraft itself has “chunk coordinates,” which are coordinates that only change per chunk, not per stud/block

Idk, hope this helps tho
I might look more into this too, we’ll see