[Resource] JonnyFive's WeatherFX (9/17/08 update)

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!

[Resource] JonnyFive's WeatherFX (9/17/08 update)

Postby JonnyFive » Thu Sep 11, 2008 11:22 pm

Update 9/17/08: Fixed a serious bug with the boundary checking code.

Note: This requires at least GZDoom 1.1.04 or ZDoom 2.2.0. I haven't tested it on the SVN versions or older versions of either.

Screen Shots:

Spoiler:


After seeing a few people's implementations of the whole rain/snow thing and wanting something a bit more robust for the large Cold as Hell maps I'm working on, I came up with this surprisingly easy-to-use way of doing nice looking weather effects. The main method of doing it (using two map spots to calculate a weather zone) isn't new, but I don't think I've seen another weather effect mod that uses the player's position to restrict the weather zone to a certain area around the player if desired. This is nice for larger maps, because it effectively cuts down the size of the weather zone to just what the player can see.

I've tested it on both ZDoom 2.2.0 and GZDoom 1.1.04. In GZDoom the rain and snow look nicer, but they work just fine under ZDoom.

Full documentation is included, along with a crappy example map that sucks. I've been replacing the snow in Cold as Hell with this, and it's hugely successful. It's basically at the point where if you can run the mod at all, you can run it with full weather effects with a very minimal FPS drop.

The DECORATE file includes definitions for a few default spawners, including snow, hard snow, rain, and hard rain. These can be expanded and configured to create just about any shit-falling-from-the-sky effect you could possibly want.

If you like this and want to use it (or any part of it) with your own WAD, go right ahead! Just give me a little credit in there somewhere. You're also free to use my awesome snow/rain sprites that I made in Photoshop in 2 minutes and looping rain sound that I think is the General MIDI "rain" effect recorded through some sound card or other. :)

I have to give credit to everyone in the ZDoom community who came up with similar rain/snow mods before me, especially solarsnowfall, whose work in the water resource mod got me thinking about how to do this.

So let me know what you think. Tell me if it works pretty well or if it makes your computer want to cough up a lung.

Protips for Anyone Using this:

Spoiler:

Spoiler:

Spoiler:


Download:

j5weatherFX.zip
Updated 9/17/08 - Major bug-fix!
(120.94 KiB) Downloaded 744 times
Last edited by JonnyFive on Wed Sep 17, 2008 10:45 pm, edited 9 times in total.
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: [Resource] JonnyFive's WeatherFX

Postby Phobus » Fri Sep 12, 2008 5:00 am

Thanks for that. :) I'd update the water resource wad but honestly I think leaving it be is the best approach. It's easily out-moded by people's own attempts, and there's always a better way to do things anyway.

My framerate running around the different strengths and speeds of rain and snow were constant at 57-59FPS, and the only problem I had with it was that the rain sound effect seemed oddly heavy for the lighter rain.
User avatar
Phobus
Registered Occasional Lurker
 
Joined: 05 May 2005
Location: London

Re: [Resource] JonnyFive's WeatherFX

Postby JonnyFive » Fri Sep 12, 2008 7:18 am

Phobus wrote:Thanks for that. :) I'd update the water resource wad but honestly I think leaving it be is the best approach. It's easily out-moded by people's own attempts, and there's always a better way to do things anyway.

My framerate running around the different strengths and speeds of rain and snow were constant at 57-59FPS, and the only problem I had with it was that the rain sound effect seemed oddly heavy for the lighter rain.


Yeah, I wasn't origininally planning to actually include the rain SFX, but I figured I'd stick it in last minute so it didn't seem too odd. It was originally designed as an ambient sound for a level with much heavier rain, and both sectors use the same sound. I'd strongly recommend that anyone who wants to use the mod make better rain sounds. :wink:

Out of curiosity, what kind of computer were you running it on, and did you run GZDoom or ZDoom? I'd like to get an idea of the performance profile for this. The nice thing is that if the weather zones are set to track player position, you can expand the rain over the whole level and not have it lag any more than if it were just enough to cover the full player "view distance."

EDIT: I think I'm going to rename the variable from WFX_WeatherSpots to WFX_WeatherZones to avoid confusion, as the variable tracks the number of pairs of WeatherSpot objects, not individual ones.
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: [Resource] JonnyFive's WeatherFX

Postby Phobus » Fri Sep 12, 2008 8:04 am

I'm using an AMD Athlon 64 3000+ XP running at 1.81GHz with 1GB RAM (according to the system stuff). I'm playing on ZDoom 2.2.0. Can't remember what graphics card I have but it was top of the range about 3-4 years ago I think... NVidea GeForce 5x00 FX I think (the x is a digit I can't remember, but suspect to be a 5).

Basically, I can run almost anything fine, but when WADs like Thunderpeak come about, I have to scale down my screen resolution from 800x600 to 320x200 for a decent framerate (well... maybe not quite that low, but it's my general approach)
User avatar
Phobus
Registered Occasional Lurker
 
Joined: 05 May 2005
Location: London

Re: [Resource] JonnyFive's WeatherFX

Postby JonnyFive » Fri Sep 12, 2008 8:18 am

Phobus wrote:I'm using an AMD Athlon 64 3000+ XP running at 1.81GHz with 1GB RAM (according to the system stuff). I'm playing on ZDoom 2.2.0. Can't remember what graphics card I have but it was top of the range about 3-4 years ago I think... NVidea GeForce 5x00 FX I think (the x is a digit I can't remember, but suspect to be a 5).

Basically, I can run almost anything fine, but when WADs like Thunderpeak come about, I have to scale down my screen resolution from 800x600 to 320x200 for a decent framerate (well... maybe not quite that low, but it's my general approach)


Ah, okay. That's a single-core system, right? I switched the affinity of the ZDoom process down to one core to try to get a feel for how it'd run on an older system. I've got a quad-core with a decent GPU, so I'd rather not do the whole Cold as Hell "it runs fine on my system why is everyone else having problems with lag?" thing again. :)

Anyway, it's nice to know you're getting a good frame rate. I doubt this is going to run well on a 486, but my target was to get a playable frame rate on 3-5 year old computers, and weather effects are pretty notorious for killing framerate.
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: [Resource] JonnyFive's WeatherFX

Postby Cutmanmike » Fri Sep 12, 2008 8:52 am

Haven't tried it but I'm curious. Are you using the NOINTERACTION flag? It might save some cpu.
User avatar
Cutmanmike
Not dead
 
Joined: 06 Oct 2003
Location: United Kingdom

Re: [Resource] JonnyFive's WeatherFX

Postby JonnyFive » Fri Sep 12, 2008 9:08 am

Cutmanmike wrote:Haven't tried it but I'm curious. Are you using the NOINTERACTION flag? It might save some cpu.


No, the default objects are supposed to collide with the world, and I believe NOINTERACTION disables this. This is particularly a problem with the light snow, which drifts pretty far along.

If anyone wants to create a weather projectile with NOINTERACTION they can do so pretty easily by adding another spawner and droplet. They might need to add checks in the library to destroy the projectile (which might make the CPU savings moot, but I'm not sure) if it drifts below the map, however, and they would want to avoid using it on a projectile that might drift into walls and what-not.
Last edited by JonnyFive on Fri Sep 12, 2008 9:09 am, edited 1 time in total.
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: [Resource] JonnyFive's WeatherFX

Postby Cutmanmike » Fri Sep 12, 2008 9:09 am

JonnyFive wrote:No, the default objects are supposed to collide with the world, and I believe NOINTERACTION disables this.


A_JumpIf with floorz?
User avatar
Cutmanmike
Not dead
 
Joined: 06 Oct 2003
Location: United Kingdom

Re: [Resource] JonnyFive's WeatherFX

Postby JonnyFive » Fri Sep 12, 2008 9:12 am

Cutmanmike wrote:A_JumpIf with floorz?


Argh, you are ahead of my edits to my previous post! Darn you!

That would work for floor height, but not for wall collision. Like I said in my edit, I'm not sure the CPU savings would be worth the inconvenience, but I'd need to hear from some people with older computers on that. I'll keep it in mind, certainly.
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: [Resource] JonnyFive's WeatherFX

Postby Cutmanmike » Fri Sep 12, 2008 9:17 am

Oh of course, snow and that isn't just going to straight down... Well for the vertical rain surely it would work (and be worth adding :))
User avatar
Cutmanmike
Not dead
 
Joined: 06 Oct 2003
Location: United Kingdom

Re: [Resource] JonnyFive's WeatherFX

Postby JonnyFive » Fri Sep 12, 2008 9:32 am

Cutmanmike wrote:Oh of course, snow and that isn't just going to straight down... Well for the vertical rain surely it would work (and be worth adding :))


Just looked through the wiki and there's a floor and ceiling z-check, which is all I need to make a NOINTERACT rain work properly. I'll add it as an option, sure.

Will ZDoom 2.2.0 and GZDoom 1.1.04 dump out if they see an unfamiliar flag?

EDIT: Just tested it with my ninja-work-ZDoom and it looks like it works with GZDoom 1.1.04 and it'll probably work with the SVN, but ZDoom 2.2.0 both doesn't have the flag and doesn't like weird flags in its DECORATE file. Blech.

I think I may branch this into two versions until there's a new release, one for GZDoom/SVN and one for mass release ZDoom 2.2.0 stuff.

EDIT 2: Rargh rargh... +NOINTERACTION means no gravity... must adjust spawner z-momentum to compensate... rargh...
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: [Resource] JonnyFive's WeatherFX

Postby Enjay » Fri Sep 12, 2008 12:22 pm

Works very nicely with GZdoom r174 for me. No noticeable slowdown. :)
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: [Resource] JonnyFive's WeatherFX

Postby JonnyFive » Fri Sep 12, 2008 12:43 pm

I actually got a chance to test this at work during lunch on my P4, and I see no performance boost from using +NOINTERACTION, which is disappointing.

This is a 3.0 Ghz Pentium 4 single core with 1 gig of RAM and some crappy Intel integrated graphics controller.

GZDoom 1.1.04 Software:
Without +NOINTERACTION: ~= 100 FPS
With +NOINTERACTION: ~= 100 FPS

GZDoom 1.1.04 OpenGL:
Without +NOINTERACTION: ~= 68-69 FPS
With +NOINTERACTION: ~= 68-69 FPS

ZDoom 2.2.0 Software:
Without +NOINTERACTION: ~= 253 FPS

There may be some gain on a much slower computer, but I'm not sure it's worth it at this point since it breaks compatibility with ZDoom 2.2.0 and I don't like that gravity doesn't affect the projectiles at all. It was a very good idea, but I'll pass on it for the moment. Of course, anyone is free to add it if they want. :wink:

Anyway, I'll upload a new version with a couple minor changes to make things more fluid (such as changing the WFX_WeatherSpots to WFX_WeatherZones and adding some comments) as well as documentation.
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: [Resource] JonnyFive's WeatherFX

Postby JonnyFive » Fri Sep 12, 2008 12:44 pm

Enjay wrote:Works very nicely with GZdoom r174 for me. No noticeable slowdown. :)


Glad to hear it. :)

That garbage collector sure does help, doesn't it?
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: [Resource] JonnyFive's WeatherFX

Postby JonnyFive » Fri Sep 12, 2008 2:10 pm

Updated with documentation and 50% more shameless self-promotion.
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Next

Return to Resources

Who is online

Users browsing this forum: No registered users and 1 guest