diff --git a/Minecraft-Classic-map-generation-algorithm.md b/Minecraft-Classic-map-generation-algorithm.md index d3b8231..06c489e 100644 --- a/Minecraft-Classic-map-generation-algorithm.md +++ b/Minecraft-Classic-map-generation-algorithm.md @@ -97,7 +97,8 @@ 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, spherical coordinates perhaps? +//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 Let phi be randomFloat() * Pi * 2 @@ -116,7 +117,8 @@ for len in caveLength { set deltaPhi to (previous value * 0.75) + randomFloat() - randomFloat() if randomFloat >= 0.25 { - Let centerPos be a new point with each component equal to cavePos.n + (randomInteger(4) - 2) * 0.2 + Let centerPos be a new point with each component equal to + cavePos.n + (randomInteger(4) - 2) * 0.2 // eg. centerPos.x = cavePos.x + (randomInteger(4) - 2) * 0.2 Let radius be (height - centerPos.y) / height @@ -167,10 +169,10 @@ for len in veinLength { set theta to deltaTheta * 0.2 set deltaTheta to (previous value * 0.9) + randomFloat() - randomFloat() set phi to previous value/2 + deltaPhi/4 - // note unlike deltaPhi for caves, previous value is multiplied by 0.9 instead of 0.75 + // unlike deltaPhi for caves, previous value is multiplied by 0.9 instead of 0.75 set deltaPhi to (previous value * 0.9) + randomFloat() - randomFloat() - // simpler derivation of radius here then for caves + // simpler derivation of radius here than for caves Let radius be abundance * sin(len * Pi / veinLength) + 1 fillOblateSpheroid( veinPos, radius, oreBlockID)