Back to serious matters with real impact -
weather!
penedeyewink:
I dont have to be a rocket scientist to see a trend already in the poll. My low self-esteem self said immediately:
Revert!Revert!
But i wouldnt be me if i wouldnt find a reason to
shred more code into bits and pieces so the other self-esteem part got the upper hand anyways :evilsmile:
The longer i stared at the code the more it became obvious for me why things where so tricky to solve. The current weather implementation uses a span of random numbers defined for each month to create weather each day - completely unrelated to any past temperatures. That created huge temperature swings already in the past but because they would only happen once per day nobody had noticed(or complained) about it - the current change to weather is just the number of calling a new one more often but no change in logic at all.
My main reason for dealing with it in the first place was some serious annoyance for many users not being able to get quest/events to progress without using the cheat menu - that should not be needed for 'normal' gameplay. If anyone is interested in the math for a popular example:
To sunbath it has to be minimum 15°C and clear. Currently there are the month May - September where that number can be rolled in the randomizer. Most of them where using a number span of 15. That means you had a 1:15 chance to hit the right temperature but that would still leave the sky which would be a coinflip. Thats effectively a 1:7 chance per day to get what is needed. Playing statistical devil you would have 1 day per week in those months where you could sunbath in other words.
My 'lets call it more often' was against my own rules and a quick shot to get some actual user feedback if that would change things. To make weather act more natural and also a bit more predictable i am going to make a change towards 2 things based on these Saint Petersburg figures:
The max deviation will be changed. According to the above table you will notice that distances between high/low in a month are max 8°C and min 3°C (game checks use only this value so i will not translate all to Fahrenheit here). 8+3=11/2=5 (integer only).
The monthly averages of the above table will be used as monthly base and daily temperatures will be allowed a max deviation of 5°C from that base. I will split the current weather call into 2 or allow a parameter to ONLY call sky. Which will be called twice a day - at day start and around noon.
This system would make temperatures somewhat more stable during a month as all deviations are based on the same average. Happy to hear comments
Addendum: No plan without a plan B. I am mostly finished with this module but figured why remove how arbitrary the temperature is created and not do the same with weathertype?
So the future for rain, snow etc will be based on average raindays per month for Saint Petersburg.
This mean technically: We flip our randomizer and for every day that isnt 'clear skies' we will be counting up a monthly counter until it reaches the average raindays. This means even if the player is extremely unlucky with the weather in the first half of the month there will be guaranteed 'clear skies' for the rest of the month. This should finally eliminate the second part of the problem with quest/event checks to never fire.