From bbd3c089d9830860615a02af9ab1864230724d8b Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Thu, 5 Dec 2019 22:02:04 -0500 Subject: [PATCH] Less dense forests, make map sections square, better documentation. --- mapgen.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mapgen.lua b/mapgen.lua index 5dfbb1c..caac707 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -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]