bogstandard / rl-weather

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

Periodic weather events #8

Open Billybishop opened 2 years ago

Billybishop commented 2 years ago

This should be labeled as an enhancement, also if you want to mark it help wanted then I may be able to contribute a proof of concept when I come into some free time.

To go along with the other enhancement of location-matching, I thought of this idea which would be a great addition to making this plugin more immersive and seamless with the game world.

The goal of this enhancement is to provide a configurable probability section in the plugin's settings. The probability should be tied to some basic weather parameters, with some of them being affected by the location-matching feature. To start with we could use these basic parameters to affect the probability of certain weather events:

There are a few others we could define, which wouldn't add much additional value to the simulation, so to keep things relatively simple and easy to implement I think the only necessary ones are the above listed.

For a description of how this should work:

Due to the nature of this enhancement, depending on which enhancement is completed first (this or the location-matching), the location-based values can use predefined ranges for each parameter that are configurable within the settings to use as a placeholder.

bogstandard commented 2 years ago

Love this idea, I think you're right that it can be merged with the proposed in-game region based weather.

If we get in-game region based weather working, eg. Barbarian village is raining, on a CSV or JSON feed basis, then we can periodically shuffle that data feed of regional weather to reflect the algorithmic changes you're describing.

Then, as you describe, it could be cold in Lumbridge on a given day and all users of the plugin with In-Game-Regional-Weather enabled will get the appropriate cold weather.

Now I know there's an appetite for more granular changes between regions I'll program that into any region weather system I build, originally I was going to do the basis on/off for the various effects.

Note to readers; The in-game region-based weather proposal is not to be confused with the real-world location aware weather (which is currently awaiting a merge by the Plugin Hub maintainers).

EDIT This can work with real-world location matching too but I'd like to let that feature lay untouched for a while as it had some very messy development and hasn't been merged by the Hub maintainers yet.

Billybishop commented 2 years ago

Love this idea, I think you're right that it can be merged with the proposed in-game region based weather.

If we get in-game region based weather working, eg. Barbarian village is raining, on a CSV or JSON feed basis, then we can periodically shuffle that data feed of regional weather to reflect the algorithmic changes you're describing.

Then, as you describe, it could be cold in Lumbridge on a given day and all users of the plugin with In-Game-Regional-Weather enabled will get the appropriate cold weather.

Now I know there's an appetite for more granular changes between regions I'll program that into any region weather system I build, originally I was going to do the basis on/off for the various effects.

Note to readers; The in-game region-based weather proposal is not to be confused with the real-world location aware weather (which is currently awaiting a merge by the Plugin Hub maintainers).

EDIT This can work with real-world location matching too but I'd like to let that feature lay untouched for a while as it had some very messy development and hasn't been merged by the Hub maintainers yet.

Having a JSON map of weather values for the game regions sounds good. We could check for tiles that match a certain region, for reference here is a good region map with IDs overlayed to get an idea of what range of IDs are in a similar geographical region:

bogstandard commented 1 year ago

Hi @Billybishop, so I have been working on this (Sorry I'm a year late lmao). I hope to release soon but no promises. I've attached some work in progress videos and screenshots here.

I tried Region based weather but it felt strange and too blocky. So I went to Tile based instead. I was really keen to tie it into the world map too, after some real headaches I got the following working using a SimplexNoise algorithm. This algorithm does a great job at generating infinite sets of smooth patterns that mimic real weather forecast maps pretty well.

https://github.com/bogstandard/rl-weather/assets/9356170/55d44fe0-bdcf-4f9f-bcd8-06dec1bbe69b

Things to note here:

  1. The pattern formations move slightly every 1 second, I will likely delay this be 10 seconds at release.
  2. The patterns can be panned around and zoomed in on.
  3. The colours are changeable if need be.
  4. This runs off Java's Random using a seed and tied to unix time, meaning everyone using it will get the same random but natural feeling patterns as each other, forever, with no need for a server or someone planning the weather. It also means, if you log out, close RuneLite and come back immediately, the same weather patterns will be there.
  5. There is room for making the pattern types change gradually between big heavy cloud patterns and very patchy portions of cloud. (See below screenshots).

Screenshot 2023-06-11 at 19 55 50

Screenshot 2023-06-11 at 19 55 40

Things I want to do before I'm happy to publish:

  1. Designate specific areas where cloud patterns should not occur (eg. the desert).
  2. Designate specific areas where it produces snow instead of rain.
  3. Designate the "peaks" of the blobs to create lightning effects instead of just rain.

Things that could be cool:

  1. Graphical clouds possibly animated instead of coloured blobs (eg. lighting flashes in the clouds).
  2. Because of the the nature of the algorithm backing this technique, it is possible to forecast the pattern movements infinitely into the future. It would be cool to setup a GitHub based microsite which provides weather forecasts for this.