-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Weather realism #34515
Weather realism #34515
Conversation
Looks good to me! |
src/weather_gen.cpp
Outdated
// Greatest absolute change from a day's average temperature, in kelvins | ||
constexpr double seasonality_magnitude_K = 15; | ||
// Greatest absolute change from the year's average temperature, in kelvins | ||
constexpr double noise_magnitude_K = 8; // 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 2
commented-out previous code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's the kind of code cleanup I'll do.
Will need some decent play testing, but in broad strokes this is IMO a drastic improvement that I'd love to have in the game. |
Awesome, I'll finish this up, then. @kevingranade, what is your opinion on the issue of moving the game start date? |
ret.base_humidity = jo.get_float( "base_humidity", 50.0 ); | ||
ret.base_pressure = jo.get_float( "base_pressure", 0.0 ); | ||
ret.base_acid = jo.get_float( "base_acid", 0.0 ); | ||
ret.base_wind = jo.get_float( "base_wind", 0.0 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked over the data output, and I saw that windspeed average was significantly lower than usual, and had far less variability over the year.
Infact the highest windspeed for the entire year was 13mph
Would this be due to this change? and also above to peaks and variation, and also the change to W =
algorithm in get_weather() ? you didn't specify any rationale for change in windpower, although the changes to humidity pressure and precipitation look perfect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I simply haven't looked at wind data or adjusted the wind code in this PR, so it relates to pressure the same way it used to. Should I overhaul wind, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You set base_wind, base_wind_distrib_peaks, and base_wind_season_variation to 0, in this block of code. and changed the algorithm for W = in get_weather().
Wind , as far as I can tell, dosnt need overhauling because it was set to new england data in the same way as you are doing for pressure and humidity. it could be that your changes to pressure are resulting in a flatter and lower wind distribution, due to the relationship that it previously had with the pressure value.
Could you output the data , but with no changes to those wind variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, actually those are default loaded values if regional settings dont specify any. so it should still be the same, assuming you are using the standard regional settings.
It must be the pressure to wind relationship is different now.... may require some tweaking to get the previous wind behaviour with the new pressure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right: the default region settings are just less redundantly specified now. And the change on the line with the assignment to W
is just a variable rename. The pressure-to-wind relationship is the same, but pressure is different, so wind is different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's up to you, wind is not vastly broken after this or anything, but it would be nice if you could find a relationship between wind and the new pressure that preserves as much of the old wind data distribution as possible - as that was matched to real-world data as close as possible in a previous PR.
If you want to do that in a separate PR, that would be fine, imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, let's focus on the other variables for now and maybe I'll do wind in a new PR.
8c45d94
to
531ab31
Compare
Okay, this PR should be good to go now. |
7c66f0d
to
44a7b81
Compare
595bcf7
to
c24bde2
Compare
c24bde2
to
d9b5949
Compare
@Kodiologist do you happen to have the data on rain fall handy for another chart? I'd love to see the pre- and post-PR CATA precipitation versus the real world data. |
Yes, in the form of the weather log linked to above. |
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: |
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/missing-weather/23427/6 |
Summary
SUMMARY: Balance "More realistic temperature, precipitation, humidity, and pressure"
Purpose of change
Closes #34139 - More realistic precipitation and temperature.
Describe the solution
The generation of temperature, humidity, and pressure using time and simplex noise has been overhauled to more closely match real 2010s data from New England, particularly Concord, New Hampshire, since New Hampshire is roughly in the middle of New England. I also edited the humidity and pressure thresholds for the various precipitation types so that the rate at which the player sees light precipitation (Drizzle, Flurries) or moderate precipitation (Rain, Snowing, etc.) is similar to the real data. Finally, I've added tests for temperature and precipitation realism.
I've moved the default
INITIAL_DAY
to Spring 60, which has a typical low around 35 °F, since a typical low on Spring 30 is now around 25 °F (from 35 °F before this PR).While I've changed the amount of rainfall produced by
generic_wet
andgeneric_very_wet
, I haven't adjusted the other effects (field decay and player wetness) because I don't know how to relate them to real weather data.Some downstream gameplay effects:
Describe alternatives you've considered
It's clear that many more changes could be made, such as:
But I think the PR I'm proposing improves things, without requiring lots of code changes.
Additional context
An example weather log is attached. Here are some results from my analysis script:
Mean absolute running difference - lows
CONCORD, NH 2014 - 6.385
CONCORD, NH 2015 - 6.432
CONCORD, NH 2016 - 6.134
BOSTON, MA 2014 - 4.261
BOSTON, MA 2015 - 4.514
BOSTON, MA 2016 - 4.414
CARIBOU, ME 2014 - 6.423
CARIBOU, ME 2015 - 6.016
CARIBOU, ME 2016 - 5.942
Cata - 5.866
Mean absolute running difference - highs
CONCORD, NH 2014 - 6.319
CONCORD, NH 2015 - 6.457
CONCORD, NH 2016 - 6.841
BOSTON, MA 2014 - 6.772
BOSTON, MA 2015 - 6.72
BOSTON, MA 2016 - 7.066
CARIBOU, ME 2014 - 6.162
CARIBOU, ME 2015 - 6.637
CARIBOU, ME 2016 - 6.419
Cata - 6.149
Mean within-day range
CONCORD, NH 2014 - 22.501
CONCORD, NH 2015 - 24.353
CONCORD, NH 2016 - 24.098
BOSTON, MA 2014 - 14.866
BOSTON, MA 2015 - 15.773
BOSTON, MA 2016 - 15.366
CARIBOU, ME 2014 - 18.781
CARIBOU, ME 2015 - 19.214
CARIBOU, ME 2016 - 19.421
Cata - 19.637
Extreme window center - lows
CONCORD, NH 2014 - 2
CONCORD, NH 2015 - 52
CONCORD, NH 2016 - 43
BOSTON, MA 2014 - 22
BOSTON, MA 2015 - 45
BOSTON, MA 2016 - 43
CARIBOU, ME 2014 - 2
CARIBOU, ME 2015 - 34
CARIBOU, ME 2016 - 352
Cata - 40
Extreme window center - highs
CONCORD, NH 2014 - 180
CONCORD, NH 2015 - 210
CONCORD, NH 2016 - 205
BOSTON, MA 2014 - 181
BOSTON, MA 2015 - 211
BOSTON, MA 2016 - 205
CARIBOU, ME 2014 - 180
CARIBOU, ME 2015 - 228
CARIBOU, ME 2016 - 194
Cata - 214
PRECIPITATION
Proportion of days with ≥1 mm of precipitation
CONCORD, NH 2014 - 0.293
CONCORD, NH 2015 - 0.266
CONCORD, NH 2016 - 0.238
BOSTON, MA 2014 - 0.26
BOSTON, MA 2015 - 0.258
BOSTON, MA 2016 - 0.235
CARIBOU, ME 2014 - 0.342
CARIBOU, ME 2015 - 0.342
CARIBOU, ME 2016 - 0.361
Cata - 0.212
Proportion of hours with light precip or more
CONCORD, NH 2014 - 0.039
CONCORD, NH 2015 - 0.031
CONCORD, NH 2016 - 0.028
BOSTON, MA 2014 - 0.039
BOSTON, MA 2015 - 0.032
BOSTON, MA 2016 - 0.029
CARIBOU, ME 2014 - 0.046
CARIBOU, ME 2015 - 0.035
CARIBOU, ME 2016 - 0.041
Cata - 0.039
Proportion of hours with heavy precip
CONCORD, NH 2014 - 0.014
CONCORD, NH 2015 - 0.012
CONCORD, NH 2016 - 0.01
BOSTON, MA 2014 - 0.016
BOSTON, MA 2015 - 0.01
BOSTON, MA 2016 - 0.012
CARIBOU, ME 2014 - 0.011
CARIBOU, ME 2015 - 0.006
CARIBOU, ME 2016 - 0.013
Cata - 0.015
Total precip per year (cm)
CONCORD, NH 2014 - 116.796
CONCORD, NH 2015 - 96.603
CONCORD, NH 2016 - 84.102
BOSTON, MA 2014 - 115.09
BOSTON, MA 2015 - 88.416
BOSTON, MA 2016 - 84.082
CARIBOU, ME 2014 - 114.754
CARIBOU, ME 2015 - 89.606
CARIBOU, ME 2016 - 111.868
Cata - 71.05
A plot of relative humidity (orange), vs. Concord in 2014 (blue):
A plot of pressure (hPa, orange), vs. Concord in 2014 (blue):