Less dense forests, make map sections square, better documentation.

This commit is contained in:
Anna Rose 2019-12-05 22:02:04 -05:00
parent c0f9ebbdb8
commit bbd3c089d9

View File

@ -1,8 +1,8 @@
--- Procedural generation methods
function init_mapgen()
uid_seed = 1229 -- arbitrarily chosen number
block_size = 128
uid_seed = 2229 -- arbitrarily chosen number
block_size = 64
-- Sprite ratios for different biomes, of the form { "biome_name": {frequency, sprite index} ... } }
-- frequencies don't have to add up to 100, but they should by convention
@ -15,12 +15,12 @@ function init_mapgen()
-- * 6 - pink flowers
-- * 7 - mushrooms
biomes = { grassland = { {40, 2}, {28, 5}, {28, 6}, {3, 3}, {1, 4} },
forest = { {40, 2}, {50, 4}, {5, 3}, {4, 5}, {1, 7} } }
forest = { {50, 2}, {40, 4}, {5, 3}, {4, 5}, {1, 7} } }
build_biome("forest")
end
-- use biome1
-- use biome1 if mix == false
function build_biome(biome1, biome2, mix)
if mix == true then
else
@ -28,6 +28,9 @@ function build_biome(biome1, biome2, mix)
end
-- global variable used for lookup during mapgen
-- build_biome() writes the biome_lookup table such
-- that biome_lookup[uid] returns a sprite index,
-- weighted by the frequency information for current biome.
biome_lookup = {}
for i=1,#frequencies do
local tuple=frequencies[i]