N_WeatherFog

As promised, I figured out the proper math to render black fog, as well as make intensity more consistent with different colors.

I've also found and fixed a bug where notetag fog affected the current weather. Oops.

Version 1.4.1
Fixed

  • Fog created through notetags can affect fog on other maps.
  • Fog intensity not consistent depending on color.
  • Black fog was invisible.
Sorry, it seems I've completely missed your comment.

Thank you very much for the report. I've reproduced the issue and will have an update ready to fix this soon.
Thank you very much! The new version 1.4 is awesome.

I just have one issue, because I'm using a plugin, that adds Weather to the Title screen. It worked with your previous version, because it also adds a Spriteset to Scene_Title, which it normally does not have. However now your plugin also requires $dataMap to be set for the Notetag-Parsing.
Would you please be so kind and check if $dataMap is actually set before accessing $dataMap.meta so that I can still use both plugins together?
Thank you very much! The new version 1.4 is awesome.

I just have one issue, because I'm using a plugin, that adds Weather to the Title screen. It worked with your previous version, because it also adds a Spriteset to Scene_Title, which it normally does not have. However now your plugin also requires $dataMap to be set for the Notetag-Parsing.
Would you please be so kind and check if $dataMap is actually set before accessing $dataMap.meta so that I can still use both plugins together?

Thanks for the report.

I've released version 1.4.2, which should no longer crash when $dataMap is not available.
tiny question (with no rush), even if <fog: 0.6 #color> that is fixed.
and if you do the following:

<fog: 0.5 #color1 jsCode>
<fog: 0.9 #color2 jsCode>
<fog: 0.3 #color3 jsCode>
<fog: 1.5 #color4 jsCode>

so if first line is target a switch $gameSwitches.value(3) (ON) it has that fog
otherwise, it checks on variable based to switch between fog.

I think it can have an intresting effect on target events between start
and end or during, mid and always possible to change.

no rush, just an idea (as jsCode can be ommited if not used).
tiny question (with no rush), even if <fog: 0.6 #color> that is fixed.
and if you do the following:

<fog: 0.5 #color1 jsCode>
<fog: 0.9 #color2 jsCode>
<fog: 0.3 #color3 jsCode>
<fog: 1.5 #color4 jsCode>

so if first line is target a switch $gameSwitches.value(3) (ON) it has that fog
otherwise, it checks on variable based to switch between fog.

I think it can have an intresting effect on target events between start
and end or during, mid and always possible to change.

no rush, just an idea (as jsCode can be ommited if not used).

I think it would be better to allow intensity and color to be a variable instead. Something like:
Code:
<fog: v[1] v[2]>
For a variable fog, where the intensity is taken from variable #0001 and the color is taken from variable #0002.

I'll make this part of version 1.5.0.

While this isn't particularly hard to do (I've done something similar in the past), real life has caught up to me. So this update is going to take some time.
no worries, variable between 2 numbers for each map (if difference)
can be idea, 3rd args for s[1] for switch id to toggle/on-off
so it can be controlled there, otherwise, plugin command
with a conditinal branch what I can also do 🙂

no rush, whenever you feel too and have more time.
enjoy the good weaher as well and RL goes first 🙂
Hello! Sorry to bother, but I seem to be having a bit of trouble and I'm not sure why. :c When walking left and right, the fog seems to act normal as seen in your gif, but...when going up and down, it acts very strange and moves around. It's quite jarring, especially when running, and I was wondering if you may be able to help.

This is version 1.4.2 (though I tried a few past ones and same result) of the plugin. These gifs are from a fresh project with no other plugins aside from a WASD keyboard one (which, when turned off, has the same result). I thought one of my plugins was to blame, hence the fresh project. ;o; I put two examples of running around here on imgur (i couldn't get the gifs to embed properly).

This is MV, so perhaps that is to blame? The other person on MV never mentioned it here, though, so I'm unsure if somehow my end is to blame. ;o; Thank you for your time.
Hello! Sorry to bother, but I seem to be having a bit of trouble and I'm not sure why. :c When walking left and right, the fog seems to act normal as seen in your gif, but...when going up and down, it acts very strange and moves around. It's quite jarring, especially when running, and I was wondering if you may be able to help.

This is version 1.4.2 (though I tried a few past ones and same result) of the plugin. These gifs are from a fresh project with no other plugins aside from a WASD keyboard one (which, when turned off, has the same result). I thought one of my plugins was to blame, hence the fresh project. ;o; I put two examples of running around here on imgur (i couldn't get the gifs to embed properly).

This is MV, so perhaps that is to blame? The other person on MV never mentioned it here, though, so I'm unsure if somehow my end is to blame. ;o; Thank you for your time.

I'm very sorry about that. It appears that the fog's vertical movement is indeed inverted in MV. My MV testbed used a small, non-scrolling map, so I never noticed it before.

I'm not sure about the cause of the bug, since both MV and MZ are sending the same data to the shader, and shader code should behave the same way on both MV and MZ.

In any case, I've made a temporary hotfix that inverts vertical movement on MV. I'm hoping to make a proper fix once I have more time to investigate the issue more deeply.

You can download the newest version 1.4.3 here: https://github.com/Nolonar/RM_Plugins-WeatherFog/releases/download/v1.4.3/N_WeatherFog.js
No problem, thank you so much for taking the time to check and fix it! Your fog plugin is the best I've seen and I'm very excited to try to use it. It looks very beautiful! ;o;

I wish I could be of more help, but I'm not good at coding as you can tell. I hope everything goes well for you irl and thank you so much again for your help! 😍
is there a way to make this a random event like for

morning afternoon evenings night also from day SMTWTFS?
is there a way to make this a random event like for

morning afternoon evenings night also from day SMTWTFS?

Not in the plugin directly, but you can create a (common) event that enables/disables fog at random. The fog is persistent, so if you turn it on, you have to remember to turn it off again.

The recently added map notetags can be helpful to define maps in which fog should never be active (like interior maps) or always be active. These notetags do not interfere with manual fog activation. If you randomly enabled the fog while inside a building, you'll notice the fog as soon as you get out, for example. This means that your event doesn't need to find out if the player is inside a building or not, because as long as the notetag is properly set, it doesn't matter.

If that doesn't work, be sure to notify me, and I'll see that it gets fixed.
Just found this plugin exists, and this is something I had been looking for before.

Though there must be some incompatibility with MV(1.6.1), since the game resolution gets reduced as if part of the screen got cropped out of the window frame.
Spoiler: screenshot resolution loss
This is how the game looks with the fog plugin disabled:
n fog not.jpg


This is after the fog plugin gets enabled:
n fog.jpg

This is the whole window, normally the game resolution should be something around 800 x 600, but here the bottom right corner got cropped out, and the remaining part got stretched to fill the whole window.
See also how the player character is not at the center as it normally should.

The fog was called on that map by using the notetags:
Code:
<fog: 0.6 cyan>
I was wondering if this was caused by a plugin conflict, but after disabling all plugins, the issue remains the same. So it must be something directly involving compatibility with MV.
A shame MV compatibility is no longer supported.
Just found this plugin exists, and this is something I had been looking for before.

Though there must be some incompatibility with MV(1.6.1), since the game resolution gets reduced as if part of the screen got cropped out of the window frame.
Spoiler: screenshot resolution loss
This is how the game looks with the fog plugin disabled:
View attachment 243407

This is after the fog plugin gets enabled:
View attachment 243406
This is the whole window, normally the game resolution should be something around 800 x 600, but here the bottom right corner got cropped out, and the remaining part got stretched to fill the whole window.
See also how the player character is not at the center as it normally should.

The fog was called on that map by using the notetags:
Code:
<fog: 0.6 cyan>
I was wondering if this was caused by a plugin conflict, but after disabling all plugins, the issue remains the same. So it must be something directly involving compatibility with MV.
A shame MV compatibility is no longer supported.

Thanks for the bug report. Unfortunately, I can't reproduce this issue on my end. Do you think you could share a project where this bug occurs?

One way you could do it, is make a copy of your current project, and delete all maps except the test map, as well as deleting all assets except the ones used in the test map. This will ensure your project is as small (and secret) as possible. Make sure to check if the demo project still has the bug before sharing it.

Also, it's very likely it'll take me a lot of time to identify and fix this bug, so don't wait on my fix to continue working on your project.
Thanks for the bug report. Unfortunately, I can't reproduce this issue on my end. Do you think you could share a project where this bug occurs?
Here a new blank project which shows the same bug:

I'm starting to think that if you couldn't reproduce it on your side, then the cause may be the upgraded nwjs engine which I've set on version 0.44
If that were to be the case, that would be some really niche bug to have run into. And not something worth spending too much time on, aside from idle curiosity.

To verify that possibility I'll have to also upload a deployed version of the same project, to also include the game.exe (=nwjs engine), will get to that later.
Edit. here the deployed blank project with the bug

Thanks anyway for having a look into this.
Here a new blank project which shows the same bug:

I'm starting to think that if you couldn't reproduce it on your side, then the cause may be the upgraded nwjs engine which I've set on version 0.44
If that were to be the case, that would be some really niche bug to have run into. And not something worth spending too much time on, aside from idle curiosity.

To verify that possibility I'll have to also upload a deployed version of the same project, to also include the game.exe (=nwjs engine), will get to that later.
Edit. here the deployed blank project with the bug

Thanks anyway for having a look into this.

Thanks for the test projects. Unfortunately, I still can't reproduce the issue even with them:

Screenshot 2022-10-24 172814.png


Left: test_fog (running on MS Edge served through npm http-server)
Right: test_fog deplo

Both are running on the Windows Sandbox on Windows 11 to eliminate the possibility of some previously installed software affecting the results. This means those are the results you get if you were to run the game on a fresh install of Windows 11 before installing anything else (test_fog deplo was launched before I installed NPM and http-server).

If test_fog deplo uses nwjs 0.44, that means we can at least exclude it as the culprit, at least on Windows 11. Based on your screenshot, I think you might be running Windows 7 or Windows Vista, although at this point I think it's too soon to blame the OS.

This is definitely a strange bug. I'll see if I can somehow organize a Vista/7 VM, but don't expect too much.

I'm sorry I couldn't be more helpful.
I run win7 and dont have that issue either, as well I upgrade NWJS to 4.8.4
and pixi to 49.4 I believe.

so it would be hard to figure out what causes the bug.

I will test those 2 project to see what happen on my end.

EDIT:

I tested on on my system, of the 2 project, no errors or out of place
cropped/scaled characters.

so there is something else conflicting or something wrong.

can you test what version of NWJS you use? and pixi version?
you can set that in the console log and type in.

process.versions

to see the nwjs version, not sure for pixi there.

else update nwjs to 48.4 and pixi to 4.8.9 and see if you still have the issue.
If test_fog deplo uses nwjs 0.44, that means we can at least exclude it as the culprit, at least on Windows 11.
It does use nwjs 0.44, and yes that should exclude that as the cause of this bug, if even by running it on your side the bug doesn't show up.
Based on your screenshot, I think you might be running Windows 7 or Windows Vista, although at this point I think it's too soon to blame the OS.
Win7

This is definitely a strange bug. I'll see if I can somehow organize a Vista/7 VM, but don't expect too much.

I'm sorry I couldn't be more helpful.
It's indeed really weird, since neither plugins nor the setup itself seems to be the cause of it, there should be something out of the box interfering with it on my side.
And don't worry about it, this bug seems to be happening only to me from some atypical setup of my system, so its unlikely for this bug to show up for others, thanks again for having taken the time to look into it.

can you test what version of NWJS you use? and pixi version?
nwjs 0.44.0
pixi.js - v4.5.4
But since both should be included in the "test_fog deplo" demo, and the bug still doesn't show up for you guys, as noted above, those two pieces shouldn't be the ones causing this.
Hello everyone, I've just released version 1.4.4 today, which fixes a bug that caused the fog to render on top of pictures.

If you prefer for the fog to render on top of them, simply edit line 389 in the plugin from this:
JavaScript:
const sprite = this.mapSpriteset._baseSprite;
to this:
JavaScript:
const sprite = this.mapSpriteset;

@Meremem I hope 1.4.4 fixed this weird cropping and stretching issue with MV. With no way to reproduce this issue, I also have no way to test for myself if that fixed it or not. In your case, I recommend you don't edit line 389 until we're absolutely certain this actually fixes your issue. Once we have certainty, I'll be able to work on a version that allows to choose between one behavior or the other, which should still work on your end.
I've released this fix as version 1.4.4. If my hypothesis is correct, this would also (hopefully) fix your cropping and stretching issue. Since I can't reproduce your issue, however, I have to rely on you for testing if the issue is really resolved or not. I hope you don't mind.
You are ing amazing, you know that?
You have solved it. N_WeatherFog works as intended now also on my part.
😂
Also it's interesting to get a closer understanding of what happens inside the engine. Thanks for the explaination.

With any luck, we've successfully identified and fixed your issue. But allow me to thank you once again for helping me fix a completely different bug I've been trying to track for over a year.
Hopefully this fix won't generate other issues elsewhere for you :LZSgrin: But at least I was able to contribute something aside the hassle for this strange stretching bug.
Many thanks to you again for helping.
Hi, sorry if my question/request is a bit strange but is it possible to use the Perlin noise from this plugin as a displacement input for the pixijs displacement filter that comes from this plugin?

What I'm trying to achieve is a water displacement effect like what you see in 3d games within RPG Maker, somewhat similar to this.

The effect needs some sort of noise to use a displacement input but I don't have any knowledge of Javascript and I found your plugin to be the only plugin out there that implements Perlin noise. I really appreciate the help if anyone can help me with this!

Original thread: https://forums.rpgmakerweb.com/threads/n_weatherfog.127256/