-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Wind direction generation / tweaks of windpower #27772
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
changed the title
WIP Wind direction generation / tweaks of windpower
Wind direction generation / tweaks of windpower
Jan 22, 2019
Looks nice. I love how you delivered the statistics to visualize the effect. It would be nice if the constants (seed data) would be moved into JSON files for modability (simulation of regions other then NE), but since its kinda true for the whole weather system, it can be done anytime in the future. |
OrenAudeles
reviewed
Jan 22, 2019
ZhilkinSerg
added
<Enhancement / Feature>
New features, or enhancements on existing
[C++]
Changes (can be) made in C++. Previously named `Code`
Mechanics: Weather
Rain, snow, portal storms and non-temperature environment
labels
Jan 22, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
<Enhancement / Feature>
New features, or enhancements on existing
Mechanics: Weather
Rain, snow, portal storms and non-temperature environment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Content "Generates wind direction and improves wind strength random-ness'"
Purpose of change
Currently Wind Strength is generated quite simply :
W = std::max( 0, 1020 - static_cast<int>( P ) );
Literally the difference between a number and the current pressure.
This produces some strange results.
I've also added wind direction generation based on real-life data from Boston and surrounding New England area for prevailing winds.
Nothing uses this yet, but sailboats, hot air balloons, sheltering from wind, aerodynamics etc could all potentially use this.
I've made use of data from websites like :
https://www.windfinder.com/windstatistics/boston_logan_airport
https://weatherspark.com/y/26197/Average-Weather-in-Boston-Massachusetts-United-States-Year-Round
Describe the solution
This is currently the wind strength measured per hour from the game code, in Winter.
It goes over 90mph... and it's very random, there is none of the continuity you would see from weather fronts.
After the change this is Winter wind speed per hour.
You can see there are peaks ( much lower - as per real data ) the seasonal averages match up quite well to real life seasonal averages measured per hour.
The peaks are indicative of generally windy days, they rise and subside, weakly correlated with air pressure in the area.
Conversely, in-game the daily ( per minute ) measurements had no noise to them, because they followed a pressure value,
Here is in-game day ( per minute )
after the change it is more like this :
you can see it is moving towards a new value , with noise, on the way.
The wind direction describes the direction it is blowing from and has a raw angle ( for converting to vectors for vehicles etc ) and a string that prints out from the weather reader CBM ( or for a GUI element )
the distribution has random-ness but a typical winter might look like this :
Throughout the year, the prevailing wind is West to East, though Easterly winds also are quite common, there are seasonal variations, but Northerly and Southerly winds are less common.
Describe alternatives you've considered
Tried many different things.
Additional context
As with my previous PRs, I'm using this as a C++ learning exercise, so I may have committed some cardinal sins. Apologies if so.
The weather test code currently uses a RNG to set the seed, I used the same seed for all tests however.
For comparison , here is the Summer wind graph - more dead-wind days, solar power would be better here instead of wind turbines!