Draft
Conversation
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
* Test implementation of Wasp's sunset formula
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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)

Dusks/dawns are between 0.2 > sin(dayTime + pi/2) <-0.2.
Conversion between dayTime and 24h clock would be:
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.