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

Viewing sky/weather over player position #27947

Merged
merged 6 commits into from Mar 9, 2019

Conversation

Projects
None yet
@int-ua
Copy link
Contributor

commented Jan 28, 2019

Summary

SUMMARY: Features "Ability to view weather around player position"

Purpose of change

Give player a chance to see sky/weather overhead for trying to predict weather changes and act accordingly.

Describe the solution

Added new action "Look at the sky" that displays weather map limited to line of sight with double visibility. Currently it's under "Look..." in actions menu (Enter).
Overmap weather glyphs and colors changed (see screenshot below).
Debug weather and this view is limited to z 10 only.

Describe alternatives you've considered

Describing weather overhead by text. Requires a lot of code and text to cover a wide area.

Additional context

Along with the benefit in itself this feature will allow adding usable and realistic ability to sun-dry some food.
Requesting comments on:

  • Do you see any problems in CPP code or with the changes in general?
  • Any suggestions on how to add a legend?
  • Should weather representation be changed? On this map only or along with debug weather map?
  • Where is the best place to store sight_points for viewing sky? It's currently hardcoded, but it's just a PoC. Is 20 a good value?

Current state of viewing debug weather (types captioned after making the screenshot):
third_weather_colors_

and player-visible part (usual overmap sight points doubled)
screenshot_20190130_202716

@int-ua int-ua changed the title [CR][WIP] Viewing sky over player position [CR][WIP] Viewing sky/weather over player position Jan 28, 2019

@Hirmuolio

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2019

The other weather related things should probably be also visible in the same window. Even if they are in the normal side bar I think they should also be in the "sky" window. Temperature, humidity, pressure and win.

@davidpwbrown

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2019

I really need to add debug menu stuff for wind, once I get my head around the debug options.
Currently, the weather overlay dosn't show any wind stuff, it really should.
having a dedicated "weather view" may mean some weather elements could be removed from UI , yeah.
But first I'd need to find a way to intertwine weather_type which has set types "sunny, cloudy, rainy" with the wind stuff.

@davidpwbrown

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2019

wrt to sight range of viewing sky, the weather types themselves have various visibility modifiers.

weather_datum {
                translate_marker( "Snowstorm" ), c_white, 6, 1.2f, -30, 6, false,
                &weather_effect::snowstorm
            }

^^ 1.2f is the sight range reduction for the player.

This could change the sight range of looking at the sky for surrounding weather.
I.e if your in a snowstorm you can't see if the snowstorm is present over that hill.

@KITbutler

This comment has been minimized.

Copy link

commented Jan 28, 2019

Can that screen print special symbols, such as arrows representing wind direction? A regular human should be able to tell the wind on their own tile as well as get the direction (but very inaccurate speed) of any nearby clouds moving above.

The weather reader bionic wouldn't realistically add much on this scale, the most I would expect is a LIDAR/laser scattering system capable of detecting rainfall and the "exact" speed of clouds. Printing humidity, pressure, air temperature, depth-penetrating scans of storms etc. would require standing still for proper calibration followed by a lengthy analysis. If you even have the multi-wavelength tools to do it in the first place that is, a proper weather radar is beyond our ability to carry or power.

No idea regarding the coding but the sidebar in your screenshot has plenty of space for all weather info we could conceivably have access to. If that is too hardcoded maybe you can make an overlay similar to the (f)ire or "look around"/mouse cursor panel?

@hyper2snyper

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2019

You can make it so the higher survival skill you have the more specific the map gets. So at a survival skill of zero you can only tell dark clouds, and light ones apart. Whereas the higher your skill becomes the better you can differentiate what clouds do what.

Perhaps different equipment will reveal more about the map.

@Amneiger

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2019

I like the idea of higher survival skill getting you better information. I've been hoping for a while that we could get a function that will let us look at the sky and take a stab at guessing what the day's weather might be like; maybe that can be implemented as part of this screen, with sentences like this:

Low survival skill: "Looks cloudy."

Medium survival skill: "You think it might rain today."

High survival skill: "It's probably going to rain around noon for a few hours."

There should be a chance for the guess to be wrong, with higher survival skill meaning better accuracy. Other folks have suggested that having specific equipment will help with weather predictions, which might be required to get a weather estimate with the confidence and granularity of pre-Cataclysm forecasts.

As you've pointed out, that would be pretty complicated though, especially the high survival skill one, since it needs the game to calculate weather in advance.

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2019

Temperature, humidity, pressure and wind.

But first three only with tools, of course.

intertwine weather_type which has set types "sunny, cloudy, rainy" with the wind stuff

Sounds relatively hard to do.
Did you also mean that wind direction should affect clouds movement? Since wind direction near ground not always represents wind direction near clouds it might be not necessary.

On showing wind direction. I kind of like the idea of an arrow with pluses even on this screen because player have a way to measure wind speed directly only in one point. But maybe there is a better way that wasn't described yet. Cloud movement can be seen by waiting and looking at the sky again. Yes, in reality you can estimate cloud speed almost instantly if they have it above some threshold but I'm not sure if such thing as cloud movement direction is even present in current implementation. I just skimmed through weather_generator::get_weather and it looks like in place of time it's just using seed value, do I understand it correctly?

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2019

On predicting weather in UI: that is a good idea, of course, but I'll limit this PR to viewing current state. It's already hard for me as it is, sorry. Maybe someone else wants to add prediction?

Show resolved Hide resolved src/handle_action.cpp Outdated
Show resolved Hide resolved src/handle_action.cpp Outdated
@KITbutler

This comment has been minimized.

Copy link

commented Jan 29, 2019

On showing wind direction. I kind of like the idea of an arrow with pluses even on this screen because player have a way to measure wind speed directly only in one point. But maybe there is a better way that wasn't described yet. Cloud movement can be seen by waiting and looking at the sky again. Yes, in reality you can estimate cloud speed almost instantly if they have it above some threshold but I'm not sure if such thing as cloud movement direction is even present in current implementation.

My idea was to display the local wind direction on cloud tiles, perhaps with a more stringent range limit than the overall map. The idea being that you can tell with your bare eyes which direction the clouds seem to be moving in at least once they reach a certain speed (i.e. low wind speeds would render as "stationary") even if you can't get a reasonable estimate of said speed.

With a weather reader bionic or a portable device you could point it at a specific cloud tile (only clouds and rain/snowfall!) and use RADAR/LIDAR techniques to estimate the movement speed of said clouds, either as an "activity" with a time cost or "for free" as a sidebar display similar to how the overmap displays the location name of the currently selected tile.

Since wind direction near ground not always represents wind direction near clouds it might be not necessary.

True, but do we have any underlying code which consistently models a two-layer atmosphere? The surface wind has to be powered by something and the rainclouds are also moved by wind so making it a single self-consistent layer would at least be a good first step for improvement otherwise. Adding RNG to readouts or expanding to a proper two-layer model can be done later if it is deemed worth the effort.

Full weather maps probably would require a network of actual weather stations, in particular the high/low-pressure regions commonly used to display wind directions would be almost impossible to construct from a single location. On the flip side simple fluid tube thermometers and barometers should be almost trivial to craft and can be calibrated using water (freezing+boiling for the thermometer, see Celsius scale) and some basic math.

Moved weather glyphs to weather_datum.glyph and changed them, replace…
…d get_weather_glyph with get_weather_at_point, added showing weather name
@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2019

Changed some weather glyphs:

both sunny and clear (kind of struggle to make a distinction visible, any ideas?)
. clouds without precipitation (cloudy)
o some precipitation (drizzle, flurries)
8 precipitation (rain, snowing)
% storms

screenshot_20190129_111258

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2019

display the local wind direction on cloud tiles

Unfortunately, that's two pieces of information and we have only one symbol to display weather on one overmap tile. Can you please draw how you see it over my screenshot in the previous comment?

@int-ua int-ua changed the title [CR][WIP] Viewing sky/weather over player position [WIP] Viewing sky/weather over player position Jan 29, 2019

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2019

weather types themselves have various visibility modifiers

I've changed visibility to be just double of usual sight points. Is it ok? these visibility modifiers do not affect sight points for overmap in any way at the moment.

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2019

I'd like this to be merged in current state of features (plus fixing any problems in case they are present) and move implementation of all the other suggestions to different PRs. What do you think about that?

@int-ua int-ua changed the title [WIP] Viewing sky/weather over player position Viewing sky/weather over player position Jan 29, 2019

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jan 29, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/wip-looking-at-the-sky-around-player-position/18594/1

1 similar comment
@kevingranade

This comment has been minimized.

Copy link
Member

commented Jan 29, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/wip-looking-at-the-sky-around-player-position/18594/1

@davidpwbrown

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2019

Temperature, humidity, pressure and wind.

But first three only with tools, of course.

intertwine weather_type which has set types "sunny, cloudy, rainy" with the wind stuff

Sounds relatively hard to do.
Did you also mean that wind direction should affect clouds movement? Since wind direction near ground not always represents wind direction near clouds it might be not necessary.

On showing wind direction. I kind of like the idea of an arrow with pluses even on this screen because player have a way to measure wind speed directly only in one point. But maybe there is a better way that wasn't described yet. Cloud movement can be seen by waiting and looking at the sky again. Yes, in reality you can estimate cloud speed almost instantly if they have it above some threshold but I'm not sure if such thing as cloud movement direction is even present in current implementation. I just skimmed through weather_generator::get_weather and it looks like in place of time it's just using seed value, do I understand it correctly?

Nah I just meant that there is already a nice neat weather_type that loads of other functions can call and the debug weather view can show ( as above ) , "SUNNY/CLOUDY/SNOW" etc but then wind is kinda tacked on as another thing, it'd just be neater and less confusing to have one place where you can ask the code
"what is the weather here?"
and get the conditions for wind and sun and rain and everything in one go.
It would make this visualizer you are doing a bit simpler also.
It would also make debug modifying the weather/wind much easier.

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2019

get the conditions for wind and sun and rain and everything in one go.

So you want to add a new function that will return everything for a given overmap point? That sounds great. I've looked into weather_datum.sight_penalty usage and looks like it doesn't affect overmap visibility in current state. Should it?

@davidpwbrown

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2019

As far as I can see it just effects player sight range for monsters and stuff - you can see on the minimap if you debug change weather, the visible circle shrinks.
But you could use it as a variable/guide to reference range in your map.
It probably should affect overmap visibility, I'll add that to my list.

@kevingranade kevingranade added 0.D Freeze and removed 0.D Freeze labels Jan 29, 2019

@Bidiguilo

This comment has been minimized.

Copy link

commented Jan 30, 2019

gosh my eye hurts after going full screen in that one photo lol

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 30, 2019

my eye hurts

You are not the first to say this and I'm starting to worry. Will changing colors be enough? Any other suggestions?

I'm trying to change background color.

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 30, 2019

src/color.* look horrible. Not saying I have any idea on how to make it better and maybe that was unavoidable but it's a hell when trying to figure out how to put arbitrary color (one of 16 supported, not something new) on both background and foreground.

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 30, 2019

New colors (text for weather types added over screenshot, not featured in-game):
second_weather_colors

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 30, 2019

Should be easier to quickly distinguish weather with high DPI:
third_weather_colors_

@Bidiguilo

This comment has been minimized.

Copy link

commented Jan 30, 2019

Now that is great! This will be a great addition to my game and i will now know when to roam around with my solar car when it is not going to rain all day. But i think that the thunderstorm is blending in with the rain too.

@Achie72

This comment has been minimized.

Copy link

commented Jan 30, 2019

Why not use a color scheme that is used already, and helps to differentiate more easily?
for example: https://www.rainviewer.com/ has some pretty cool color scheme in hwich you can tell in a blink what's going on.

@Amneiger

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2019

That does look good. I don't see a legend; you might want to see if you can add one, to help people who aren't familiar with the map yet.

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 31, 2019

i will now know when to roam around with my solar car when it is not going to rain all day

Just like in reality you can't be sure about how exactly weather is going to change. I've run some tests and the part you see gives you only several hours estimation.

thunderstorm is blending in with the rain too

Agreed, I'll try to improve that.

Why not use a color scheme that is used already

Don't forget that this game is playable in text mode without tiles and color selection is extremely limited there. Check the Color manager in game. I've verified that this map is working as expected in Linux terminal but I've seen something about some Windows text mode having extreme shortage of colors - just 8. Can someone confirm that map is usable there please?

I don't see a legend

Code in this PR is just an addition to the general overmap code. If this feature is accepted into the game it may be feasible moving this into a separate view and that would allow more freedom. But for now it's showing what weather is under the pointer just like with features on usual overmap view.

@int-ua

This comment has been minimized.

Copy link
Contributor Author

commented Jan 31, 2019

New rain color:
screenshot_20190131_094814

@Achie72

This comment has been minimized.

Copy link

commented Jan 31, 2019

Don't forget that this game is playable in text mode without tiles and color selection is extremely limited there. Check the Color manager in game. I've verified that this map is working as expected in Linux terminal but I've seen something about some Windows text mode having extreme shortage of colors - just 8. Can someone confirm that map is usable there please?

Sorry, i'm not really familiar with the code yet, just trying to start learning the code in a few days.
This new colors look better imo. Still a bit hard to differentiate, but over time it's learnable. Definitely more clearer than the previous one.

@davidpwbrown

This comment has been minimized.

Copy link
Contributor

commented Feb 5, 2019

this woudl work well with a revival of #27215

@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 9, 2019

Summary suggestion:
SUMMARY: Features "Take a look to the sky just before you die"
: D

@kevingranade kevingranade merged commit 5c1ee3f into CleverRaven:master Mar 9, 2019

2 of 3 checks passed

gorgon-ghprb Build triggered for original commit.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 10, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/wip-looking-at-the-sky-around-player-position/18594/1

3 similar comments
@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 10, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/wip-looking-at-the-sky-around-player-position/18594/1

@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 10, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/wip-looking-at-the-sky-around-player-position/18594/1

@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 10, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/wip-looking-at-the-sky-around-player-position/18594/1

@int-ua int-ua deleted the int-ua:look-at-the-sky branch Mar 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.