Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Steeveeo

Rain in GZDoom

Recommended Posts

Just showed this to Rienchard for his Dawn of Reality wad (because he had awesome storm clouds), and I thought to myself: "What the heck, people might need this."

So, here it is, some very decent weather effects that will work in GZDoom.

It features a light drizzle (because a full on storm just kills Doom in this large of an area, but modders can increase the count if they so wish), and background lightning strikes. And not just the normal "Lightning" effect which is just some sector light ramping and then a sound, this has some visible lightning strikes.

So without further ado, here it is (requires GZDoom 1.0.24 or higher).

NOTES:
- This is a Proof of Concept type map, so of course the map is not intended to look good, just fit the part.
- This is made for anyone and everyone to use in their maps as needed, as long as proper credit is given.
- This map may be used as a base (if for some reason you WANT to).
- All sounds and sprites may be used whenever and wherever (I dont remember where the rain sprites came from, and I got the lightning effect from Adobe Premiere Pro)

Anyone have any issues/questions/comments about this?


EDIT:
--UPDATE--

This project is finished (thanks JohnnyFive for your awesome system and the help of sorting this all out). Features realistic rain, a nice full quality rendered skybox, actual lightning strikes (instead of just sector flashes and a sound), and weather phases.

Get it Final Product Here!

Next Project Planned: GZDoom Skybox Pack

Share this post


Link to post

I honestly hope he doesn't use this as it caused extreme lag on my computer, both in software and GL mode. And I bet Dawn of Reality alone will cause a lot of lag.
There's are some other true raining effects that cause no lag, yet I think DoD would look better without any rain, lag or not. The map itself is what makes it interesting, adding gimmicks could kinda ruin it IMO.

Share this post


Link to post
Vegeta said:

I honestly hope he doesn't use this as it caused extreme lag on my computer, both in software and GL mode. And I bet Dawn of Reality alone will cause a lot of lag.
There's are some other true raining effects that cause no lag, yet I think DoD would look better without any rain, lag or not. The map itself is what makes it interesting, adding gimmicks could kinda ruin it IMO.

Well one, this thread isnt about DoR, and two, the light drizzle really caused that much lag? I guess it's just because the area was too big to have that much rain, smaller areas (like tight outdoor corridors on a mostly indoor map, or an outdoor area outside the window) should work a lot better against the lag (unless the mapper puts a delay of 1-3 with 30 mapspots in one area).

If the rain causes that much lag, just go into the script and kill it or limit it (comment it out or extend the delays).

I know for a fact that the rain effect itself is not new, I've seen it done in different maps, but the visible lightning was the major effect showoff of the map (hopefully).

EDIT: Heh, I just turned the delays from 15,30 to 1,3 on my end (not uploaded version), man I dont even think a Core 2 Quad Extreme could run THAT smoothly :P

But anyway, if 15,30 is too laggy, set to something like 30,60 and see if it helps.

Share this post


Link to post

Really nice effect. I love the lightning effect much.

Waould be realistic to use ACS and a texture simulating one or two rain particles at some linedefs?

This is, have many 32 or 64 units long linedefs, with a texture simulating a pair or three rain drops, and scroll its texture at a random time.
Of course, non-blocking ldefs and maybe a bit traslucent (if fps does not go down much).

Thats only an idea. But can look nice. I never tested. :P

Share this post


Link to post

Well at least someone likes it :P

Im guessing the linedef method would take several more paragraphs of coding than this has, not to mention hours of placing linedef after linedef.

This thing itself was just a proof of concept that should be easy to port over to any size area (hopefully smaller than this thing :P) by placing a few mapspots and a couple blocks of code.

Share this post


Link to post

This is real fun effect. I propose make this "rain thing" much bigger and paste to him more then one rain drop graphic with different heights. My idea can spare lots of time. Inserting this all mapspots and numeration tags is so tiresome...

Share this post


Link to post

Nice effects. The only oddities I noticed was flickering at the water's edge (might be my video card) and rain falling underwater.

Share this post


Link to post

Rain falling underwater was just something I didnt bother to correct.

I think there's some sort of DECORATE tag that can make projectiles die on hitting water, but i dont remember it or bothered to find it.

The flickering water definitely sounds like a graphics error, I havent gotten it in the three video cards I've gone through since I first built this.

Share this post


Link to post

A tad bit of lag, but whatever. Liked the lightning effects. I think the lag might be helped by karnizero's idea, but it would be quite tedious on the mapper's end.

Share this post


Link to post
Karnizero said:

Really nice effect. I love the lightning effect much.

Waould be realistic to use ACS and a texture simulating one or two rain particles at some linedefs?

This is, have many 32 or 64 units long linedefs, with a texture simulating a pair or three rain drops, and scroll its texture at a random time.
Of course, non-blocking ldefs and maybe a bit traslucent (if fps does not go down much).

Thats only an idea. But can look nice. I never tested. :P

Having a ton of translucent lines would be significantly slower than this, since it'd have to calculate translucency for the entire area of the texture on every line, whenever they're visible. And there would be a ton of them visible at once.

Share this post


Link to post

I found this effect quite underwhelming, and the way it spawned a bunch of raindrops at once, waiting spawned a bunch of raindrops, waited made it look very artificial.

Share this post


Link to post
kristus said:

I found this effect quite underwhelming, and the way it spawned a bunch of raindrops at once, waiting spawned a bunch of raindrops, waited made it look very artificial.

what?

I have given some shot variance to the drops in my local copy, now looks a ton less grid-ish, also looks okay with fewer drops now.

Will upload a new copy when I get back home.

Share this post


Link to post
Enjay said:


I'm actually the creator of this rain thingy that Enjay linked - I think I may post a copy in the editing forum as well.

In any case, it might work better for what you need, Steeveeo. You only need to place a couple WeatherSpots and it'll restrict raindrops to the area local to the player (distance is customizable) so it won't lag the computer too much.

If you want to use it, you're free to. I didn't do any fancy lightning or anything, so feel free to modify it however you want.

Share this post


Link to post

Ooo nice! (Didnt notice enjay's post till now).

Will try to implement this so as to get a much higher density....as soon as I wake up from my nap :P

Share this post


Link to post

As an added bonus, I just uploaded a fixed version over there that handles a rather annoying bug with the spawning code. :)

Share this post


Link to post

Hmm, does this take into account the user's position within the weatherzone to spawn the raindrops around him? Or does it track the player to spawn all particles within the weatherzone when the player is close by?

IE, if I made that huge area I have for the rain test one big weather zone, would it be any different than it is now?

Share this post


Link to post
Steeveeo said:

Hmm, does this take into account the user's position within the weatherzone to spawn the raindrops around him? Or does it track the player to spawn all particles within the weatherzone when the player is close by?

IE, if I made that huge area I have for the rain test one big weather zone, would it be any different than it is now?


It spawns particles only within a specified number of map units of the player's position inside the weather zone, centered around the player position (so it spawns particles in a virtual "box" around the player position), unless the weather zone is set to ignore player position, in which case it will always spawn particles wherever the player is (like what your version does now).

For example, if you were to set up your map with its huge area, you could set it up as one weather zone (two boundary WeatherSpots) with a distance parameter (for heavy rain I suggest maybe 1024 as the distance parameter, maybe a higher number like 1280 for light rain) and it would never spawn any particles farther away than that distance from the player position, which is a huge performance boost.

There are basically two advantages. One is that instead of several hundred spawn points, you only need two, which makes actually editing your things a lot easier in a non-demo level. The other advantage is that it restricts particle spawns to where the player is within the weather zone, so you can increase the size of your area without incurring extra performance penalties.

Share this post


Link to post

Ok, all updated with j5's system (thanks much!):

Click Me (indirect).

SLOW COMPUTER WARNING:
Due to high particle intensities, slower computers may slow to a crawl while operating this wad.

I made this to look good, so its not optimized for play (kinda like Crysis :P). IE, the fat has not been "trimmed," if you will. Particles are in full quality and should look good on higher-end systems, but slower systems (those who said the original drizzle was laggy) will not be able to run this properly without major slowdown.

I may or may not work on a "Medium" and "Lite" version of this storm.

@Johnny5: You are free to use this as another demo map for your system if you want.

@Everyone Else: Please no "HOLYFUCKLAG" posts, I know its kinda laggy because of the aforementioned reasons, but I will accept criticisms on how to optimize it while still looking as good as it does.

Enjoy!

Share this post


Link to post

Well now, that looks quite nice. I'm glad you liked my weather thing, and you seem to have gotten a nice result from it.

If you're interested in making it run a little faster in your "medium" version, I noticed that you can knock the density on both effects in half without too much of a visual impact, but I'm sure it'd run decently either way on a faster computer than what I'm on now (a P4 at work with a POS integrated graphics card).

With some clever scripting and global variable use, you could probably do a selectable quality level.

Share this post


Link to post

Thanks for the feedback, will try the density change.

Also, speaking of clever scripting, I was thinking about revamping the system to have "Weather Phases" where every once in awhile the rain would let up and the lightning would be more delayed, then phase back in in a bit, but it was 12 AM when I posted that and I was tired (from Highschool and all).

Share this post


Link to post
Steeveeo said:

Thanks for the feedback, will try the density change.

Also, speaking of clever scripting, I was thinking about revamping the system to have "Weather Phases" where every once in awhile the rain would let up and the lightning would be more delayed, then phase back in in a bit, but it was 12 AM when I posted that and I was tired (from Highschool and all).


That should be pretty easy to implement. If you change one of those variables using a script, it should immediately change the associated weather zone effect, so you could do something like scaling the density back a bit and then returning it to its original values.

Share this post


Link to post

Ok, how to go about doing this...

How would I make a gradient value via ACS? IE, not a sudden change from 0 to 255, but a gradual change without going:

int rainvollev = 0;
delay(2);
int rainvollev = 1;
delay(2);
int rainvollev = 2;
delay(2);
int rainvollev = 3;
delay(2);
int rainvollev = 4;
delay(2);
And so on and so forth?

Share this post


Link to post

You could do that (although only the first variable needs "int" in front of it), or you could use a for loop as well:

for(int i = 0; i < 255; i++)
{

WFX_Density[0]=i;
delay(5);

}
That would gradually change the density of weather zone 0 from 0 to 255 with a delay of 5 tics between each step, for example. The for keyword takes three arguments in parenthesis: variable to increment (it can be intialized there too like I did), condition to continue the for loop, and the action to take on the variable at the end of each iteration of the loop (in this case, just add 1 to i).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×