Sun Position based on Time of Year

Hello, all! I am working on a game that is modeled after the real-life Northeast Corridor train line that connects New York City to Philadelphia (link can be found at the bottom). With the help of some colleagues here in the Forum, I have been able to connect my game to the real time of day in NYC when the server starts, then continues on a cycle (Eastern Time) and I even have the weather conditions in-game change based on information read from a weather API. Everything works amazingly and I am proud of the work I have put into this, but I feel like there is just a little extra that can be done to lighting to make this place even more life-like. During summer, the time of sunset is a lot later in real life than it is in game, as in Roblox the sun’s position based on time of day is during the equinox (12 hour day, 12 hour night).

As a developer constantly chasing realism when modeling a real setting, it would be really neat in Lighting to add a dropdown to select the time of year for your geographic game location so that, say, in the winter the length of time the sun is up is shorter than that of when its dark. And of course, using API I can get the exact day and after each day/night cycle in the server the date changes to the next, and I could hook this date up with the respective lighting property.

In conclusion, I see it possible for Roblox to accurately calculate the position of the sun given the latitude and the current date and therefore accurately simulate the time of sunrise and sunset. This would be great for us mega-realistic devs!
https://www.roblox.com/games/3011098455/Ro-Scale-Northeast-Corridor-Train-Simulator

32 Likes

Can confirm. I use a script that puts the time in-game the same as the time irl of that location (based on real life race-track locations) & I’d absolutely love it, if during these summer months, I didn’t have to try and account for the fact that the sun is not actually setting at 5 pm. I always felt it was weird that it lets us put in the Latitude but doesn’t seem to use that to calculate much of anything.
(Yes, I know it puts the sun in a specific sky position based on Latitude, but I have no clue what day that is position based on.)

8 Likes