menu

SimpleMinerVR

Introduction

SimpleMinerVR is a minecraft-style voxel-based 3D world generator that can generate procedural content for an infinite world. Generation is deterministic using raw and Perlin noise and the world contains biome factors such as rivers, oceans, hills, flatlands, deserts, icebergs and glaciers. The game also contains shader effects to support indoor and outdoor lighting, a fog effect, lightning strikes, glowstone blocks and animated water blocks.

Duration: May 2024 - Jul 2024

Technologies: Rey Engine (Custom C++ Game Engine)

Role: Sole Developer

Key Features

  • Chunk-based infinite deterministic world generation with biome factors and three tree types.
  • Chunk activation schemes to activate chunks near the player and deactivate far away chunks.
  • Multi-threading to support chunk generation in worker threads.
  • Custom binary file format for saving modified chunks with Run-Length Encoding (RLE).
  • Light influence maps to support indoor lighting using glowstone and outdoor lighting.
  • Day and night cycles, fog effect, lightning strikes and glowstone flickering.
  • Ability for players to place and dig blocks, affecting lighting when doing so.
  • Animated water blocks to create moving water and wave effects.
  • VR support with OpenXR.

Biomes

  • Biomes are generated based on specific rules for block types based on a variety of factors- humidity, oceanness, forestness, temperature, hillness, and more.
  • I used Perlin noise along with various easing functions to first generate values for the entire Chunk and then determine block types based on these values.
  • Trees are created as BlockTemplates and placed in a separate pass.

				

Chunk Handling

  • Tier-1: Amortized approach on main thread with only 1 chunk being activated/deactivated per frame.
  • Tier-2: Job system with main thread queuing activation/deactivation jobs, worker threads performing activation/deactivation followed by main thread retrieving completed jobs.

				

Custom Binary File Format with Run-Length Encoding

  • I created a custom binary file format for saving modified chunks.
  • Chunks that haven't been modified are not saved since they will be generated the exact same way for a specific world seed.
  • Chunks have several adjacent blocks with the same type- for example the top half of a chunk could be all air blocks.
  • To efficiently save these block types, I used Run-Length Encoding (RLE) where any pair of bytes indicate the block type to place and the number of blocks of that type to be placed consecutively.