bogstandard / rl-weather

Weather plugin for RuneLite
BSD 2-Clause "Simplified" License
9 stars 3 forks source link

rain/snow depth? #12

Closed Jin-Jiyunsun closed 1 year ago

Jin-Jiyunsun commented 2 years ago

a suggestion would be to mix different sizes of particles and make them move faster or slower depending on thier size to give the rain and snow effect a little more depth

bogstandard commented 2 years ago

This should be fairly easy to implement, if you want to make a pull request you're more than welcome. Just be aware that it will still need to reflect the user defined Gravity and Sizes, so some factor of difference will have to be decided.

Jin-Jiyunsun commented 1 year ago

tried building it in intelij but the plugin wont show up in the client so i cant do anything

scratch that, i got it running but ive absoloutly no idea what im doing

ipkpjersi commented 1 year ago

I may give this a whirl some time if I manage to find some free time unless someone beats me to it.

bogstandard commented 1 year ago

I'm giving this an attempt in my free time, but whoever gets their first or has the best solution wins :)

ipkpjersi commented 1 year ago

I'm thinking if we have a minimum size and a maximum size as two options with a random size toggle option then we could just generate random sized snow and rain between min and max. That'd be more realistic to start at least, even without having to dynamically determine gravity. Just my thoughts for now.

bogstandard commented 1 year ago

I've done a rough implementation of this on the new particle-depth branch. Works as following:

It's not the best the best implementation and it works better for snow, rain it's not really noticeable (honestly I've never liked the rain effect I made much anyway, if its able to be overhauled I'd be more than accommodating).

ipkpjersi commented 1 year ago

The depth actually looks really good.

I've gone ahead and fixed the rain on a new branch, you can actually see the different sized rain really well now, it looks quite nice imo especially with the dynamic gravity:

Feel free to test it out, I think it's a pretty decent improvement.

I'm quite happy with this plugin currently, I'm hoping to have some time in December to rewrite the sounds in this plugin to use an MP3 library or something similar instead of the default WAV audio, so that'll be cool.

bogstandard commented 1 year ago

Nice one with the depth fix, I've just reverted your change to the rain x2, x1 stuff, it needs to be the previous way because it doesn't match the wind direction (left to right) otherwise.

I'll merge this into master and update the Plugin Hub this week hopefully.

ipkpjersi commented 1 year ago

For some reason, correcting the direction completely changes the size of the droplets, and it makes them way bigger (longer):

Maybe that's intended though, since you can always manually change the length via options and then it looks fine:

Just something I noticed, seems like it's probably fine though.

bogstandard commented 1 year ago

That's curious, it's likely to do with the droplets for rain being intentionally rendered "backwards". The x1, y2 points will always be ahead, and the x2, y2 points are the previous coordinates of the droplet.

The reason it goes x2, y2, x1, y2 instead of x1, y1, x2, y2 is because the drops have to fall in the direction of the wind, so the end of the droplet is toward the top of the screen, and the start of the droplet is toward the bottom. They're being dragged by the wind rightwards as it falls to earth, I try to think of x2, y2 as the trail of the drop.

Like I said I'd ultimately like to overhaul the whole rain mechanism! The original plugin was written by me very hastily over a couple of mulled wine heavy nights, so some of the choices I made are rather hairy.

bogstandard commented 1 year ago

This is all merged in now, big thanks @Jin-Jiyunsun for promoting a cool idea & giving it a try! Big thanks to @ipkpjersi for helping with this one and the other sound issues!

Gonna be closing this one since the main topic has been completed 🥳