Waterfall fog effect [zscript] version 2.0 (2024/01/25)

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!
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Waterfall fog effect [zscript] version 2.0 (2024/01/25)

Post by Jekyll Grim Payne »

This contains ZScript code for a waterfall fog spawner meant to be placed at the bottom of waterfalls. They can be placed and configured from Ultimate Doom Builder. Feel free to use this in your maps. Credits are appreciated but not required.

DOWNLOAD: https://github.com/jekyllgrim/Waterfall ... m/releases

Version 1.7 and below require ZScript version 4.2.4.
Version 2.0 requires ZScript version 4.10.




Sprites are made from free resources available online. Feel free to replace them if you like.

How to use in your map:

- Place thing 20100 "WaterfallFogSpawner" at the center of your waterfall, facing away or towards the water wall.

- Open WaterfallFogSpawner's properties in Doom Builder, navigate to 'Action / Tag/ Misc.' tab to access arguments.

There are arguments and Custom user fields you can change. Detailed documentation here: https://github.com/jekyllgrim/Waterfall ... /readme.md
Last edited by Jekyll Grim Payne on Sun Oct 10, 2021 1:43 pm, edited 4 times in total.
User avatar
Bratish
Posts: 98
Joined: Tue Jul 23, 2019 4:24 pm
Graphics Processor: ATI/AMD (Legacy GZDoom)

Re: Waterfall fog effect [zscript]

Post by Bratish »

Man, you're a genius! I am not a programmer, but in my opinion your mod is really very useful and I would love to take it to my TC, but, alas, it is only for GZdoom 2.0.03, where ZScript has not been yet, and therefore I can only look at your screenshots and sigh.

And so, I repeat, your mod is just wonderful! I wish you success in your work.
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript]

Post by Jekyll Grim Payne »

Bratish wrote:I would love to take it to my TC, but, alas, it is only for GZdoom 2.0.03, where ZScript has not been yet, and therefore I can only look at your screenshots and sigh.
It would theoretically be possible to do this without zscript, but apart from being much more complicated and cumbersome, it would also have a greater performance impact (I've used some zscript-specific methods to make these objects as cheap as possible), so I probably won't be doing that. (I do kinda have to wonder why you're limited to a specific GZDoom version...)
User avatar
Enjay
 
 
Posts: 26823
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Waterfall fog effect [zscript]

Post by Enjay »

Works very nicely.

It would be cool if you included your test map with the distribution so that people could see it in action quickly, but it's easy enough to set up anyway.
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript]

Post by Jekyll Grim Payne »

Enjay wrote:Works very nicely.

It would be cool if you included your test map with the distribution so that people could see it in action quickly, but it's easy enough to set up anyway.
Yes, I've thought about it, but I'm not sure how to best arrange that so that it doesn't interfere with people who just want the effect in their maps. Maybe just attach the wad file to the github release?
User avatar
Enjay
 
 
Posts: 26823
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Waterfall fog effect [zscript]

Post by Enjay »

Yes, I would think that would work just fine.

I don't think your concern is a big one anyway. If people want to incorporate it into their maps properly, they'll need to put the separate elements into their project PK3 and they could just leave the map WAD out.
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript]

Post by Jekyll Grim Payne »

Did just that, attached a demomap.wad to the release.
User avatar
Enjay
 
 
Posts: 26823
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Waterfall fog effect [zscript]

Post by Enjay »

Very nice - thank you. :)
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Waterfall fog effect [zscript]

Post by ramon.dexter »

While this effect is truly beautiful and looks real, it is highly demanding on system resources. When I put like 20 waterfall spawners around my map, the FPS dropped from average 25 (old i5 with intel integrated graphics) to something lower than 15 fps, sometimes like 5 fps. When I removed the waterfall actors from the map, it is back on 25.
Could you try to optimise this? The performance impact on my newer system is less than noticeable (ryzen 7 3750 and rtx 2060), but my second laptop is barely struggling to run it.
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript] version 1.5 (2021/07/10)

Post by Jekyll Grim Payne »

It's been a while, but I've finally updated this and the performance is much better.
Release 1.5: https://github.com/jekyllgrim/Waterfall ... es/tag/1.5

Changes
  • Performance impact significantly reduced. Waterfall fog particles aren't respawned, instead the same particles are reused.
  • Fog particles will animate more slowly if the player is far away (1 tic slower per every 256 map units of distance). This effect is clientside-only but should be compatible with multiplayer since the waterfall spawner and particles are non-interactive.
  • Added argument #4: density. The higher the number, the less frequently fog particles will spawn. For example, if your waterfall is 128 units long and argument 4 is 8, a waterfall fog particle will be spawned every 8 units along its length, meaning 16 in total. The default value is 1 and it usually works, but if you use higher scale values (argument #3), then you might want to reduce the density.
  • From now on you need to place the waterfall fog spawner at the center of the waterfall linedef (not the edge), and make sure it faces away or towards the linedef (not alongside it).
Last edited by Jekyll Grim Payne on Sun Oct 10, 2021 1:45 pm, edited 2 times in total.
User avatar
Enjay
 
 
Posts: 26823
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Waterfall fog effect [zscript] version 1.5 (2021/07/10)

Post by Enjay »

Again, very nice.

Are you aware of this warning thrown up with developer mode on?

Code: Select all

Script warning, "Waterfall-Fog-Spawner.pk3:zscript.zs" line 43:
Truncation of floating point value
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript] version 1.5 (2021/07/10)

Post by Jekyll Grim Payne »

Enjay wrote:Again, very nice.

Are you aware of this warning thrown up with developer mode on?

Code: Select all

Script warning, "Waterfall-Fog-Spawner.pk3:zscript.zs" line 43:
Truncation of floating point value
I don't usually run in developer mode :) But yeah, it seems I'm returning a double value in an int function. It won't cause any issues though.
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript] version 1.6 (2021/10/10)

Post by Jekyll Grim Payne »

Release 1.6: https://github.com/jekyllgrim/Waterfall ... es/tag/1.6

Changes
Nothing significant this time:
  • Further ensured there will be no desyncs by setting FloatBobPhase to 0 to all classes
  • Added a 5th sprite variation
  • Updated the visibility check function to return a double instead of int (no visible effects except there will be no error in developer mode)
User avatar
Enjay
 
 
Posts: 26823
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Waterfall fog effect [zscript] version 1.6 (2021/10/10)

Post by Enjay »

Thanks for the update. Still looking good.
However...
Jekyll Grim Payne wrote:
  • Updated the visibility check function to return a double instead of int (no visible effects except there will be no error in developer mode)

Code: Select all

Script warning, "Waterfall-Fog-Spawner.pk3:zscript.zs" line 94:
Truncation of floating point value
The zscript file in the PK3 has today's date so I'm pretty sure I have the right version.
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript] version 1.6 (2021/10/10)

Post by Jekyll Grim Payne »

Enjay wrote:Thanks for the update. Still looking good.
However...
Jekyll Grim Payne wrote:
  • Updated the visibility check function to return a double instead of int (no visible effects except there will be no error in developer mode)

Code: Select all

Script warning, "Waterfall-Fog-Spawner.pk3:zscript.zs" line 94:
Truncation of floating point value
The zscript file in the PK3 has today's date so I'm pretty sure I have the right version.
Ah yes... that's because the visdist variable that the visibility check value is recorded to is still an int... Well, that won't cause any issues anyway. I'll push a commit but won't make a new release for now.

Return to “Resources”