How would I optimize my voxel-based game?

Hi! I am making a voxel-based game, and I am trying to optimize it. I already have the terrain generator.

My current concept is by making a flat plane, then cloning the flat plane only on the surface of each block that you can see.

I want it to automatically do this:

But I have no idea how I would script it to do that. I know I could cast a ray, but I barely know how to even use rays. :frowning: (I have tried looking at tutorials but I still don’t get how it works.)

Currently, my world generator generates over 6000 parts trying to run at once, and its really slow. (Edit: I have used coroutines to speed up world generation, but the game is still extremely laggy.)

This is how minecraft’s rendering works.

Game: voxelgame Please know that I may close the game sometimes.

I haven’t done something like this but I have seen tutorials done on world generators but instead of blocks, it’s with polygons.

I found these two tutorials on world generation for Roblox.

Also as a side note if you want to make a really good infinite generating terrain id recommend using a different engine.

Good luck.


I already have the terrain generator, i’m just trying to optimize it so its not rendering over 6000 parts at once, by using a flat plane, going through each block, and check if there is a block next to it. If there is no block on the side of it, then I want it to clone the flat plane on the surface of the block that is hitting the air. Sorry if I didn’t really explain this correctly, i’m not that great at explaining things.

I would use a different engine, but Roblox has server hosting for free, easy multiplayer, and also LUA is really easy rather than something like C#.

1 Like