[Mod] Weather (Snow, Rain) [weather]

deivan
Member
Posts: 452
Joined: Fri Feb 15, 2013 10:16
Location: Brazil. :D

by deivan » Post

I have rain inside my builds... :-o

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

That shouldn't happen as long as you stand inside your buildings or in caves.
Redstone for minetest: Mesecons (mesecons.net)

User avatar
Traxie21
Member
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.
Contact:

by Traxie21 » Post

There seems to be a significant hang after a few minutes of running this. Kinda like the lag piles up on itself.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

Traxie21 wrote:There seems to be a significant hang after a few minutes of running this. Kinda like the lag piles up on itself.
I can confirm that.
After letting it run for about 10 minutes, I get ~3 sec of lag.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Traxie21
Member
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.
Contact:

by Traxie21 » Post

Oh no, its just how you feel. If you stare outside a window on a rainy day, you start to feel tired and laggy too. :P

deivan
Member
Posts: 452
Joined: Fri Feb 15, 2013 10:16
Location: Brazil. :D

by deivan » Post

No... I have rain inside my builds... Maybe need test nodes like glass, here I have a floor with glass and the rain is here. :D
I don't have lag with this mod, maybe is a punctual problem.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

That's how the mod works: it rains/snows everywhere when you're not under a walkable node, and it doesn't rain/snow when you're under a walkable node.

deivan
Member
Posts: 452
Joined: Fri Feb 15, 2013 10:16
Location: Brazil. :D

by deivan » Post

Sorry, but don't is working here... Maybe the rain is created inside my building, is in the second floor.

I am at (xyz) 13,9,17 in this screen.

Screen shots:
Image
Image
Image
Image

deivan
Member
Posts: 452
Joined: Fri Feb 15, 2013 10:16
Location: Brazil. :D

by deivan » Post

After some time I don't see any thing crossing stones or wood, only the glass.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

Very nice mod, I shall totally follow this!

One question however: How are the particle effects implemented for rain and snow? Is it spawning fake nodes in the air (animated drawtype_plant), is each particle a Lua entity, or does it use the recent particles system in the engine (that torches make use of for smoke)? Also, how much performance do the particles decrease?

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

It uses my recently merged Particle System with ParticleSpawners. The performance depends mostly on the client that has to animate them (up to 20 fps drop for me from 60 fps); The server isn't really affected.

@deivan: Didn't know you were using a glass roof; This mod calculates wheter you're inside or outside using light; so in your case the light in the house makes the mod think you're outside
Redstone for minetest: Mesecons (mesecons.net)

deivan
Member
Posts: 452
Joined: Fri Feb 15, 2013 10:16
Location: Brazil. :D

by deivan » Post

Case solved. :D
-*-
...but don't is better implement a weather in a area than make it using a player as reference?

Like, if particle found something he disappear. Like the snow mod. (Biome mode?)
Last edited by deivan on Thu Apr 04, 2013 15:41, edited 1 time in total.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

Jeija wrote:It uses my recently merged Particle System with ParticleSpawners. The performance depends mostly on the client that has to animate them (up to 20 fps drop for me from 60 fps); The server isn't really affected.

@deivan: Didn't know you were using a glass roof; This mod calculates wheter you're inside or outside using light; so in your case the light in the house makes the mod think you're outside
Ok. That sounds like the right way, I was worried this might have been done with older and uglier possibilities at first. After all I would love to see this as part of MineTest soon :) Didn't know you implemented the new particle system also... nice work on that too! And that does sound like a bit of a FPS drop, but I guess it can't be helped and it's the best Irrlicht can do with so many sprites.

As for the glass problem, that sounds like a bit of an issue to fix. I don't know how the weather code is implemented in detail... but instead of using light to check where weather should show, isn't it possible to just check if there's a block between the sky and that area? If tracing every node horizontally isn't a problem of course.
Last edited by MirceaKitsune on Thu Apr 04, 2013 17:44, edited 1 time in total.

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

I would also prefer using Biomes as references and use collision detection to make rain not enter houses, but I guess you don't run a supercomputer with 4 GPUs and two octacores to calculate all that...
The problem is that particles would lag the client too much, so I had to reduce the number of particles by just spawning them near the player :(
Redstone for minetest: Mesecons (mesecons.net)

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

Tried the mod last night. It's very good and works almost great... almost. I noticed several issues and although some might be known I thought to report everything here:

- Worst problem anyone will notice is that when sitting under a node, weather particles instantly disappear. This is a common problem when weather is done as a sphere of particles that follow the camera, to keep rain from showing indoors (Grant Theft Auto <= San Andreas games had the same issue).

* Not sure if this is possible, but my suggested fix would be to only cut particles inside the part of the "sphere" that's indoors. So for example if the player is two nodes under a ceiling, the ceiling "cuts" the virtual sphere and only the part that's >= 3 nodes toward the exit still works. This would allow weather to show outside correctly when you're indoor until you're inside so much the draw limit is reached.

- Weather is very laggy and slow to update at times. Especially if you're using fast movement to run, particles can barely follow you. I assume that although the particle spawner is client-side, the server must update its origin to follow the player (which is also very bandwidth costly).

* Only fix I can think of is allowing particle spawners to be attached to objects client-side, which would be useful in a lot of circumstances. Should be as easy as giving the particle system an entity to follow, and simply use the object's origin + (optional) offset to spawn particles. That way the server would only send a packet to clients once to start or stop weather.

- Last problem I noticed is that when looking up, rain is stretched incorrectly. When looking forward rain falls properly, but if looking upward you see blue lines coming toward you.

* Particles are set to fully face the camera. Perhaps weather particles should only face the camera horizontally, not vertically too. This is possible with sprite entities though I don't know about the current particle system.

On the brighter side, I noticed no FPS decrease at all when weather was enabled. At least none I could sense, so on this side it's all good. Love the idea and I hope something can be done about the remaining problems... this needs to be part of MineTest IMO :)
Last edited by MirceaKitsune on Fri Apr 05, 2013 13:24, edited 1 time in total.

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

by Splizard » Post

MirceaKitsune wrote:
- Weather is very laggy and slow to update at times. Especially if you're using fast movement to run, particles can barely follow you. I assume that although the particle spawner is client-side, the server must update its origin to follow the player (which is also very bandwidth costly).

* Only fix I can think of is allowing particle spawners to be attached to objects client-side, which would be useful in a lot of circumstances. Should be as easy as giving the particle system an entity to follow, and simply use the object's origin + (optional) offset to spawn particles. That way the server would only send a packet to clients once to start or stop weather.
Just for reference, there is an issue on that:
https://github.com/minetest/minetest/issues/567
Games: Builda City, The Hungry Games Mods: Lifters, Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

Splizard wrote: Just for reference, there is an issue on that:
https://github.com/minetest/minetest/issues/567
Oh, thanks for mentioning that. I totally support it and it would prolly fix the weather lag issue too.

User avatar
fairiestoy
Member
Posts: 191
Joined: Sun Jun 09, 2013 19:25
Location: Germany

by fairiestoy » Post

Hey guys,
first of all, thanks to the one who made this mod. It really gives minetest more feeling inside the world. Nice work. I just changed the rain.lua to this:

Code: Select all

-- Rain
minetest.register_globalstep(function(dtime)
    if weather ~= "rain" then return end
    for _, player in ipairs(minetest.get_connected_players()) do
        local ppos = player:getpos()

        -- Make sure player is not in a cave/house...
        --[[ if minetest.env:get_node_light(ppos, 0.5) ~= 15 then return end ]]

        local minp = addvectors(ppos, {x=-9, y=7, z=-9})
        local maxp = addvectors(ppos, {x= 9, y=7, z= 9})

        local vel = {x=0, y=   -4, z=0}
        local acc = {x=0, y=-9.81, z=0}

        minetest.add_particlespawner(25, 0.5,
            minp, maxp,
            vel, vel,
            acc, acc,
            0.3, 1.2,
            25, 25,
            true, "weather_rain.png", player:get_player_name())
    end
end)
And wanted to ask, if this could cause major problems since i have no proof if the engine could stop spawning rain (for example if i am on a deep mining mission. Would be senseless there). How could I solve this the best way? I was thinking of checking the depth of the player (means how many blocks are above and / or in a specific range of the player). Im not familiar with coding in Lua, so this is like writing an exam in medical sience to me.

Greetings...

fairiestoy
Interesting about new things is, to figure out how it works ...

User avatar
cornellius
Member
Posts: 82
Joined: Sat Dec 01, 2012 05:08
Location: South East Asian

by cornellius » Post

can you change the rain weather texture?? yeah when you look up the rain texture looks bad


,Thanks
All Humans Need Is Forgiveness, God Is The First One Who Forgive All Humans So Humans Must Forgive Other Humans

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

cornellius wrote:can you change the rain weather texture?? yeah when you look up the rain texture looks bad


,Thanks
Not the texture's fault. Weather particles always face the camera, and due to this rain looks completely messed when looking up. I think the solution is to face particles to the camera only horizontally.

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

I like what this mod does and wish it the best of luck.

ndjdjksisksk
Member
Posts: 130
Joined: Mon May 06, 2013 04:11

by ndjdjksisksk » Post

i have a segeston: you should make weather change randomly so you don't have to have a privlage


epic mod i love weather in minetest
nvm about me leaving minetest but i probably will for a while because i have nothing to do in this comunity becaise i can't make a server. my username is going to change i will make a new acount called stormchaser3000

proller
Member
Posts: 222
Joined: Sat Jan 26, 2013 15:22

by proller » Post


User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

proller wrote:making dynamic weather
using heat-humidity dynamic map
with melting and freezing

https://github.com/proller/minetest/tree/weather
https://github.com/proller/minetest_game/tree/weather
https://github.com/proller/minetest-mod ... ee/weather

todo:evaporation
That is wonderful news, proller. I hope that it all works out in the end.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

proller wrote:making dynamic weather
using heat-humidity dynamic map
with melting and freezing

https://github.com/proller/minetest/tree/weather
https://github.com/proller/minetest_game/tree/weather
https://github.com/proller/minetest-mod ... ee/weather

todo:evaporation
Saw this on IRC today. Very nice idea, really eager to see it done!

But like I said, I'm not going to even try it yet as long as it contains hard-coded nodes. I believe no node OR type of weather should be added to C++... just the mechanics to define them from Lua. The way I'd like to see weather made possible in a better way is by having a 'sky particles' system (same as current particles but coming from the sky and culled by ceilings) and separately, a system to set fog colors to clients (which would also be part of my idea to make the sky configurable, I hope that won't conflict with this implementation).
Last edited by MirceaKitsune on Sun Jul 14, 2013 23:06, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 18 guests