Improving Rendering Distance in my Micro Voxel Engine
▲ 97 r/VoxelGameDev+3 crossposts

Improving Rendering Distance in my Micro Voxel Engine

For the past three weeks, i’ve been working on hard improving the render distance in my Micro Voxel Engine, particularly due to the feedback of having N64 viewing distance 😅

I’m pretty happy with the end result of increasing render distance from 300m to ~10-15km, while running at 45-50 FPS on an Apple M1 Pro.

Note: this engine uses meshing rather than RT/DDA.

— Macro chunks —

All chunk generation functions now include a sieve function to automatically be able to generate at 1/N resolution without any changes. This also applied to generated features and stamps, enabling chunks to be generated at any resolution without downsampling.

Macro chunks also independently record and resolve local edits. They are saved (and cached) independently so that terrain edits are maintained without needing to maintain the full res copy in memory.

The lower band LODs are very quick to generate. At this point I could add even more bands, and a 1/64 res chunk takes the same time to generate as a high res chunk, but covering huge distances.

— LOD transitions and adaptive fog —

I primarily use transient transitions where the detail levels fade between each other once, rather than a continuous gradual transition, as this is around 30% cheaper on the GPU and looks “nearly” as smooth in most scenarios.

Adaptive fog scales the effective draw distance dynamically based on loaded bands. Bands generate from high to low so during fast motion, if needed, we temporarily reduce draw distance until chunks have loaded.

— Macro chunk cards and props —

This was the hardest part, keeping identical prop coverage for trees and items without needing to instantiate millions of entities:
-Macro chunks retain a list of props whose IDs are deterministic based on position and type. If the real entity is destroyed, we can map this to the macro chunk set and remove. Likewise for newly spawned props.
- grass and foliage do not map 1:1 with the actual loaded props, but follows the same generation pattern, so technically there will be disparities, but a good trade off to avoid millions of tracked grass items.

youtu.be
u/MGMishMash — 13 hours ago
▲ 118 r/VoxelGameDev+3 crossposts

Simulating Ocean Tides in my Micro Voxel Game

I've spent the past 2-3 weeks adding Oceans to my Micro Voxel engine. The main features I was aiming for was to support large bodies of water within the existing fluid simulation, while also supporting new dynamic features such as waves and tidal changes.

I've also incorporated Boats and Gliders, with some fairly basic physics to aid in exploration. The main challenge here was adding

Along side this, to make the simulation feel more interactive, i've also added a higher resolution local water ripple/interaction simulation, which acts as a surface-layer-only simulation adding ripples and wake for people, entities and forces interacting with the water.

-- Feature technical breakdown --

  • Ocean generation: Similar to other water sources, ocean biomes placed above land, all open space in these biomes is filled with water instead of air below the ocean line. No substantial changes to the actual gen beyond shifting the world down.
  • Waves + Tides: Several oscillating masks which apply a "target height" to the water sim. This is also augmented by depth such that shores can trigger wave breaks below a set height point.
  • Ocean Connectivity + interaction: A connectivity flag is used to indicate whether water is directly connected to the ocean simulation and should receive wave forces. This allows waves to interact with static water, but only once the ocean sim cells touch static cells. The connectivity source comes from the ocean, so rock pools disconnect as tide goes down, allowing them to hold their water.
  • Ripples: 2D mask which is local to a moderately small region near the player. Runs a separate shader simulation using only surface data. Not particularly fancy, does not check for collisions, so ripples do not bounce. Bumps converted to a normal map, used to distort surface effects.

Overall, super chuffed with how this has come together, but still plenty of polish and features to add!

youtube.com
u/MGMishMash — 17 days ago

Adding Heat simulation and Survival to my Micro Voxel Engine

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

youtu.be
u/MGMishMash — 24 days ago
▲ 92 r/VoxelGameDev+2 crossposts

Adding Heat simulation and Survival to my Micro Voxel Engine

In this weeks update to my engine, I have added Heat simulation and some related survival mechanics. Walking around in the cold, especially during snow, causes the player to cool down.

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.

youtube.com
u/MGMishMash — 1 month ago
▲ 54 r/VoxelGameDev+1 crossposts

Raytracing Volumetric Clouds using Voxels (Devlog #5)

Another in my Micro Voxel mini devlog series! This week I was feeling inspired to work on clouds and weather simulation as the skyline felt quite empty.

Got a little bit carried away and implemented a full-on procedural cloud system which using voxels and raytracing. The key performance detail is that this is rendered to a lower resolution buffer (1/4th res by default), with a blur filter applied, and then blitted onto the world.

The "simulation" basically just controls a few parameters such as density (for light penetration) and noise threshold to control cloud coverage. It's fairly basic but enables biome-level weather states, where each biome has a set temperature band and probabilities for particular events and cloudiness.

Rain and snow are weather events which randomly activate throughout the day time and result in a change in atmospherics and cloud cover.

  • I also had been working on some progressive snow build up mechanics, which is pretty fun to see :)
  • Also mixed in a heat system which gradually tapers off snow build up around heat sources.
youtube.com
u/MGMishMash — 1 month ago
▲ 382 r/VoxelGameDev+2 crossposts

Simulating Procedural Ponds in my Micro Voxel Engine (Devlog #4)

This 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 :)

youtu.be
u/MGMishMash — 1 month ago
▲ 58 r/VoxelGameDev+1 crossposts

Adding Caves to my Micro Voxel Engine (Devlog #3)

Enjoyed implementing caves in my Micro Voxel engine this past week. Nothing too fancy, just stacking a few features on top of each other:
- typical stacked noise functions
- feature generators which deterministically spawn additional voxels following some pattern. Using this for the larger stalagmites. They do a downward and upward fill.
- erosion pass to create random crevices and cutouts.

Still a lot more to do! i like the idea of Cave biomes, and would also like a wider variety of generation types. Large caverns, walkable straight tunnels, cleaner surface caves etc;

At the moment the generation can look quite scrappy in places, but hey ho!

youtu.be
u/MGMishMash — 2 months ago
▲ 102 r/VoxelGameDev+2 crossposts

Voxel Engine #2 - Basic Mechanics, Placement, Lighting Engine

Another 2.5 weeks of dev on my new Voxel Game engine. Lots of iterative improvements to the engine and implementation of the basic core mechanics.

I don’t see these mechanics as being the fundamental basis of the game, but rather just the baseline essential requirements for an interactive sandbox which deeper mechanics can be built on top of.

— Placement System —

I enjoyed working on a placement system last week. The system supports two kinds of placement:

- World Blocks: directly writes voxels to the world grid as part of the terrain. Designed for structures, although no build tooling yet so it’s basically unusable 😅

- World Anchor Entities: certain items spawn entities in the world which support their own mechanics. These entities can either be anchored to the terrain, or to other entities.

I was happy with how anchoring turned out. For terrain, entities must retain a sufficient base attachment, depending on size. Items such as Torches can be freely placed against other entities (e.g trees, fenders posts rocks) and are invalidated if their source anchor is destroyed.

— Lighting System —

Currently supporting a form of Global illumination by implementing a coarse light propagation grid of probes around the player. Each frame propagates light sources through the grid, and applies occlusion while also weighting propagation based on local voxel occupancy.

The video only shows this working for terrain. Entities are supported, but currently having issues with flickering when compositing entities local occupancy volume onto the world grid.
In this case, entities only sample the probes, but the next update should fix this.

Colour propagation is also supported, and emmisive materials will also trivially work. Color transport manipulation will also be possible (e.g surface color reflection and filters (like stained glass), but not yet implemented.

My priority initially was performance. Lighting calculation currently only takes 0.3ms in a 16ms frame.

— Device —

Currently running on Apple M1 Pro between 40-100 FPS. Stable Memory usage around 3.5 GB Shared Memory, with GPU voxel data taking 2.9 GB of that.

Will need to improve memory as the game scales and to support discrete GPUs with lower absolute VRAM, but that will come in time :)

youtu.be
u/MGMishMash — 2 months ago
▲ 96 r/VoxelGameDev+1 crossposts

New large scale Voxel engine in C++ and Metal

One week into development of my new Voxel engine after years of not working on personal projects! Not quite sure where the game will go just yet, but enjoying building the engine :)!

So far, my goal is to achieve a large sense of scale and immersion, and lean into more primitive and exploration driven themes, where traversal of new biomes and terrain requires skill and preparation. (At the very least, hopefully a peaceful and immersive walking simulator)

Current world scale is 16km x 16km x 1km, with four biomes and mountains/canyons. Uses around active 4-5 GB atm with a moderately low 150-200m viewing distance, and not yet particularly well optimized outside of LODs and instancing.

Voxel scale is 0.2m, so lots of memory and perf challenges 😅. The far world background mesh generates a very coarse version of the world.

youtu.be
u/MGMishMash — 2 months ago