Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periodic weather events #8

Open
Billybishop opened this issue Mar 8, 2022 · 3 comments
Open

Periodic weather events #8

Billybishop opened this issue Mar 8, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Billybishop
Copy link

Billybishop commented Mar 8, 2022

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:

  • Temperature
  • Precipitation
  • Humidity
  • Wind

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:

  • Humidity is the amount of water being held in the air, so the magnitude or how much rain or snow will be rendered in the event of probability returning true
  • Water starts as a gas, so unless probability returns true then the weather event will remain invisible
  • Precipitation is the likelihood of the gas turning into liquid (rain) or solid (ice)
  • Rain or snow event probability should be a check to see if an RNG between 1-100 is greater than the probability chance
  • The temperature value should determine whether the rendered event is rain or snow
  • The numbers generated for each of the four probability weather parameters should be tied to location and generated within a certain range, for example - when in the Ice Mountain area:
    • Temperature will have a RNG value between 1-10, representing the 'degrees' (in celsius)
    • Precipitation will be more likely with an RNG value between 80-100
    • Humidity will be higher with an RNG value between 70-100 (percent of full humidity)
    • Wind will be higher due to the elevation so it will have an RNG value between 60-100 (percent of wind speed)
  • Weather parameters should be re-generated periodically, so every X seconds, configurable from the settings

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
Copy link
Owner

bogstandard commented Mar 11, 2022

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.

@bogstandard bogstandard added the enhancement New feature or request label Mar 11, 2022
@Billybishop
Copy link
Author

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
Copy link
Owner

bogstandard commented Jun 11, 2023

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.

Screen.Recording.2023-06-11.at.19.28.42.mp4

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants