Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upChanged windchill model [WIP] #9593
Conversation
This comment has been minimized.
This comment has been minimized.
|
I posted in mentioned thread, but I put it here too
I would prefer, if instead of showing felt temperature, UI showed real temperature, wind speed and humidity estimates (based on survival?) and having weather gadget to show precise values. Similar to like time and watches works. |
BevapDin
reviewed
Oct 18, 2014
| /// Source : http://en.wikipedia.org/wiki/Wind_chill#Australian_Apparent_Temperature | ||
| int windchill = (0.33 * ((humidity / 100.00) * 6.105 * exp((17.27 * Ctemperature)/(237.70 + Ctemperature))) - 0.70*tmpwind - 4.00); | ||
| // Source : http://en.wikipedia.org/wiki/Wind_chill#Australian_Apparent_Temperature | ||
| tmpwind = (float)(tmpwind*0.44704); // Convert to meters per second. |
This comment has been minimized.
This comment has been minimized.
BevapDin
Oct 18, 2014
Contributor
I get windchill of -1 up to 8 (temperature=23, humidity=86, windpower=0 or similar) during the first day.
The cast to float here is most likely not what you want, at least not needed (the involved values are already double).
Also the cast to int when return the value is not needed. The return value is per function declaration an int and is automatically convert to.
This comment has been minimized.
This comment has been minimized.
|
It might be reasonable to put wind/humidity/etc estimates somewhere, but not on the main interface, there simply isn't enough room. |
kevingranade
reviewed
Oct 18, 2014
| @@ -5448,6 +5448,11 @@ void game::draw_sidebar() | |||
| wprintz( w_location, col_temp, " %s", print_temperature( display_temp ).c_str()); | |||
| wrefresh(w_location); | |||
|
|
|||
| // Debug items | |||
This comment has been minimized.
This comment has been minimized.
kevingranade
Oct 18, 2014
Member
If this is going to stick around, I'd far rather it have an iuse method that outputs to the log when active or something.
The sidebar is already complicated enough without adding debug features to it.
This comment has been minimized.
This comment has been minimized.
|
While you're looking at this, is there anything that makes clothes block wind? |
This comment has been minimized.
This comment has been minimized.
|
Is it possible to have tooltip on UI elements? Like, if you hover on temperature showed in UI, it would show additional info like wind and humidity in tooltip? |
This comment has been minimized.
This comment has been minimized.
|
@BevapDin I will try that out and see what happens, thanks! @kevingranade I like your suggestion of having it display the information only when active; I'll likely do that. On the note about clothes that blocks wind : player::get_wind_resistance() does that; if you're wearing leather, plastic, bone, chitin or nomex you are blocking wind at 90%. Cotton is 70% and wool is 60%. Anything else is 99% effective. @Robik81 On the note of informing the player/UI, maybe I could add a warning message like "your is doing little to protect you from these high winds!" when the windchill is lowering temps by more than 10 degrees or something. Now that I've typed it out, I think I will do that. Thanks for checking it out gang! |
This comment has been minimized.
This comment has been minimized.
|
Interesting, I should have 90% protection then... I don't know how following was even possible, unless I was fine but showed temperature suggested that I will likely freeze to death. 2nd day of spring Maybe main problem isn't how weather system works but how it is interpreted by players, because UI is confusing? |
This comment has been minimized.
This comment has been minimized.
|
The number on the UI is as if the player is naked; it's what you would feel on your face. I agree that part of the problem is communicating to the player what is happening. That's why I opted for relative UI temp (because the survivor can't really infer the absolute air temperature), and I show absolute body temperature in a @ menu. Adding a warning message for wind chill will clear a lot of this up I think. |
This comment has been minimized.
This comment has been minimized.
|
I think if that is the case, temperature should be described as a word, because when it is specific number, like -19 °C everyone assumes it is precisely -19 °C, not that it feels like -19 °C Edit: especially if it is how he would feel if naked, not in his current clothing... |
This comment has been minimized.
This comment has been minimized.
|
@kevingranade thoughts on what Robik81 is saying? Shall I convert the number to words, as per most other things in the game? |
Shoes01
changed the title
Changed windchill model [CR]
Changed windchill model [WIP]
Oct 18, 2014
This comment has been minimized.
This comment has been minimized.
|
Sadly, the wonky windchill reading was due to me putting in the metric model, not the imperial :x I will look to move the pocket meteorologist to the iuse section. |
This comment has been minimized.
This comment has been minimized.
|
I also fixed going backwards in cars creating "negative wind" that warms the player up, as noted by a user in the forums! |
This comment has been minimized.
This comment has been minimized.
|
I think I'm with Robik81 here. Make it into words if at all possible, then maybe have a thermometer item (could probably include the function in some other things, like power armor helmets) that would switch it over to displaying the exact temperature. (Maybe have a similar thing for the wind, where it gives a wind speed indicator in words that can be converted over to an exact value with the proper item available. |
This comment has been minimized.
This comment has been minimized.
|
Yeah, remove the number altogether unless you've got the meterological debugger/CBM. The Comfortable/Chilly/etc suffices for felt. (Perhaps the Fancy Watch could include temp?) |
This comment has been minimized.
This comment has been minimized.
|
Yea I'd prefer that, plus reporting the 'worst' temperature felt rather |
This comment has been minimized.
This comment has been minimized.
|
Okay this got a little complicated fast ;p
In my mind, all of the items listed in 2) would simply print data in the log the way my debug item does now, not display temperature on the UI. However, should the temperature be displayed on the UI when you're in a car, or power helmet, or other "display" items? |
This comment has been minimized.
This comment has been minimized.
|
Printing to the UI gets spammy if it happens regularly. Better to have the temp show in the UI. Barometer and hygrometer might be check-on-demand and print to the UI. |
This comment has been minimized.
This comment has been minimized.
|
Power helmets display temp, so does the new "digital watch" item. Are there any other items you can think of that should display the temp on the UI? I am going to make the rest of the items check-on-demand style. I also don't play on having items display humidity or windspeed or windchill or any of that on the UI. |
This comment has been minimized.
This comment has been minimized.
|
Internal chronometer CBM ? |
KA101
reviewed
Oct 19, 2014
View changes
| "volume" : 1, | ||
| "material_thickness" : 0, | ||
| "storage" : 0, | ||
| "description" : "A simple digital wristwatch on a plastic band. Tells the time, has an alarm clock feature and displays the air temperature.", |
This comment has been minimized.
This comment has been minimized.
KA101
Oct 19, 2014
Contributor
I presumed the wristwatch was digital thanks to the alarm clock. Mechanical watches generally lack that feature. Reason I suggested the Fancy Watch get a thermometer is that it seemed like the sort of thing that would have all sorts of whacked-out indicators. IMO, no need for a new item here.
This comment has been minimized.
This comment has been minimized.
|
I don't think anything should stick actual weather readings on the UI, if you need an exact readings, trigger the item to have it output readings to the log. Temperature is arguable, but at that point, don't we actually lose the "are you comfortable" reading? |
This comment has been minimized.
This comment has been minimized.
|
Sounds good, in that case I will remove the digi watch, and make the power helmet read out data the same way the CBM will. The watch will also read out data, but only temperature. I will make a generic function to do that. Also the "Comfortable (Falling!!)" stuff is always present. It has it's own line on the UI (I snagged that real estate last year!), and the actual temperature display is on the same line as weather. I would post a screenshot, but I am at work! |
Shoes01
force-pushed the
Shoes01:windchill-change
branch
to
3b9664e
Oct 22, 2014
This comment has been minimized.
This comment has been minimized.
|
I rewrote the history of the commits to remove the digi watch, that saved me time. I've added the code that allows the CBM to read the weather; I am not very creative when it comes to that stuff, so it's pretty bland. I would appreciate suggestion of things that would add a little flair to the CBM. This CBM is mostly my proof of concept. I mentioned writing generic functions to read the weather, but it's probably not worth it. Plus, each item might have it's own string. Fancy watch only reading temperature, basic power helmet not reading windchill, etc. Let me know if this is not the way to proceed! Like I said, I will allow the player to 'a'ctivate certain items (watch, helmets, new items specific to reading weather) to get a read on the weather. Here is a screenshot of what the CBM prints out : http://i.imgur.com/NV70Fe9.png Walking around a bit, I notice that my "warning, you are not wearing enough wind resistance" prompts are spammy and weird; I need to add a body part to the description, without it the warnings sound contradictory. |
This comment has been minimized.
This comment has been minimized.
|
I love the CBM idea. |
This comment has been minimized.
This comment has been minimized.
|
i like the CBM output too. one nit: i have seldom seen wind measured in km/h (though i don't know what they do in other parts of the world) would it be possible to add an option in options menu for selecting between km/h, m/s, or Beaufort? tbh, i'd just be ok with km/h as long as the Beaufort reading is also shown. |
This comment has been minimized.
This comment has been minimized.
|
I'd really prefer not to have an option for something so specific. |
This comment has been minimized.
This comment has been minimized.
|
I can easily make the km/h option read m/s for wind, if that's preferred. I hear m/s in science, but I hear km/h in weather forecasters more often. |
This comment has been minimized.
This comment has been minimized.
|
as i said, since we live in different parts of the world, our experiences are bound to be different. |
This comment has been minimized.
This comment has been minimized.
|
I'd prefer m/s and Beaufort. |
This comment has been minimized.
This comment has been minimized.
|
Russia votes for "m/s" (and yes, I'm responsible for whole country, sorry, Vitaly:). |
This comment has been minimized.
This comment has been minimized.
|
@illi-kun Nice :) |
This comment has been minimized.
This comment has been minimized.
|
Bar or Pascal are fine by me for pressure. |
This comment has been minimized.
This comment has been minimized.
|
I don't care what the units are, I just want them to be either:
|
Shoes01
added some commits
Oct 27, 2014
This comment has been minimized.
This comment has been minimized.
|
Eh, running into undefined references with my print_* functions, despite them being almost identical to print_temperature... anyone able to offer some insight? |
This comment has been minimized.
This comment has been minimized.
|
Declaration: Same with the other two functions. "being almost identical" is not enough. You declare one function (with 1. parameter being a float), than you declare and define another function of the same name but with an int as 1. parameter. Those are two different function. The first function is used by your code because you call it with a float as parameter. But you never implement that function, so the linked complains that it can not find that function. |
This comment has been minimized.
This comment has been minimized.
|
Thanks! I knew it was something simple, but man those are the hardest to find. |
Shoes01 commentedOct 18, 2014
I've decided to change the windchill model based on this forum post : http://smf.cataclysmdda.com/index.php?topic=8002.msg184741#msg184741
There is a bug in my code that I am blind to : windchill always turns "1" ??? I don't understand why. Hoping someone with C++ experience could point it out.
This PR also adds a debug item, the pocket meteorologist, which simply messages the player the absolute temp, pressure and humidity. Once the windchill=1 bug is fixed, I can remove the item if necessary.