Conception for a weather mod

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

Conception for a weather mod

by PilzAdam » Sun Aug 19, 2012 15:01

Hello everyone!
What do you think about this laggy way to create rain?
http://ompldr.org/vZjVxcQ/weather.zip
Start/stop rain with the command /rain
 

User avatar
Echo
Member
 
Posts: 121
Joined: Tue Jul 31, 2012 08:11

by Echo » Sun Aug 19, 2012 17:09

Nice effect!
Wouldn't it be enough if it would rain in a smaller cube around the player? Else you get strange moiree / repeating effects.
 

User avatar
qwrwed
Member
 
Posts: 323
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Sun Aug 19, 2012 18:21

It's good, but typing /rain a second time doesnt seem to stop it, and like Echo said, there are lots of repeating effects.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Sun Aug 19, 2012 21:05

Is it sprites in 3d, or a image animation overlay?

image animation overlay is less laggy:

http://minetest.net/forum/viewtopic.php?pid=33583#p33583
Last edited by rubenwardy on Sun Aug 19, 2012 21:07, edited 1 time in total.
 

leo_rockway
Member
 
Posts: 131
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Sun Aug 19, 2012 22:21

PilzAdam, you rock.
 

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

by VanessaE » Mon Aug 20, 2012 00:24

Very impressive! It looks like you're basically replacing all air nodes with an animated rain node. I might suggest adding a small random number to each raindrop's initial X/Z position to get rid of the moire pattern. Also, I would suggest a smoother animation - at least 4x as many frames (but with the same length of time for the loop).
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

User avatar
Echo
Member
 
Posts: 121
Joined: Tue Jul 31, 2012 08:11

by Echo » Mon Aug 20, 2012 07:29

Is it possible to detect the clouds in the sky? I never tried. If it is possible, then there should be rain only direct under the clouds.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Aug 20, 2012 09:35

Echo wrote:Is it possible to detect the clouds in the sky? I never tried. If it is possible, then there should be rain only direct under the clouds.

Its not possible.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Aug 20, 2012 09:36

Echo wrote:Nice effect!
Wouldn't it be enough if it would rain in a smaller cube around the player? Else you get strange moiree / repeating effects.

Thats not easy. But I see what i can do.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Aug 20, 2012 09:36

qwrwed wrote:It's good, but typing /rain a second time doesnt seem to stop it, and like Echo said, there are lots of repeating effects.

It needs some time.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Aug 20, 2012 09:37

rubenwardy wrote:Is it sprites in 3d, or a image animation overlay?

image animation overlay is less laggy:

http://minetest.net/forum/viewtopic.php?pid=33583#p33583

But how to do this in lua?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Aug 20, 2012 09:37

VanessaE wrote:Very impressive! It looks like you're basically replacing all air nodes with an animated rain node. I might suggest adding a small random number to each raindrop's initial X/Z position to get rid of the moire pattern. Also, I would suggest a smoother animation - at least 4x as many frames (but with the same length of time for the loop).

This is not a mod so the graphics are very basic.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Mon Aug 20, 2012 09:59

PilzAdam wrote:
rubenwardy wrote:Is it sprites in 3d, or a image animation overlay?

image animation overlay is less laggy:

http://minetest.net/forum/viewtopic.php?pid=33583#p33583

But how to do this in lua?


isnt there a minetest.drawimageonscreen or similar command?
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Sat Nov 24, 2012 17:10

In the minecraft rain and snow effects seems to be just a textures on a 4 plains which "surround" player.
So I suggest following:
- create 4 entities 1x2x0 (plains)
- apply to each of them some animated rain texture on the one side and tranparent texture on the other (see "animated torches" mos)
- make this entities to face the player (see "snow" mod)
- re-place that entities around player on every server time tick
- coordinates should be like so: {-0.5, 0.5, -0.5} for the 1st one, {0.5, 0.5, -0.5} for the second, {-0.5, 0.5, 0.5} for the 3rd and {0.5, 0.5, 0.5} for the last one:
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
 __ __ __
|  |  |  |
|__|/\|__|
| /|PP|\ |
|_\|__|/_|
|  |\/|  |
|__|__|__|

I tried to draw 9 blocks, PP = player and the diagonal lines = 4 entities, placed in rhombus-like shape.



This way every player would see animated side of his "raining entity" and would "see" empty "back side" of the other players' "raining entities".

I tried to do this on my own, but I'm not so good at lua or modding for minetest...
Someone with skill may check above things to make lightweight but working weather.
Last edited by 4aiman on Sat Nov 24, 2012 17:11, edited 1 time in total.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Nov 24, 2012 17:21

This is a good idea!
I will code it when I have some time (within the next week).
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Sat Nov 24, 2012 19:44

I managed to add entity in the player's position, but:
1. animation for texture didn't work, when I write smth like this:
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
    textures = {             
             {name="rainanim.png"},
             {name="rainanim.png", animation={type="vertical_frames", aspect_w=48, aspect_h=48, length=3.0}},
},


2. I ended up in need to add "owner" property, so that if player goes offline, entities would be destroyed.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Nov 25, 2012 11:23

There is no animation for entity. You have to change the object properties in on_step().
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Nov 26, 2012 09:09

Sorry for stupid question, but....
Do I need to change textures property in the on_step() event or I should use set_properties and pass textures table as a parameter? :blush:
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Nov 26, 2012 09:26

4aiman wrote:Sorry for stupid question, but....

There are no stupid questions, just stupid answers ;-)
4aiman wrote:Do I need to change textures property in the on_step() event or I should use set_properties and pass textures table as a parameter? :blush:

You cant set the animation as a parameter in set_properties(). You need to setup a timer in on_step() like this:
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
timer = 0,
on_step = function(self, dtime)
    self.timer = self.timer + dtime
    if self.timer < 0.25 then
        return
    end
    self.timer = 0
end,

After this you set the next texture of the animation:
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 animation_frames = 8
[...]
timer = 0,
anim_step = 0,
on_step = function(self, dtime)
    self.timer = self.timer + dtime
    if self.timer < 0.25 then
        return
    end
    self.timer = 0
    self.anim_step = (self.anim_step+1)%animation_frames
    self.object:set_properties({
        textures = {
            "rain_inside_animated.png^[verticalframe:"..16*animation_frames..":"..self.anim_step},
            "rain_outside_animated.png^[verticalframe:"..16*animation_frames..":"..self.anim_step},
        },
    })
end,

Note: This is untested code.
Last edited by PilzAdam on Mon Nov 26, 2012 09:26, edited 1 time in total.
 

User avatar
Likwid H-Craft
Member
 
Posts: 1113
Joined: Sun Jan 06, 2013 14:20

by Likwid H-Craft » Mon Feb 11, 2013 15:21

Hey Adam I made my own rain textures for my, texture pack so if you like use it you can:D
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Feb 11, 2013 17:26

It's better to wait for approval of particle spawners :)
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Thu Feb 14, 2013 17:02

@PilzAdam
I tested that code, and it works so far that it is an animation. But it does not show a complete picture but only one horizontal line stretched. To be precise the lines 1 to 8.

It seems to me that those lines are incomplete:
PilzAdam wrote:
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
        textures = {
            "rain_inside_animated.png^[verticalframe:"..16*animation_frames..":"..self.anim_step},
            "rain_outside_animated.png^[verticalframe:"..16*animation_frames..":"..self.anim_step},
        },

( replace }, at the end of the lines with .."]" to make it work)

edit:
Found it. It has to be
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
"rain_inside_animated.png^[verticalframe:"..animation_frames..":"..self.anim_step.."]"
Last edited by Casimir on Thu Feb 14, 2013 17:23, edited 1 time in total.
 

chase programer
Member
 
Posts: 117
Joined: Thu Jan 03, 2013 16:56

by chase programer » Thu Feb 14, 2013 21:23

i want lava rain for fun =0 [img]dog[/img]
Back and ready to help with this amazing community that i lost.
 

User avatar
nomohakon
Member
 
Posts: 207
Joined: Fri Aug 10, 2012 16:34
IRC: nomohakon
In-game: nomohakon

by nomohakon » Thu Feb 14, 2013 23:53

chase programer wrote:i want lava rain for fun =0 [img]dog[/img]

I guess acid rain will be better.
"To learn who rules over you, simply find out who you are not allowed to criticize." - Voltaire
"Knowledge, like air, is vital to life. Like air, no one should be denied it." - Alan Moore, V for Vendetta
- - -
"To never die... and to conquer all, that is winning." ―Illyria
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11

by Josh » Fri Feb 15, 2013 02:09

Having rain in the game would be a refreshing idea, expecially the players who have heatwaves in their countries ;)
We could also have lightning which could set fire to trees. And storms which damage the land.
Lightning and storms are probably impossible now. But later on it could be possible :D
 

User avatar
GJH105775
Member
 
Posts: 106
Joined: Thu Sep 27, 2012 16:11

by GJH105775 » Fri Feb 22, 2013 01:10

qwrwed wrote:It's good, but typing /rain a second time doesnt seem to stop it, and like Echo said, there are lots of repeating effects.


"lik echo said, there are ... repeatting effects"
Check out my mod xtrablocks, has some different types of marble that you can build with or mine at different depths

I am not here regularly as I just kind of pop in and out. If you want to find me I'll be on quadcopterforum.com helping with multirotor builds and spending other's money haha.

http://i10.photobucket.com/albums/a119/ ... hicons.jpg
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

by Gael de Sailly » Tue Mar 11, 2014 07:39

How can I download this mod ? The link does not work.
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Tue Mar 11, 2014 09:57

You want another weather mod or inbuilt FM weather feature. Use search, as I don't have a link to provide. You may want to search for "snow" and "rain" ;)
 

User avatar
fishyWET
Member
 
Posts: 145
Joined: Tue Jan 01, 2013 07:43
GitHub: fishyWET

by fishyWET » Tue Mar 11, 2014 10:56

Gael de Sailly wrote:How can I download this mod ? The link does not work.

Ompldr.org is down, therefore all downloads from that site won't be downloadable.
Try this https://forum.minetest.net/viewtopic.php?id=5245
or https://forum.minetest.net/viewtopic.php?id=6854
Last edited by fishyWET on Tue Mar 11, 2014 10:57, edited 1 time in total.
LOTR Subgame
Some days you flip the table, (ノಥ益ಥ)ノ ︵┻━┻,
Other days, the table flip you, ┳━┳︵(ₒ⁻ₒ).
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

by Gael de Sailly » Tue Mar 11, 2014 12:42

Thank you :-)
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 3 guests

cron