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

YSCE Day/Night cycle #77

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

YSCE Day/Night cycle #77

wants to merge 8 commits into from

Conversation

Skipper-is
Copy link

Implementation of day/night cycle.

Day/Night cycle is measured on a scale of 2 pi. 0 is mid-day, Pi is mid-night, and 2pi is mid-day the next day (resets back to 0)
image

Dusks/dawns are between 0.2 > sin(dayTime + pi/2) <-0.2.

Conversion between dayTime and 24h clock would be:

  • For times up to midnight (pi) = dayTime / (2Pi/24)+12
  • For times after midnight (>pi) = dayTime/(2Pi/24)-12

Will implement a method for conversion

For net code:
Combined with the cloud layers config stuff I was working on before with the sending of the day/night cycle.

Cloud layers set in the config settings window now follow through into multiplayer, and will be sent to clients.

Clients are only sent the new stuff if they're running YSCE too. There is a check on the login process to see whether the client is using YSCE, and if so, that info is stored for any other future netcode changes that may need a YSCE switch.

Currently the day/night cycle doesn't re-send the day/night time when it changes. This needs adding, but in a sensible way that doesn't resend it every tick...

On login, the day length is sent to the client, along with the current position in the day/night cycle, so the client is able to keep track of it their side. It will resend when the day/night switch occurs, but it doesn't yet.

Todo:
* Add in config menu options for cycle length
* Currently set to 60 minutes.
* Review shading during night time, as ground seems
lighter than the aircraft
* Config menu options for cycle length and start time
* Netcode for sending time updates, and day/night switch to keep classic
up to date
* Function to convert YS pi time to hours/mins/secs
* Day/night switch no longer making clouds flash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant