I’ve created an Infinite terrain generator, with a level of detail system that dynamically increases/decreases the terrain resolution based on distance. This allows for massive view distances of around ~6000+ studs. To compliment this, the terrain generation occurs on a just as large a scale, with huge mountains and islands visible in the distance.
Edit: Updated block size to make the terrain scale more similar to real life. View distance is now 48000+ studs (9 miles).
Just pushed an update with some micro optimizations that should increase performance greatly (~2-3x).
Low end devices will likely still be laggy, but for high end devices the stuttering is nonexistant save for a rare stutter here or there. Will be trying some larger algorithmic optimizations tomorrow.
I’ve released another update, this time I almost doubled the render distance to around ~6000 studs. Performance is slightly lowered, but still much faster than when the original post was made.
Interesting. Seems to work well. Camera clips into the ground and seems to show parts descend down to the XZ plane (Y = 0) for the bottom of each part.
The LoD system is very interesting to me and makes an amazing voxel generation. I don’t know how exactly you made it or I am probably overthinking it, but is the LoD customizable at set distances?
This last update introduces a load balancing system, which queue’s up chunks to be loaded
over time, this allows me to limit the frame time and reduce stuttering, especially at high walkspeeds.
Very high walkspeeds will still run much slower, but will usually stay above 10-15 fps. At high walkspeeds the queue will have trouble keeping up based on the performance of your system, so the terrain around you won’t stay up to date until you stop moving and let it load in. It prioritizes loading terrain nearby, so you won’t fall off the map.
I’ve applied most of the optimizations I wanted to, unfortunately it’s still not performant enough for an official game to use. Hopefully this changes in the future with optimizations and features from roblox themselves.
The code has been cleaned up and lightly documented. It wasn’t coded to be easily understood, so
you may still have trouble understanding it.
All code is in a single LocalScript located at StarterPlayer.StarterPlayerScripts.Terrain
Would this be possible to make it use smooth terrain instead of bricks? Would this increase, or decrease the performance/speed of generation? Once I get home I’ll try and see if I can do something similar with smooth terrain, if it works, I’ll probably make a thread on it and link it here.
You could definitely do the infinite terrain aspect, as most infinite terrain games are voxel based. However it is my understanding that terrain already automatically does LoD so doing that may be redundant. If you get it polished though I feel Roblox is long overdue for some infinite world crafting type game!
I was able to edit it and now it generates smooth terrain instead! It only took some minor tweaks so I won’t be making a seperate post on this… the only downside is that it has a tiny bit more performance problems (might just be my machine) Here it is - Smooth Terrain Infinite Generation - Roblox
Awesome edit. This looks great, and performance is still good.
Proof of Concept I know, but I’ll just note that if walk speed is set too high (ws/100) you can fall through water, especially near shores, throwing repeated HumanoidRootPart errors. Small, but I found experienced this nearly immediately.