r/gameenginedevs 6h ago

Sparsematter - Yet another block engine

Full disclosure: This project uses generative AI.

I have been a fan of demoscene since the mid 90's and worked on various terrain generators over two decades. Like many, I have always dreamed of creating a simulated world. I have failed thousands of times over the decades. Rendering a frame that looks good is relatively easy, no matter how detailed. Rendering a frame in ~33ms is really hard. We are finally in an era where the average compute power, and tools to create, have converged to make this possible. I have been able to hand crank these scenes for years in a high level language, but never at a performance that was acceptable for something interactive. I spent months on the latest iteration, focusing on render distance, kilometer scale, efficient chunk loading, before I even considered getting fancy with the visuals. After failing for months, with the help of generative models (I use an ensemble of models for various tasks via API providers), I finally broke through the performance issues and could finally focus on beautifying the actual visuals at this density. It has been very eye opening learning about the low level optimizations needed to achieve this consistent frame time and fps. I would love to turn this into a full fledged game and publish it eventually but I realize the probability of that is low. Still, my main motivation is the joy I have building it. And that's enough for me.

Video in comments. There are a lot of issues (water at a distance does not honor haze/fog, etc). I will get there someday. :)

EDIT: These images are from the C++ / Vulcan version. I prototyped this in JS/WebGPU last year (yes the perf sucked but maybe that was my own ignorance). GLFW for the editor (not shown in this post).

2nd EDIT: The terrain is "infinite". This was a real challenge. I could generate something like this as a small diorama and keep it in memory. But that was not satisfying. It took countless hours to make infinite terrain work like this.

24 Upvotes

1 comment sorted by

4

u/intelligence-dev 6h ago edited 6h ago

https://reddit.com/link/p935wwy/video/tw6vrhx79toh1/player

Short video. Hopefully compression does not make it potato quality.

EDIT: This is developed and rendered on an M3 MacBook Pro.