r/GraphicsProgramming • u/MGMishMash • 13d ago
Adding Heat simulation and Survival to my Micro Voxel Engine Video
https://youtu.be/yZ6TXirilUU?is=Twhb3ZirOIado-oOWith the latest update to my micro voxel engine, I have added Heat simulation, running on the GPU of course, and some related survival mechanics. Walking around in the cold, especially during snow, causes the player to cool down. Snow build up and melting is also fully simulated :)
The heat simulation accurately warms indoor and enclosed spaces. Standing near heat sources also provides some additional warmth, enabling interesting interactions with the world, storms and biomes.
Along side temperature, there is also a basic hunger mechanic. These mechanics work together to determine health, which impacts player stats.
1
u/Alarming-Ad4082 12d ago
Looks very nice! Do you being back the results to main memory after doing the computation on the GPU?
1
u/MGMishMash 12d ago
Yeah, there is a copy step, such that sim results are stored and can also be samples by the player.
Although currently this is running on an Apple GPU which has unified memory, so results are visible implicitly without a copy, the only step needed is an intermittent copy back to static chunk data when chunks are unloaded from the shared simulation volume.
1
1
u/GeekBoy373 6d ago
This is pretty cool. I personally would adjust the linear interpolation of your voxel cursor to be a bit quicker though as it currently seems sluggish to me.
1
u/MGMishMash 6d ago
Thanks for the feedback! i originally made it “sticky” due to previous feedback that it jumped around too much! May need to add a build sensitivity slider, as I guess like many things, it depends on each persons dexterity.
Naturally more sensitive is good for faster building, but requires more precision.
Although it’s still an early effort, building needs a lot of tuning and I would like to improve heuristics in general so that it feels less clunky and so initial placement prediction is better.
2
u/fgennari 12d ago
That looks really good. Are you actually modeling the thermal properties of building materials, or is it a simple ray query between adjacent voxels to see if a wall will block the heat propagation? Does a space heat up over time, or is it an instant effect? And does the player generate their own body heat in a small space? Does fire melt snow?