Fresh ice, red cobble, redo clouds with existing noises
| @@ -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 | ||||
| Depends default bucket | ||||
| Licenses: code WTFPL, textures CC BY-SA | ||||
| watershed:redcobble texture CC BY-SA by brunob.santos minetestbr.blogspot.com | ||||
| @@ -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) | ||||
|   | ||||
							
								
								
									
										81
									
								
								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 | ||||
|   | ||||
							
								
								
									
										78
									
								
								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, | ||||
|   | ||||
| Before Width: | Height: | Size: 330 B After Width: | Height: | Size: 330 B | 
| Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 136 B | 
| Before Width: | Height: | Size: 136 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/watershed_freshice.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 780 B | 
| Before Width: | Height: | Size: 713 B After Width: | Height: | Size: 713 B | 
| Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB | 
| Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB | 
| Before Width: | Height: | Size: 711 B After Width: | Height: | Size: 683 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/watershed_redcobble.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 686 B |