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.
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!
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.