I’m currently working on a game that generates a procedural world out of cubes that the player can interact with, sort of like Minecraft but on a smaller scale. I have the terrain generation working, but I cannot make the terrain more than one block deep because I run into performance issues. It’s bad enough with a single layer. Is there anything I could do to optimize this and make it run better?
Hi, i’m actually trying to make a similar thing. The idea is that you want to make all the voxels that are non visible right away consume less resource. You can do this by setting their Transparency
to 1 and CanQuery
to false. I’m trying out different methods myself to see what i can do
you can use parallel scripting
I actually did something like this that really helped, where it would check if the voxel had a visible side, and if not it would be moved to server storage instead of the workspace. My issue now is that the generation is too slow, which parallel scripting might work, so I’ll give that a go.
I haven’t found a good way to implement this… I tried but it didn’t work because I can’t set a part’s size while in parallel.
You should remove all collisions from them and use math to calculate hitboxes
Sadly best option is to use editable images cuz lack of vertices, but really benefit is small
I’m not sure I get what you mean… Like disable collision for all the parts, then make different, larger parts for the collision? I don’t see how that would work better
No, don’t use collisions at all, use spatial partitioning to calculate positions, so roblox will not do it for all parts, rather you will do for 9 or so, you need to test if it’s better, but it’s worth a try
I’m not sure I get what you mean. How would the game work if there isn’t any collision? Wouldn’t players just fall through the terrain?
And what do you mean using spatial partitioning to calculate positions?
I mean that instead of using server-sided collisions, disable CanCollide and use math to calculate them
Math to calculate what? The collision? How would that work?
Sorry if I’m coming off as rude or dismissive, that is not my intention; I just don’t understand what you’re saying.
np, simply instead of using roblox’s collision, calculate at which position the player is, and then create your own collision via roblox parts, instead of having can collide on every voxel
Oh that makes sense now. I’ll have to try that Thanks for the help!