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

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!

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

Postby Jekyll Grim Payne » Tue Jun 23, 2020 6:17 am

This contains ZScript code for waterfall fog spawner, meant to be placed at the bottom of waterfalls. Feel free to use this in your maps. Credits are appreciated but not required.

Version 1.5 features significantly improved performance, re-adds a missing sprite variation and offers easier spawner placement.
Version 1.6 adds another safeguard to make sure there will be no desyncs in multiplayer.

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



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. Changing the arguments will affect the fog's appearance in the following way:

  • Argument 1:Determines the length of the line along which the effects will spawn. Use the same value as your waterfall's linedef length. 0 (default) will make it spawn over a small area (useful for small water pillars and such).
  • Argument 2: Determines the color of the splashes:
    0: regular blue
    1: red
    2: green
    3: yellow
    4: purple
    5: dark-orange
    6: white
  • Argument 3: Scales the size of the splashes from x1 to x8 (higher values will look the same as x8). 0 (default) is interpreted as 1. Note that scale will affect visible size, so at high values you might want to reduce the values of arguments #1 and/or #4.
  • Argument 4: Density. Determines how many particles will be spawned along the waterfall's length. 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. Remember: higher values = less dense waterfall.
Last edited by Jekyll Grim Payne on Sun Oct 10, 2021 1:43 pm, edited 4 times in total.
User avatar
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript]

Postby Bratish » Tue Jun 23, 2020 8:55 am

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
Bratish
I have nothing to lose
 
Joined: 23 Jul 2019
Operating System: Debian-like Linux (Debian, Ubuntu, Mint, etc) 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Legacy GZDoom)

Re: Waterfall fog effect [zscript]

Postby Jekyll Grim Payne » Wed Jun 24, 2020 5:29 am

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
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript]

Postby Enjay » Wed Jun 24, 2020 9:23 am

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Waterfall fog effect [zscript]

Postby Jekyll Grim Payne » Wed Jun 24, 2020 10:45 am

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
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript]

Postby Enjay » Wed Jun 24, 2020 10:50 am

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Waterfall fog effect [zscript]

Postby Jekyll Grim Payne » Wed Jun 24, 2020 11:23 am

Did just that, attached a demomap.wad to the release.
User avatar
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: Waterfall fog effect [zscript]

Postby Enjay » Wed Jun 24, 2020 1:10 pm

Very nice - thank you. :)
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: Waterfall fog effect [zscript]

Postby ramon.dexter » Wed May 19, 2021 2:43 am

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
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby Jekyll Grim Payne » Sat Jul 10, 2021 1:54 pm

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
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

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

Postby Enjay » Sat Jul 10, 2021 5:10 pm

Again, very nice.

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

Code: Select allExpand view
Script warning, "Waterfall-Fog-Spawner.pk3:zscript.zs" line 43:
Truncation of floating point value
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: Waterfall fog effect [zscript] version 1.5 (2021/07/10)

Postby Jekyll Grim Payne » Sun Jul 11, 2021 4:28 am

Enjay wrote:Again, very nice.

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

Code: Select allExpand view
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
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

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

Postby Jekyll Grim Payne » Sun Oct 10, 2021 1:45 pm

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
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

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

Postby Enjay » Sun Oct 10, 2021 2:28 pm

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 allExpand view
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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Jekyll Grim Payne » Wed Oct 27, 2021 7:43 am

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 allExpand view
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.
User avatar
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Next

Return to Resources

Who is online

Users browsing this forum: No registered users and 3 guests