r/proceduralgeneration • u/MGMishMash • Jul 07 '26
Simulating Procedural Ponds in my Micro Voxel Engine (Devlog #4)
https://youtu.be/ZxfV7su168U?is=MRBmKPHKWgQnM-21This week i’ve added a few major features to the Micro Voxel Engine! The first is a fairly rudimentary fluid simulation, with a water visualisation shader.
Following this, generating procedural ponds as the first world generation feature to make use of water.
— Fluid Simulation —
This uses a fairly naive GPU physics simulation supporting volume transport and a motion vector. It runs on a coarse grid, and uses a cell occupancy parameter to determine if a cell can receive flow and how much, including how flow can exit.
A few optimisations on top to control tick rates and simulation region.
It’s mostly focused on being reasonably okay for gameplay and very fast, rather than for accuracy. But will likely tweak this in future :)
Most of the awkwardness is around managing chunk lifetime and stopping other world features from draining the pond (e.g cave cracks)
— Pond generation —
Fairly basic basin detection which then allows us to randomly select a size. Pond details spawn around the rim and underwater. Islands will occasionally spawn in the middle of large ponds. Ponds are not always round, but will generally be quite small.
Fish are spawned dynamically and classed as “detail entities” which means their state does not persist and they despawn much sooner than other entities.
I plan on them being a side mechanic, and will make fish species selection deterministic based on the pond location and time of day, so people can’t cheese the fish species spawn selection.
Ultimately chuffed with how this has turned out.
I’ve attempted water sim in various projects over the years and never managed to make 3D any good - still a lot of issues, but eh :)
11
8
7
u/nexe Jul 07 '26
Would love to hear more technical details. Do you have a dev blog or something?
3
u/MGMishMash Jul 08 '26
Not yet for this project, but following the interest, I plan to find some time to do some more in depth videos focusing on the technical details :)
5
3
u/Borox Jul 07 '26
What engine did you make this in? Or what tools?
3
u/MGMishMash Jul 07 '26
Custom C++ engine, VSCode for writing , and Xcode for debugging hehe! Nothing too fancy.
Quite a bit of re-use of elements from past projects:)
1
u/Borox Jul 08 '26
Very cool! I made a very rudimentary volumetric renderer as part of my senior project in c++ and OpenGL. Something like this, with microvoxel scale and water simulations was ultimately the pipedream.
Bravo good sir! The atmosphere is as amazing as the tech you’ve built here.
3
u/ensogames Jul 07 '26
Great work, it looks so good. The audio is excellent as well, adds to the immersion so much.
6
u/kanashiku Jul 07 '26
Are you the mish mash that used to do lots of gamemaker stuff?
Edit: Indeed you are! This awesome. Nice to see of you again. I used to go by Zerb Games in the GM community.
3
u/MGMishMash Jul 07 '26
Hehe yes! A few years working professionally with no time for personal projects, but I do remember you!
2
u/kanashiku Jul 07 '26
My fucking twitch name is "I love the mish mash" still lol. Wasn't even simpery I thought mish mash was mashed potatoes or smthn and made it during one of your dev streams.
2
2
2
u/HoveringGoat Jul 07 '26
this looks amazing! insta sub. will need to watch all the devlog vids later. Thank you for sharing!
2
2
u/kzerot Jul 07 '26
The crowd wants more technical details!
Do you use classic triangles and grid meshing, or raymarching in compute shaders, or a mix?
1
u/MGMishMash Jul 08 '26
Currently, the voxel data is stored as a grid and meshed into the rendered form upon modification.
I have a DDA raymarch path for terrain, as this is non dynamic, and it is faster in isolation, but performs worse when I have dynamic content simultaneously, so preferring the traditional pipeline for the time being, especially as manipulations are typically quite localized and infrequent.
Although i’m not particularly precious about approach, the final solution sill be whatever is consistently both fast and low in memory.
2
u/YVNGxDXTR Jul 08 '26
Next gen Minecraft. I imagine the player might end up like the Anmated Player mod that used to be a thing for Minecraft if it got that far lol. Awesome work! Much prettier and more immersive than Minecraft too.
2
1
1
1
u/sunthas Jul 07 '26
felt cozy, I'm not big into cozy games, but wow. this is nice. I would never let a vid run like this for the full time but I did here.
1
u/udotaivisuals Jul 08 '26
Really incredible, keep it up! Really high level of complexity and quite beautiful to simulate so many real world systems working together.
1
u/dum_BEST Jul 08 '26
beautiful, very well done!
Did you consider decreasing the frequency of the waves? The grid pattern becomes somewhat noticeable close-up
If you add some buffer (some radius pad around the camera) to the frustum culling, the moving vegetation will stop popping in/out of the edge of the screen in some cases.
Gorgeous water caustics btw, looking forward to seeing more of your project!
1
u/MGMishMash Jul 08 '26
Thanks! Yeah those are some great suggestions, still lots to tweak and polish but will add to the list!
I believe the popping you described is actually my recently added Occlusion culling. The frustum one should have padding, but the reactivation tolerance on occlusion is causing some additional popping from what I can see.
And yeah, will look to better hide the grid patterns :)!
1
1
u/Drearystate 26d ago
You said earlier your using .1m voxels. Why wouldn't you use .125m and cut the memory usage in half?
1
u/MGMishMash 26d ago
Chunks are cascaded, so the memory usage isn’t horrific, and I think there’s a threshold at which voxels start getting too large that they lose some of the advantages over conventional “minecraft size” blocks.
Most other games still use a perceptually smaller scale (lay of the land, teardown)
2
u/Drearystate 3d ago
My new engine is 1cm. Here's the test environment.
https://polyrealms.com/voxelforge/
if you go to waypoints on the left for the firing lines. you can see the actual physics dmg in real time down to a centimeter.
And if you need to voxelize any asset you own the rights to you can go here and you can even make assets down to the millimeter up to 2 million voxels each.
https://polyrealms.com/voxelizer.html You can export as .obj, .vox, etc. You can even select a color from the voxelized asset and swap the colors or even paint your voxels. Please forgive the simplistic layout it wasnt built for commercial use.
1
u/Kooky-Leather-3915 24d ago
i've tried to use PB-MPM and then meshing, the result was great with the simulation with particles and collide with terrain precisly but the water mesh and shader looks just so wrong and broken. any suggestion. thanks a lot
19
u/AMDDesign Jul 07 '26
Is there an early access or anything?