Page 1 of 1

Weather Ideas

PostPosted: Mon Sep 14, 2015 14:14
by BrandonReese
Talk about adding weather to minetest has increased. I had a few ideas on how to implement weather but they are above my skill level so I just thought I would throw them out there if anybody wanted to give them a shot or maybe it will get other ideas rolling. Dynamic weather would be a great thing to have but I think for it to be implemented effectively it will require server and client changes and the client will need to take on a lot of the load. The server and mods will tell when and where weather is happening and the client takes control of properly displaying the weather.

I experimented with particle spawners. I set them about 30 nodes above the player and it looked pretty good, but once there were enough particle spawners setup to cover a small area in rain it took my FPS from 60 to 2 and eventually to 0. Collision detection had to be on so it wouldn't rain through buildings and that is part of what killed the FPS so quickly. My thought on making this work would be to add new parameters to the particle spawner definition where it would follow the player around. You attach a particle spawner to a player at a certain height (maybe 20 nodes above the player) and client side it would make that particle spawner follow the player around. Thus one particle spawner creating the illusion of rain over a large area. This should have a low server load and by using a particle spawner mod developers would still be able to define what the particles look like and how they behave. I don't know if there is a way to make particle spawners more efficient but if that happened we might be on our way to usable weather.

There are weather mods that just change air to a node with an animated texture. This is hard on the server, client, and network because it's changing a lot of nodes at once. What if there was a way to define weather (minetest.add_weather("rain","rain_texture.png")) then activate it for a certain area (minetest.activate_weather("rain",{x1,y1,z1},{x2,y2,z2})) and client side it would change the texture of air in that area to the texture for that weather definition. Or simulate a weather box so when the player is in that area a 20x20x20 box around the player the air in that 20x20x20 box would be changed to the weather texture, that would probably be easier on FPS since it would be a smaller number of nodes with animated textures vs a whole area where the textures have changed. As the player moved the weather box would be recalculated from the top down so detecting a node that was not air it would not change the texture for any air below that node.

My third idea that I abandoned pretty quickly was supporting animated hud images but I quickly realized if you just overlay the hud with an image the rain angle would never change, which would be a major problem when looking up.

Re: Weather Ideas

PostPosted: Mon Sep 14, 2015 14:16
by rubenwardy
Minetest's particles aren't very good. So are slow. There has been some work on Irrlicht particles which are a lot faster.

BrandonReese wrote:Talk about adding weather to minetest has increased.


Not really, one person seems to mention it in all of their posts.