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

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

by proller » Sun Jul 28, 2013 13:37

Core support for heat, humidity, leveled nodes merged into master.
now with latests git can try https://github.com/proller/minetest-mod-weather/tree/weather
 

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

by Inocudom » Sun Jul 28, 2013 15:26

proller wrote:Core support for heat, humidity, leveled nodes merged into master.
now with latests git can try https://github.com/proller/minetest-mod-weather/tree/weather


This sounds like something Bas080, Hybrid Dog, and VanessaE can really put to good use.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Tue Aug 06, 2013 22:05

I'm working on a lightweight fork of this mod where individual snowflake particles are spawned.
EDIT snowflakes drift southward as clouds do, just a little slower.
Last edited by paramat on Wed Aug 07, 2013 23:22, edited 1 time in total.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

by Bas080 » Wed Aug 07, 2013 01:41

This can be improved. What if weather is locational and not only random.

A big improvement would be that when you walk the particles are spawned a bit in front of the player. That way the particles that are spawned are more visible and are used more effectively. I'm sure you'll figure out how to achieve this.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Wed Aug 07, 2013 18:59

Bas080, in my version snow will be dependant on biome.
Last edited by paramat on Fri Aug 09, 2013 01:12, edited 1 time in total.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Wed Aug 07, 2013 21:36

Jeija, see useful info on terminal velocity in this thread https://forum.minetest.net/viewtopic.php?id=2290&p=5
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

User avatar
Chinchow
Member
 
Posts: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Wed Aug 07, 2013 22:27

paramat wrote:I'm working on a lightweight fork of this mod where individual snowflake particles are spawned.
EDIT snowflakes drift southward as clouds do, just a little slower.


http://i.imgur.com/G2wHG2c.png

This is cool but is it possible to make the sky a little less bright to those in a snowy area so that it mimics a snowy day?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

by paramat » Wed Aug 07, 2013 23:28

Hmm not sure ... however my snowfall is very light so makes sense in a world with only a few clouds.
Forum member proller is working on more complex weather.
I rely on donations to help provide an income https://forum.minetest.net/viewtopic.php?f=3&t=14935
 

User avatar
Splizard
Member
 
Posts: 220
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard

by Splizard » Thu Aug 08, 2013 10:34

Bas080 wrote:This can be improved. What if weather is locational and not only random.

A big improvement would be that when you walk the particles are spawned a bit in front of the player. That way the particles that are spawned are more visible and are used more effectively. I'm sure you'll figure out how to achieve this.

Snow fall in the current version of snow mod, is only spawned in snow biomes.
Games: The Hungry Games.
Mods: Lifters (Simple Lifts), Snow Biomes and Gates.
Also checkout my texture pack Gridtoon!
View all of them plus more at http://minetest.splizard.com! (may not always be online).
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Tue Aug 20, 2013 20:04

I want the snow to accumulate. how to do it?
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

samreenkhud
New member
 
Posts: 1
Joined: Wed Sep 11, 2013 07:49

by samreenkhud » Wed Sep 11, 2013 07:53

I will attempt to disseminate all that I have discussed and learned over the last 36 hours.

weather in pakistan
Last edited by samreenkhud on Thu Sep 12, 2013 07:12, edited 1 time in total.
 

TheFlannelOne
New member
 
Posts: 3
Joined: Mon Sep 16, 2013 02:02

by TheFlannelOne » Tue Sep 17, 2013 05:04

I'm getting this error:

21:51:15: ERROR[main]: ServerError: LuaError: error: ...bin\..\mods\minetest-mod-weather-master\weather/rain.lua:16: bad argument #1 to 'add_particlespawner' (number expected, got table)

I'm on windows 7 using minetest-0.4.7-72b9b0f-fixes-win32

The snow works fine. This error only happens when it rains.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Tue Sep 17, 2013 06:22

TheFlannelOne wrote:I'm getting this error:

21:51:15: ERROR[main]: ServerError: LuaError: error: ...bin\..\mods\minetest-mod-weather-master\weather/rain.lua:16: bad argument #1 to 'add_particlespawner' (number expected, got table)

I'm on windows 7 using minetest-0.4.7-72b9b0f-fixes-win32

The snow works fine. This error only happens when it rains.

Update your Minetest version.
Also please note this:
PilzAdam wrote:There are a lot of other people doing win builds now, so I will make my builds on request now. Ask me here or in IRC, I can also make builds of different branches or Minetest forks.

You have too use my or Fess to get new minetest builds
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Tue Sep 17, 2013 09:38

sfan5 wrote:
TheFlannelOne wrote:I'm getting this error:

21:51:15: ERROR[main]: ServerError: LuaError: error: ...bin\..\mods\minetest-mod-weather-master\weather/rain.lua:16: bad argument #1 to 'add_particlespawner' (number expected, got table)

I'm on windows 7 using minetest-0.4.7-72b9b0f-fixes-win32

The snow works fine. This error only happens when it rains.

Update your Minetest version.
Also please note this:
PilzAdam wrote:There are a lot of other people doing win builds now, so I will make my builds on request now. Ask me here or in IRC, I can also make builds of different branches or Minetest forks.

You have too use my or Fess to get new minetest builds
Fess's builds are good when ou are using big texture packs and the such because they are 64-bit. IF your computer can handle it.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

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

by MirceaKitsune » Fri Oct 11, 2013 17:50

I tested Proller's version of the weather system in the Next branch, and wanted to share my thoughts, the issues I found, and solutions for some of those issues. I already discussed most points with Proller on IRC, but things tend to get lost in chats so I'll also mention them here.

First of all, I absolutely love how precipitation respects the mapgen humidity map, how rain / snow create flowing water or snow blocks, and how water freezes or evaporates based on the temperature map. I watched those in practice today and also looked at the Lua files, and there's little to object to. Only problem I can think of is that flowing water shouldn't appear on flat surfaces and litter them randomly, but only build up in holes or flow over hills. In some aspects I find this a little odd:

Image

My only real problem is the laggy and incorrect particle system, which IMO needs a lot of fixing. Here's my take on each of the issues:

1 - Particle spawners follow the player on the server rather than the client. This not only causes clients with a slow connection to see particle clouds be left behind as they walk, but also wastes a lot of bandwidth. In my opinion, weather cannot be ready until particles are attached to the player client-side, and only updated by the server when needed. Thankfully there's already code for that, but the branch is still waiting in this pull request. Once that change is added to Minetest, this problem should be easy to fix.

2 - Current indoor / outdoor detection system is very fake and obvious. If the player is standing under the clear sky, he sees weather taking place indoor... while if he's in a cave or house, he no longer sees precipitation outside. Me and Proller thought of a solution for this: Having one or more circles of spawners above the player, each spawner detecting if its positioned indoor or outdoor. I asked the Lua team for a formula which can generate a circle of X points in Y radius, and someone wrote one which would provide a perfect fix. Feel free to try it out over here:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local points = 4
local dist = 10
for i = 1, points do
    print(("( %.2f, %.2f )"):format(math.sin( (math.pi * 2 / points) * i) * dist, math.cos( (math.pi * 2 / points) * i ) * dist))
end


3 - Rain particles should only face the camera horizontally, not vertically (snow is good as it is). If you look forward as it rains, you see the rain fall correctly. But if you look up, you see panels of blue lines coming toward you. Proller said a vertical parameter for particles already exists, so this should be fixed soon.

4 - The player can see particles appearing. Look upward when it rains / snows, and you see how particles spawn right above your head. Their starting point should be much higher... probably at least 25 nodes above the player.

5 - Particles decrease frame rate considerably. In my case, rain or snow seem to bring FPS down to half. Sadly there might be nothing we can do here. Decreasing the amount of particles is not an option, since the current quantity looks correct and any less would be ugly. Only suggestion is making sure there are no performance improvements left undone in particle rendering code, and if so this is something we'll have to live with.

Last suggestion I have on the weather system is adding sounds when it snows or rains. Simply looping the sound files is very easy, although having realistic sound effects (like rain hitting different surfaces) might be trickier. And of course, darkening the sky and thickening fog while it's snowing or raining... but that will require heavier code changes so it's best left for later.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Fri Oct 11, 2013 18:08

About the flowing water collecting using the RL liquid setting would solve the problem.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

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

by MirceaKitsune » Fri Oct 11, 2013 23:51

An addition to my previous post: I thought of an even better way to fix points #2 and #4. What if a single particle spawner could follow the player horizontally (X and Z axes) but stay at cloud level vertically (Y axis)? Rain would always start at the correct height, and the delay precipitation has before reaching the ground would also be simulated.

Particles would need to use collision detection in this case, and die the moment they hit a surface, to avoid weather indoor. Collisions already exist, but I'm not sure about the dying part. Also, particles would start from very high up, so a draw distance limit is needed to avoid butchering performance.
Last edited by MirceaKitsune on Fri Oct 11, 2013 23:53, edited 1 time in total.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sat Oct 12, 2013 11:30

MirceaKitsune wrote:An addition to my previous post: I thought of an even better way to fix points #2 and #4. What if a single particle spawner could follow the player horizontally (X and Z axes) but stay at cloud level vertically (Y axis)? Rain would always start at the correct height, and the delay precipitation has before reaching the ground would also be simulated.

Particles would need to use collision detection in this case, and die the moment they hit a surface, to avoid weather indoor. Collisions already exist, but I'm not sure about the dying part. Also, particles would start from very high up, so a draw distance limit is needed to avoid butchering performance.


I tried that already and it kinda sucks, because of the "dying part". Sometimes the rain particles dont even reach the ground or they lie on the ground for seconds until they disapear. Furthermore it needs smaller particles (to look correct) than this mod uses and that drops the framerate or to be more precise: It makes the game unplayable for an average pc.
 

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

by MirceaKitsune » Sat Oct 12, 2013 12:09

BlockMen wrote:I tried that already and it kinda sucks, because of the "dying part". Sometimes the rain particles dont even reach the ground or they lie on the ground for seconds until they disapear. Furthermore it needs smaller particles (to look correct) than this mod uses and that drops the framerate or to be more precise: It makes the game unplayable for an average pc.


Yeah, the current collision system does that. Particles need precise code to die when they touch a surface. Smaller particles would make frame rate a lot worse, but I don't think they'd be needed for this.

I honestly wonder how MineCraft achieved its own weather system. It doesn't seem to use a particle spawner, but rather a scrolling texture at the position of each node (similar to our drawtype-plantlike). Lots more detail, realism, and no noticeable performance drop!

[spoiler]Image[/spoiler]
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Sat Oct 12, 2013 14:05

So you mean weather could be a none-walkable transparent node with animated texures? Interesting...
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sat Oct 12, 2013 14:20

webdesigner97 wrote:So you mean weather could be a none-walkable transparent node with animated texures? Interesting...


AFAIK thats the way how MC does weather...the main problem with that is that it takes time to replace the nodes and that you need a good "room"-detection to prevent raining in houses, caves, etc.

Maybe the speed problem can be solved by using VoxelManip?
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Sat Oct 12, 2013 17:11

Maybe yes. But room detection would be harder...
 

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

by MirceaKitsune » Sat Oct 12, 2013 17:18

webdesigner97 wrote:So you mean weather could be a none-walkable transparent node with animated texures? Interesting...


Yep. This would have worked if it were possible to visually replace the appearance of air nodes located outside, preferably without changing their node type permanently. Certainly such would require code modifications in Minetest, but should be possible.
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

by BrandonReese » Sat Oct 12, 2013 17:21

Didn't somebody already write a proof of concept mod that changed air to a "rain node" with an animated texture?
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Sat Oct 12, 2013 21:26

Seems to me that if you start at the sky and replaced the air in 1x1m *columns* rather than large blocks, working your way downward and always stopping each individual column at the first non-air node, you'd get a correct and easy-on-the-CPU result.

That part would be almost trivial. The real trick would be making the precipitation track the movement of the clouds. :P

You would probably want to make exceptions to the stop rule, where clearly the precipitation should logically pass through.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

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

by MirceaKitsune » Sat Oct 12, 2013 22:09

VanessaE wrote:Seems to me that if you start at the sky and replaced the air in 1x1m *columns* rather than large blocks, working your way downward and always stopping each individual column at the first non-air node, you'd get a correct and easy-on-the-CPU result.

That part would be almost trivial. The real trick would be making the precipitation track the movement of the clouds. :P

You would probably want to make exceptions to the stop rule, where clearly the precipitation should logically pass through.


I assumed that replacing air blocks in a vertical line for each node would gore the CPU... even with the voxel manipulator. The replacement would need to be done in landscapes hundreds of nodes wide, from a cloud height of 120 nodes. So tens of thousands of blocks would need to be changed in a second, while also scanning for solid nodes each time to know when to stop. Even if the CPU can handle it, delays caused by lag could temporarily cause bits of rain to be left floating around in mid air. There would also be so many surfaces to draw :o

Personally, I suggest a special kind of drawable being coded into the client for this. It would create an X shaped mesh consisting of two surfaces (like drawtype-plantlike) per node horizontally. Vertically however, it would stretch from the cloud height down to the first solid node. A server Lua function should be used to trigger the effect, in a form such as: minetest.set_weather(start_corner, end_corner, height, texture). There might be even better possibilities than this idea however.
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Sat Oct 12, 2013 22:14

You can do this now by making a single node with inordinately tall nodebox coordinates. The texture will tile along the height. Alternatively, you may be able to use the plantlike draw type with a visual_scale setting of something insanely tall also.

I'm not sure what the height limit is, but it may be worth a try.

Then you'd just need nodes at the surface instead of whole columns.

Besides, I was thinking that columns (or single nodes) would be "turned on/off" gradually, one at a time.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

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

by MirceaKitsune » Sat Oct 12, 2013 22:25

VanessaE wrote:You can do this now by making a single node with inordinately tall nodebox coordinates. The texture will tile along the height. Alternatively, you may be able to use the plantlike draw type with a visual_scale setting of something insanely tall also.

I'm not sure what the height limit is, but it may be worth a try.

Then you'd just need nodes at the surface instead of whole columns.

Besides, I was thinking that columns (or single nodes) would be "turned on/off" gradually, one at a time.


That's a good idea, I thought about it actually. We could only change the nodes at cloud level, and have them use drawtype_plantlike with a huge length stretching downward. But there are several reasons why I think this is sadly impossible:

First of all, I remember the size of drawtype_plantlike is specified in the node definition itself. So you couldn't make multiple instances of a node called "rain" or "snow" have different lengths. One would have to define hundreds of nodes, one for each scale. Not sure if node levels work.

Even if that was doable, cloud level is pretty high up. It's possible that the area has not been loaded. You probably can't spawn nodes in an inactive chunk, and even if so the node might get hidden by draw distance (considering its center is up there).
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Sun Oct 13, 2013 15:21

I was thinking of the nodes being placed at the surface where the rain/snow is landing, rather than at cloud level. Of course like you said, that doesnt handle the issue of stopping the precip at cloud height.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

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

by MirceaKitsune » Sun Oct 13, 2013 15:47

VanessaE wrote:I was thinking of the nodes being placed at the surface where the rain/snow is landing, rather than at cloud level. Of course like you said, that doesnt handle the issue of stopping the precip at cloud height.


Yeah, that would have issues too. For example, what if you're flying right below cloud height and the nodes at ground level aren't loaded?
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 8 guests

cron