From 9efff51e4a65d0ede6c1bba2445a92f7e2de9150 Mon Sep 17 00:00:00 2001 From: Alex Mulkerrin Date: Thu, 3 Dec 2015 13:51:04 +0000 Subject: [PATCH] description of water and lava flood-fills --- Minecraft-Classic-map-generation-algorithm.md | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Minecraft-Classic-map-generation-algorithm.md b/Minecraft-Classic-map-generation-algorithm.md index 06c489e..6293cab 100644 --- a/Minecraft-Classic-map-generation-algorithm.md +++ b/Minecraft-Classic-map-generation-algorithm.md @@ -97,7 +97,7 @@ For each cave: Let cavePos be a random point (x,y,z) within the (width,height,depth) space. Let caveLength be randomFloat() * randomFloat() * 200 -//cave direction is given by two angles and corresponding rate of change in those angles, +//cave direction is given by two angles and corresponding rate of change in those angles, //spherical coordinates perhaps? Let theta be randomFloat() * Pi * 2 Let deltaTheta be 0 @@ -132,7 +132,7 @@ for len in caveLength { where fillOblateSpheroid is a method which takes a central point, a radius and a fillBlockID to use on the block array. -For each entry (x,y,z) within -radius to +radius within the block array: +For each entry (x,y,z) within -radius to +radius in the block array: ``` dx = x - center.x dy = y - center.y @@ -178,11 +178,21 @@ for len in veinLength { fillOblateSpheroid( veinPos, radius, oreBlockID) } ``` - ## Flood-fill water -// Todo + +Water is flood-filled into the map, spreading horizontally and down vertically, from the x,z edges of the map at a height of water level - 1. + +Some underground water sources are then added to the block array to create flooded caves. The number seeded is: +width x depth / 800 + +For each water source a random x and z coordinate value is chosen and the y coordinate is set to water level - 1, or water level - 2. If this position in the block array is AIR then the water flood-fills out and downwards. + ## Flood-fill lava -// Todo + +The lowest layer of the block array is always lava, having been set so during strata generation. A few lava flooded caves might form. Only width x depth / 20,000 lava sources will be seeded. + +For each lava source a random x and z coordinate value is chosen and the y coordinate is set to (water level - 3) x randomFloat() x randomFloat(). If the position is AIR then lava is flood-filled from that point. + ## Create surface layers // Todo ## Create plants