From 5341ddfcf97557f9540e1f44ab9210469f2158ad Mon Sep 17 00:00:00 2001 From: paramat Date: Wed, 9 Apr 2014 06:06:10 +0100 Subject: [PATCH] Fresh ice, red cobble, redo clouds with existing noises --- README.txt | 7 +- functions.lua | 24 +++--- init.lua | 81 ++++++++---------- nodes.lua | 78 ++++++++++------- ...ter.png => watershed_bucketfreshwater.png} | Bin textures/watershed_cloud.png | Bin 136 -> 136 bytes textures/watershed_darkcloud.png | Bin 136 -> 0 bytes textures/watershed_freshice.png | Bin 0 -> 780 bytes ...hed_water.png => watershed_freshwater.png} | Bin ...ranim.png => watershed_freshwateranim.png} | Bin ...m.png => watershed_freshwaterflowanim.png} | Bin textures/watershed_goldengrass.png | Bin 711 -> 683 bytes textures/watershed_redcobble.png | Bin 0 -> 686 bytes 13 files changed, 98 insertions(+), 92 deletions(-) rename textures/{watershed_bucketwater.png => watershed_bucketfreshwater.png} (100%) delete mode 100644 textures/watershed_darkcloud.png create mode 100644 textures/watershed_freshice.png rename textures/{watershed_water.png => watershed_freshwater.png} (100%) rename textures/{watershed_wateranim.png => watershed_freshwateranim.png} (100%) rename textures/{watershed_waterflowanim.png => watershed_freshwaterflowanim.png} (100%) create mode 100644 textures/watershed_redcobble.png diff --git a/README.txt b/README.txt index 066b5eb..a1d77ac 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,5 @@ -watershed 0.3.5 by paramat +watershed 0.3.6 by paramat For latest stable Minetest back to 0.4.8 -Depends default -Licenses: code WTFPL \ No newline at end of file +Depends default bucket +Licenses: code WTFPL, textures CC BY-SA +watershed:redcobble texture CC BY-SA by brunob.santos minetestbr.blogspot.com \ No newline at end of file diff --git a/functions.lua b/functions.lua index 81a2601..bab07e8 100644 --- a/functions.lua +++ b/functions.lua @@ -212,11 +212,11 @@ end -- Register buckets, lava fuel bucket.register_liquid( - "watershed:water", - "watershed:waterflow", - "watershed:bucket_water", - "watershed_bucketwater.png", - "WS Water Bucket" + "watershed:freshwater", + "watershed:freshwaterflow", + "watershed:bucket_freshwater", + "watershed_bucketfreshwater.png", + "WS Fresh Water Bucket" ) bucket.register_liquid( @@ -234,11 +234,11 @@ minetest.register_craft({ replacements = {{"watershed:bucket_lava", "bucket:bucket_empty"}}, }) --- Singlenode mapgen option +-- Singlenode option -local SINGLENODE = true +local SINODE = true -if SINGLENODE then +if SINODE then -- Set mapgen parameters minetest.register_on_mapgen_init(function(mgparams) @@ -322,21 +322,21 @@ if SINGLENODE then local x1 = x0 + 79 local z1 = z0 + 79 local y1 = 47 - + local sidelen = 80 local chulens = {x=sidelen, y=sidelen, z=sidelen} local minposxyz = {x=x0, y=y0, z=z0} local minposxz = {x=x0, y=z0} - + local nvals_rough = minetest.get_perlin_map(np_rough, chulens):get3dMap_flat(minposxyz) local nvals_smooth = minetest.get_perlin_map(np_smooth, chulens):get3dMap_flat(minposxyz) local nvals_fault = minetest.get_perlin_map(np_fault, chulens):get3dMap_flat(minposxyz) local nvals_temp = minetest.get_perlin_map(np_temp, chulens):get3dMap_flat(minposxyz) local nvals_humid = minetest.get_perlin_map(np_humid, chulens):get3dMap_flat(minposxyz) - + local nvals_base = minetest.get_perlin_map(np_base, chulens):get2dMap_flat(minposxz) local nvals_xlscale = minetest.get_perlin_map(np_xlscale, chulens):get2dMap_flat(minposxz) - + local nixz = 1 local nixyz = 1 for z = z0, z1 do diff --git a/init.lua b/init.lua index 3ebf40a..f83f9dd 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,13 @@ --- watershed 0.3.5 by paramat +-- watershed 0.3.6 by paramat -- For latest stable Minetest and back to 0.4.8 -- Depends default bucket --- License: code WTFPL +-- License: code WTFPL, textures CC BY-SA +-- Red cobble texture CC BY-SA by brunob.santos minetestbr.blogspot.com + +-- added turquoise fresh ice node +-- bugfix: stone drops default:cobble +-- add red cobble, texture by brunob.santos +-- redo clouds using fissure and humid noises, new texture -- Parameters @@ -9,8 +15,8 @@ local YMIN = -33000 -- Approximate base of realm stone local YMAX = 33000 -- Approximate top of atmosphere / mountains / floatlands local TERCEN = -160 -- Terrain 'centre', average seabed level local YWAT = 1 -- Sea surface y -local YCLOUD = 256 -- Cloud level -local CLOUDS = true +local YCLOMIN = 287 -- Minimum height of mod clouds +local CLOUDS = true -- Mod clouds? local TERSCA = 512 -- Vertical terrain scale local XLSAMP = 0.2 -- Extra large scale height variation amplitude @@ -26,15 +32,13 @@ local TLAVA = 2.3 -- Maximum densitybase threshold for lava, small because grad local FIST = 0 -- Fissure threshold at surface, controls size of fissure entrances at surface local FISEXP = 0.02 -- Fissure expansion rate under surface local ORETHI = 0.001 -- Ore seam thickness tuner -local ORET = 0.02 -- Ore threshold for seam -local TCLOUD = 0.5 -- Cloud threshold +local SEAMT = 0.02 -- Seam threshold local HITET = 0.35 -- High temperature threshold local LOTET = -0.35 -- Low .. local ICETET = -0.7 -- Ice .. local HIHUT = 0.35 -- High humidity threshold local LOHUT = -0.35 -- Low .. -local CLOHUT = 0.35 -- Cloud humidity threshold local PINCHA = 36 -- Pine tree 1/x chance per node local APTCHA = 36 -- Appletree @@ -115,9 +119,9 @@ local np_humid = { persist = 0.5 } --- 3D noise for ore seams +-- 3D noise for ore seam networks -local np_ore = { +local np_seam = { offset = 0, scale = 1, spread = {x=512, y=128, z=512}, @@ -126,7 +130,7 @@ local np_ore = { persist = 0.5 } --- 3D noise for rock strata +-- 3D noise for rock strata inclination local np_strata = { offset = 0, @@ -159,17 +163,6 @@ local np_xlscale = { persist = 0.4 } --- 2D noise for clouds - -local np_cloud = { - offset = 0, - scale = 1, - spread = {x=207, y=207, z=207}, - seed = 2113, - octaves = 4, - persist = 0.7 -} - -- 2D noise for magma surface local np_magma = { @@ -236,16 +229,17 @@ minetest.register_on_generated(function(minp, maxp, seed) local c_grass5 = minetest.get_content_id("default:grass_5") local c_obsidian = minetest.get_content_id("default:obsidian") - local c_wswater = minetest.get_content_id("watershed:water") + local c_wsfreshwater = minetest.get_content_id("watershed:freshwater") local c_wsstone = minetest.get_content_id("watershed:stone") local c_wsredstone = minetest.get_content_id("watershed:redstone") local c_wsgrass = minetest.get_content_id("watershed:grass") local c_wsdrygrass = minetest.get_content_id("watershed:drygrass") - local c_wsgoldgrass = minetest.get_content_id("watershed:goldengrass") + local c_wsgoldengrass = minetest.get_content_id("watershed:goldengrass") local c_wsdirt = minetest.get_content_id("watershed:dirt") - local c_wscloud = minetest.get_content_id("watershed:cloud") local c_wspermafrost = minetest.get_content_id("watershed:permafrost") local c_wslava = minetest.get_content_id("watershed:lava") + local c_wsfreshice = minetest.get_content_id("watershed:freshice") + local c_wscloud = minetest.get_content_id("watershed:cloud") -- perlinmap stuff local sidelen = x1 - x0 + 1 local chulens = {x=sidelen, y=sidelen+2, z=sidelen} @@ -258,12 +252,11 @@ minetest.register_on_generated(function(minp, maxp, seed) local nvals_fissure = minetest.get_perlin_map(np_fissure, chulens):get3dMap_flat(minposxyz) local nvals_temp = minetest.get_perlin_map(np_temp, chulens):get3dMap_flat(minposxyz) local nvals_humid = minetest.get_perlin_map(np_humid, chulens):get3dMap_flat(minposxyz) - local nvals_ore = minetest.get_perlin_map(np_ore, chulens):get3dMap_flat(minposxyz) + local nvals_seam = minetest.get_perlin_map(np_seam, chulens):get3dMap_flat(minposxyz) local nvals_strata = minetest.get_perlin_map(np_strata, chulens):get3dMap_flat(minposxyz) local nvals_base = minetest.get_perlin_map(np_base, chulens):get2dMap_flat(minposxz) local nvals_xlscale = minetest.get_perlin_map(np_xlscale, chulens):get2dMap_flat(minposxz) - local nvals_cloud = minetest.get_perlin_map(np_cloud, chulens):get2dMap_flat(minposxz) local nvals_magma = minetest.get_perlin_map(np_magma, chulens):get2dMap_flat(minposxz) local ungen = false -- ungenerated chunk below? @@ -303,11 +296,10 @@ minetest.register_on_generated(function(minp, maxp, seed) local tsand = TSAND * (1 - terblen) local tstone = TSTONE * (1 + grad * 0.5) local tlava = TLAVA * (1 - nvals_magma[nixz] ^ 4 * terblen ^ 16 * 0.5) - local nofis = false - if density >= 0 then -- if terrain set fissure flag - if math.abs(nvals_fissure[nixyz]) > FIST + math.sqrt(density) * FISEXP then - nofis = true - end + + local nofis = false -- set fissure bool + if math.abs(nvals_fissure[nixyz]) > FIST + math.sqrt(density) * FISEXP then + nofis = true end -- overgeneration and in-chunk generation if y == y0 - 1 then -- node layer below chunk @@ -317,7 +309,7 @@ minetest.register_on_generated(function(minp, maxp, seed) else stable[si] = 0 end - else + else -- scan top layer of chunk below local nodename = minetest.get_node({x=x,y=y,z=z}).name if nodename == "watershed:stone" or nodename == "watershed:redstone" @@ -385,7 +377,7 @@ minetest.register_on_generated(function(minp, maxp, seed) data[vi] = c_sandstone elseif biome == 7 and density < TSTONE * 3 then -- desert stone data[vi] = c_wsredstone - elseif math.abs(nvals_ore[nixyz]) < ORET then -- if seam + elseif math.abs(nvals_seam[nixyz]) < SEAMT then -- if seam if densityper >= 0.9 and densityper <= 0.9 + ORETHI and math.random(23) == 2 then data[vi] = c_stodiam @@ -466,22 +458,19 @@ minetest.register_on_generated(function(minp, maxp, seed) under[si] = 0 elseif densitybase >= triv and density < tstone then -- river water, not in fissures if n_temp < ICETET then - data[vi] = c_ice + data[vi] = c_wsfreshice else - data[vi] = c_wswater + data[vi] = c_wsfreshwater end stable[si] = 0 under[si] = 0 - elseif CLOUDS and y == YCLOUD then -- clouds + elseif CLOUDS and y == y1 and y >= YCLOMIN then -- clouds at chunk top local xrq = 16 * math.floor((x - x0) / 16) -- quantise to 16x16 lattice local zrq = 16 * math.floor((z - z0) / 16) - local qixz = zrq * 80 + xrq + 1 -- quantised index - if nvals_cloud[qixz] > TCLOUD then - local yrq = 16 * math.floor((y - y0) / 16) - local qixyz = zrq * 6400 + yrq * 80 + xrq + 1 - if nvals_humid[qixyz] > CLOHUT then - data[vi] = c_wscloud - end + local yrq = 79 + local qixyz = zrq * 6400 + yrq * 80 + xrq + 1 -- quantised 3D index + if math.abs(nvals_fissure[qixyz]) < nvals_humid[qixyz] * 0.1 then + data[vi] = c_wscloud end stable[si] = 0 under[si] = 0 @@ -490,7 +479,7 @@ minetest.register_on_generated(function(minp, maxp, seed) local fnoise = nvals_fissure[nixyz] if under[si] == 1 then if math.random(121) == 2 then - data[viu] = c_dirtsnow + data[viu] = c_snowblock elseif math.random(121) == 2 then data[viu] = c_ice else @@ -513,7 +502,7 @@ minetest.register_on_generated(function(minp, maxp, seed) data[viu] = c_wsdrygrass if math.random(GRACHA) == 2 then if math.random(5) == 2 then - data[vi] = c_wsgoldgrass + data[vi] = c_wsgoldengrass else data[vi] = c_dryshrub end @@ -550,7 +539,7 @@ minetest.register_on_generated(function(minp, maxp, seed) else data[viu] = c_wsdrygrass if math.random(GOGCHA) == 2 then - data[vi] = c_wsgoldgrass + data[vi] = c_wsgoldengrass end end elseif under[si] == 9 then diff --git a/nodes.lua b/nodes.lua index 1262624..022a25a 100644 --- a/nodes.lua +++ b/nodes.lua @@ -67,6 +67,15 @@ minetest.register_node("watershed:redstone", { tiles = {"default_desert_stone.png"}, is_ground_content = false, groups = {cracky=3}, + drop = "watershed:redcobble", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("watershed:redcobble", { + description = "WS Red Cobblestone", + tiles = {"watershed_redcobble.png"}, + is_ground_content = false, + groups = {cracky=3, stone=2}, sounds = default.node_sound_stone_defaults(), }) @@ -75,24 +84,10 @@ minetest.register_node("watershed:stone", { tiles = {"default_stone.png"}, is_ground_content = false, groups = {cracky=3}, + drop = "default:cobble", sounds = default.node_sound_stone_defaults(), }) -minetest.register_node("watershed:cloud", { - description = "WS Cloud", - drawtype = "glasslike", - tiles = {"watershed_cloud.png"}, - paramtype = "light", - is_ground_content = false, - sunlight_propagates = true, - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - post_effect_color = {a=64, r=241, g=248, b=255}, - groups = {not_in_creative_inventory=1}, -}) - minetest.register_node("watershed:cactus", { description = "WS Cactus", tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"}, @@ -146,7 +141,6 @@ minetest.register_node("watershed:vine", { description = "WS Jungletree Vine", drawtype = "airlike", paramtype = "light", - sunlight_propagates = true, walkable = false, climbable = true, pointable = false, @@ -156,20 +150,42 @@ minetest.register_node("watershed:vine", { groups = {not_in_creative_inventory=1}, }) -minetest.register_node("watershed:water", { - description = "WS Water Source", - inventory_image = minetest.inventorycube("watershed_water.png"), +minetest.register_node("watershed:freshice", { + description = "WS Fresh Ice", + tiles = {"watershed_freshice.png"}, + is_ground_content = false, + paramtype = "light", + groups = {cracky=3}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_node("watershed:cloud", { + description = "WS Cloud", + drawtype = "glasslike", + tiles = {"watershed_cloud.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + post_effect_color = {a=23, r=241, g=248, b=255}, +}) + +minetest.register_node("watershed:freshwater", { + description = "WS Fresh Water Source", + inventory_image = minetest.inventorycube("watershed_freshwater.png"), drawtype = "liquid", tiles = { { - name="watershed_wateranim.png", + name="watershed_freshwateranim.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0} } }, special_tiles = { { - name="watershed_wateranim.png", + name="watershed_freshwateranim.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}, backface_culling = false, @@ -185,8 +201,8 @@ minetest.register_node("watershed:water", { drop = "", drowning = 1, liquidtype = "source", - liquid_alternative_flowing = "watershed:waterflow", - liquid_alternative_source = "watershed:water", + liquid_alternative_flowing = "watershed:freshwaterflow", + liquid_alternative_source = "watershed:freshwater", liquid_viscosity = WATER_VISC, liquid_renewable = false, liquid_range = 2, @@ -194,19 +210,19 @@ minetest.register_node("watershed:water", { groups = {water=3, liquid=3, puts_out_fire=1}, }) -minetest.register_node("watershed:waterflow", { - description = "WS Flowing Water", - inventory_image = minetest.inventorycube("watershed_water.png"), +minetest.register_node("watershed:freshwaterflow", { + description = "WS Fresh Flowing Water", + inventory_image = minetest.inventorycube("watershed_freshwater.png"), drawtype = "flowingliquid", - tiles = {"default_water.png"}, + tiles = {"watershed_freshwater.png"}, special_tiles = { { - image="watershed_waterflowanim.png", + image="watershed_freshwaterflowanim.png", backface_culling=false, animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8} }, { - image="watershed_waterflowanim.png", + image="watershed_freshwaterflowanim.png", backface_culling=true, animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8} }, @@ -222,8 +238,8 @@ minetest.register_node("watershed:waterflow", { drop = "", drowning = 1, liquidtype = "flowing", - liquid_alternative_flowing = "watershed:waterflow", - liquid_alternative_source = "watershed:water", + liquid_alternative_flowing = "watershed:freshwaterflow", + liquid_alternative_source = "watershed:freshwater", liquid_viscosity = WATER_VISC, liquid_renewable = false, liquid_range = 2, diff --git a/textures/watershed_bucketwater.png b/textures/watershed_bucketfreshwater.png similarity index 100% rename from textures/watershed_bucketwater.png rename to textures/watershed_bucketfreshwater.png diff --git a/textures/watershed_cloud.png b/textures/watershed_cloud.png index 348c78c4842f8a47ab9a210199198100e4f4ea1b..239dedef86c52eab7f0627bed9f86c683d31f965 100644 GIT binary patch delta 67 zcmeBR>|mVWV{?y%lUbQ@dBbsO1_lNxPZ!4!jq}Mhzh22RYc_N?x)`iV3^{z^A_K#r XrA%)nT2E8}RWW$F`njxgN@xNA_mCHD delta 67 zcmeBR>|mVWV{?~`sfT~2XUW;2IxYqkT0q&!_5Lp07O$85Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01m?d01m?e$8V@)00007bV*G`2i^n- z0x$)5d{4pv00N9jL_t(I%RQ4#ZyZGshM(&B?g2z>oK09`giw6q;GhJ{AdoEo%?R;F zA`TEt#KCKh;gs0PCQ5dJXs4&=qq{f^>yrA^Ri&z@-d7%7L{(L?MA*g{!MBbNYD*s= zH4t@rMy9`Q7~eWXgs(n!w7z50IF5E4)>_60-yaBFKad*GFfa@QWo5}ri-=&#%90vb ztSun~PVdz$)>H9b8F>7xK~TmBKYWpsWf@Un{-IFY3e)+PF+%5C&JJtNua$A=xmzo% zF2Pz$S>zn;IDU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