top of page

SimpleMiner

About
  • Individual Project in Personal Engine

  • 8 Week Development Time

High Concept

A simple clone of Minecraft.

Notable Features
  • Block Placement and Destruction

  • Light Propagation

  • Biomes with Trees

  • Grappling Hook

Light Propagation

Lighting in SimpleMiner is based on the original lighting in Minecraft, where each block has a light value that affects the brightness of each block face that is touching the block. This light value propagates out from light sources on a block by block basis. The propagation works like a distance field, allowing it to wrap around corners.

When a block is placed or destroyed, it is added to a dirty lighting queue. In a later lighting update step, it is popped out of the queue and calculates its ideal light value using its own self-illumination value, the light value for the sky if it is a part of it, and the light values of its neighbors minus 1. The greatest of these is set as the block's light value and the block's neighbors are added to the dirty lighting queue. The lighting update step will continue until the dirty lighting queue is empty.

Biomes

Biomes are generated using Perlin noise to calculate temperature and wetness for each block. Each biome is defined as a wetness threshold, temperature threshold, or both. For example, desert is defined as a minumum temperature and a maximum wetness.

When a block is placed during generation, it checks if its wetness and temperature values meet the criteria for a biome and if so, sets the appropriate block for that biome. Otherwise, it places the default. The temperature and wetness of a block are also used in the generation of trees, detailed below.

Trees

Trees are placed on blocks that are local maxima, blocks with higher values than all of their neighbors, within 2D Perlin noise. This noise is generated using the block's wetness as the octave scale at that location. This causes wetter areas to have "rougher" noise resulting in a higher frequency of local maxima and more trees.

The world in SimpleMiner is divided into chunks of block, much like Minecraft. World generation happens on a chunk-by-chunk basis using Perlin noise so that each chunk be contiguous with neighboring chunks regardless of the order of generation. However, because trees occupy more than just the block that they are placed on, the noise calculation for placing trees has to extend beyond the edges of the chunk being generated. This ensures that if a tree from another chunk would reach into the one being generated it will still match up perfectly, even if the two chunks are generated at entirely different times.

bottom of page