[Mod] Snow Biomes [4.0] [snow]

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Snow Biomes [3.2] [snow]

by Hybrid Dog » Post

snowing in the desert…
Image
Attachments
desert_snow.png
desert_snow.png (372.08 KiB) Viewed 527 times

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
Splizard
Member
Posts: 227
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard
Location: New Zealand
Contact:

Re: [Mod] Snow Biomes [3.2] [snow]

by Splizard » Post

Does it make a difference where you are in the desert?
Snow should only fall in a biome specified area.. which can still be in a desert but it shouldn't be the whole desert..
Games: Builda City, The Hungry Games Mods: Lifters, Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Snow Biomes [3.2] [snow]

by Hybrid Dog » Post

Splizard wrote:Does it make a difference where you are in the desert?
Snow should only fall in a biome specified area.. which can still be in a desert but it shouldn't be the whole desert..
Yes, it's just a part of the desert. But l think that snow falling in a desert next to a cactus and a palm tree is a bit strange.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
Echoes91
Member
Posts: 80
Joined: Thu Feb 19, 2015 13:21
In-game: Echoes
Location: Lombardy, Italy

Re: [Mod] Snow Biomes [3.2] [snow]

by Echoes91 » Post

Since pines are now in default, I think you could replace all

Code: Select all

snow:pinetree, snow:needles, snow:sapling_pine
with

Code: Select all

default:pinetree, default:pine_needles, default:pine_sapling

User avatar
Diamond knight
Member
Posts: 475
Joined: Sun Apr 19, 2015 19:50
GitHub: Diamondknight
In-game: Ferrumprinceps
Location: Chilling in Constantinople
Contact:

Re: [Mod] Snow Biomes [3.2] [snow]

by Diamond knight » Post

do you know any seeds that will generate a snow biome at your spawn

Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Snow Biomes [3.2] [snow]

by Minetestforfun » Post

@Diamond knight
You can also simply set a spawn in snow biome :)

@Splizard
I've also snow falling in desert in my server (mapgenv6, very similar to Carbone default)

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Snow Biomes [3.2] [snow]

by Don » Post

It wasn't too long ago that Afghanistan had a major snow storm. Snow falls in the desert sometimes
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Snow Biomes [3.2] [snow]

by Hybrid Dog » Post

Shall l disable snowflakes in desert or make it rare?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
mahmutelmas06
Member
Posts: 367
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Snow Biomes [3.2] [snow]

by mahmutelmas06 » Post

Hybrid Dog wrote:Shall l disable snowflakes in desert or make it rare?
In my opinion its better to disable in desert.
My Mods:

Beverage

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Snow Biomes [3.2] [snow]

by Hybrid Dog » Post


‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Ivà
Member
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua
Location: Catalonia

Re: [Mod] Snow Biomes [3.2] [snow]

by Ivà » Post

I've got crashes like:

Code: Select all

terminate called after throwing an instance of 'ServerError'
  what():  .../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:99: attempt to perform arithmetic on local 'x' (a nil value)
stack traceback:
	.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:99: in function 'get_snow'
	.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:191: in function <.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:183>
	/usr/share/minetest/builtin/game/register.lua:341: in function </usr/share/minetest/builtin/game/register.lua:329>
Changing the get_snow function code as below solves the crash:

Code: Select all

--Get snow at position.
local get_snow = function(pos)
        --Legacy support.
        if weather_legacy == "snow" then
                local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
                local x = pos.x
                local y = pos.z
                if perlin1:get2d({x, y}) <= 0.53 then
                        return false
                end

                -- disable falling snow in desert
                local desert_perlin = minetest.get_perlin(SEEDDIFF3, OCTAVES3, PERSISTENCE3, SCALE3)
                local noise3 = desert_perlin:get2d({x=x+150,y=y+50}) -- Offsets must match minetest mapgen desert perlin.
                if noise3 > 0.35 then -- Smooth transition 0.35 to 0.45.
                        return false
                end
                return true
        end
        return false
end

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Snow Biomes [3.2] [snow]

by Hybrid Dog » Post

Ivà wrote:I've got crashes like:

Code: Select all

terminate called after throwing an instance of 'ServerError'
  what():  .../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:99: attempt to perform arithmetic on local 'x' (a nil value)
stack traceback:
	.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:99: in function 'get_snow'
	.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:191: in function <.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:183>
	/usr/share/minetest/builtin/game/register.lua:341: in function </usr/share/minetest/builtin/game/register.lua:329>
Changing the get_snow function code as below solves the crash:

Code: Select all

--Get snow at position.
local get_snow = function(pos)
        --Legacy support.
        if weather_legacy == "snow" then
                local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
                local x = pos.x
                local y = pos.z
                if perlin1:get2d({x, y}) <= 0.53 then
                        return false
                end

                -- disable falling snow in desert
                local desert_perlin = minetest.get_perlin(SEEDDIFF3, OCTAVES3, PERSISTENCE3, SCALE3)
                local noise3 = desert_perlin:get2d({x=x+150,y=y+50}) -- Offsets must match minetest mapgen desert perlin.
                if noise3 > 0.35 then -- Smooth transition 0.35 to 0.45.
                        return false
                end
                return true
        end
        return false
end
thanks, now its not longer untested and should work
https://github.com/Splizard/minetest-mo ... 65c046f500

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Ivà
Member
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua
Location: Catalonia

Re: [Mod] Snow Biomes [3.2] [snow]

by Ivà » Post

Ehmm... but... I didn't dig into the code so I'm not sure that x and y got the intended values here, for example in noise3 assignment there was a 'z' laying around... :-)

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Snow Biomes [3.2] [snow]

by Hybrid Dog » Post

Ivà wrote:Ehmm... but... I didn't dig into the code so I'm not sure that x and y got the intended values here, for example in noise3 assignment there was a 'z' laying around... :-)
l forgot to change "x, z", what l copied from the meru mod.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] Snow Biomes [3.2] [snow]

by paramat » Post

There's a new bug that was posted as an engine issue on Github https://github.com/minetest/minetest/issues/2672
The latest commit by melzua is wrong, 'get2D()' doesn't have the form '{x = ..., y = ...}':

Code: Select all

if perlin1:get2d({x, y}) <= 0.53 then
2D noise always uses abstract variables x and y, these then represent world position x and z.

You left x and z undefined when calculating noise3:

Code: Select all

local noise3 = desert_perlin:get2d({x=x+150,y=z+50}) -- Offsets must match minetest mapgen desert perlin.
The correct code is:

Code: Select all

--Get snow at position.
local get_snow = function(pos)
	--Legacy support.
	if weather_legacy == "snow" then
		local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
		if perlin1:get2d({x=pos.x, y=pos.z}) <= 0.53 then
			return false
		end

		-- disable falling snow in desert
		local desert_perlin = minetest.get_perlin(SEEDDIFF3, OCTAVES3, PERSISTENCE3, SCALE3)
		local noise3 = desert_perlin:get2d({x=pos.x+150,y=pos.z+50}) -- Offsets must match minetest mapgen desert perlin.
		if noise3 > 0.35 then -- Smooth transition 0.35 to 0.45.
			return false
		end
		return true
	end
	return false
end

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Snow Biomes [3.2] [snow]

by Hybrid Dog » Post

paramat wrote:There's a new bug that was posted as an engine issue on Github https://github.com/minetest/minetest/issues/2672
The latest commit by melzua is wrong, 'get2D()' doesn't have the form '{x = ..., y = ...}':

Code: Select all

if perlin1:get2d({x, y}) <= 0.53 then
2D noise always uses abstract variables x and y, these then represent world position x and z.
it should be fixed now
Ivà wrote "Changing the get_snow function code as below solves the crash", so l didn't look for such a mistake.
paramat wrote:You left x and z undefined when calculating noise3
l changed z to y when l did this commit https://github.com/Splizard/minetest-mo ... 65c046f500
and x and y are defined

Edit:l just tested falling snow and it worked for me.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] Snow Biomes [3.2] [snow]

by paramat » Post

That will work, but is messy and has unnecessary code, faster to use pos.x and pos.z directly as in my post.

Splizard, please can you remove my push access to this repo? I don't have time to be involved as a mod dev anymore.

Optional snow biomes are now added to 0.4.12dev mgv6 C++ mapgen, add "mgv6_spflags = snowbiomes" to your minetest.conf file.

Ivà
Member
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua
Location: Catalonia

Re: [Mod] Snow Biomes [3.2] [snow]

by Ivà » Post

Apologise for the mistake, was late at night for me and did a quick fix to solve the crash but I didn't dig more into the code.

So sorry.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] Snow Biomes [3.2] [snow]

by paramat » Post

Hey no problem =)

The abstract internal variables x, y used by 2D perlin noise are often confused with world co-ordinates so it's best they only ever appear inside get2d() as [x = ..., y = ...}.

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Snow Biomes [3.2] [snow]

by Hybrid Dog » Post

paramat wrote:That will work, but is messy and has unnecessary code, faster to use pos.x and pos.z directly as in my post.
ok, l edited it.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
Splizard
Member
Posts: 227
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard
Location: New Zealand
Contact:

Re: [Mod] Snow Biomes [3.2] [snow]

by Splizard » Post

@Paramat I have removed your push access as you requested.
@Hybrid Dog nice to see you have been working on snow mod :)
let me know if you want me to release a new version!
Games: Builda City, The Hungry Games Mods: Lifters, Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Snow Biomes [3.2] [snow]

by Hybrid Dog » Post

ok

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Snow Biomes [3.2] [snow]

by Minetestforfun » Post

The Sled doesn't work for me, can you check it please ? :)
(i would create a event with it :p)

User avatar
Splizard
Member
Posts: 227
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard
Location: New Zealand
Contact:

Re: [Mod] Snow Biomes [3.2] [snow]

by Splizard » Post

@Minetestforfun
Sleds should be fixed in the latest development version :)
Games: Builda City, The Hungry Games Mods: Lifters, Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Snow Biomes [3.2] [snow]

by Minetestforfun » Post

@Splizard
Thank you very much for this fix :)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 44 guests