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

Adjust time approximations #58030

Merged
merged 3 commits into from
May 31, 2022
Merged

Adjust time approximations #58030

merged 3 commits into from
May 31, 2022

Conversation

Hirmuolio
Copy link
Contributor

@Hirmuolio Hirmuolio commented May 30, 2022

Summary

Interface "Adjust time approximations"

Purpose of change

The approximate time did not match with apparent time of day. Sunset and sunrise especially can move by several hours depending on time of year.

This led to confusing situations like it being "dead of night" at 04:20 while the sun is already up and it is fully bright.

It also seems like the original writer forgot about integer rounding on some of the times and they last one hour too late.

Fix: #58010

Describe the solution

Use mixture of clock times and sun angles to decide what time it is.

The new definitions can overlap sometimes. The one listed first in the table will be used.

Time Old New
Around midnight 23:00-01:59 23:00-01:00
Around dawn 06:00-06:59 Sun between -6° and -1° (in morning)
Around dusk 19:00-20:59 Sun between -6° and -1° (in evening)
Dead of night 02:00-05:59 01:01-03:59 and sun below -6°
Night 20:59-23:00 Sun is below -6°
Early morning 07:00-08:59 01:00-07:59
Morning 08:00-10:59 08:00-10:59
Around noon 11:00-13:59 11:00-12:59
Afternoon 13:00-16:59 13:00-16:59
Early evening 17:00-18:59 17:00-18:59
Evening - 19:00-20:59
Night 21:00-22:59, 06:00-06:59 (when nothing else matches) when nothing else matches

Earliest sunrise/latest sunset that currently can happen ingame is at around 04:00/19:30.
Latest sunrise/earliest sunset that currently can happen ingame is at around 07:00/16:00.
I think these will work decently fine for the current game location (Boston). Once modding or travel allows changing the game latitude we will need some handling for midnight sun and polar night. But those can't happen currently.

Also adjusted is_night() to define night to be below -6° instead of -12° and is_twilight() (and by proxy the is_dawn() and is_dusk() too) to be from -6° to -1° instead of -18 to -1°`.

Describe alternatives you've considered

The survivor does not care about social construct like "time of day". If they have no clock the time approximation could be just directly based on sun angle/light levels and ignore the actual time completely.

Survival skill could also make time approximations more accurate.

Testing

Changed time with debug menu and observed the correct time descriptions.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels May 30, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 30, 2022
@dseguin dseguin merged commit 262b7f4 into CleverRaven:master May 31, 2022
@Hirmuolio Hirmuolio deleted the time branch May 31, 2022 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full brightness outside in the middle of night
2 participants