Uploaded November 2026 | Updated December 2026, 3 hours ago
#sonic #sonicthehedgehog #cutcontent
Yes, this is actually the code from the day night system they used in the TGS 2005 demo. Turns out the time of day was intended to persist between stages in a play session, always starting from Hour 6 when you boot the game (which roughly aligns with where Sonic's story would begin post-festival).
A couple years back I mentioned it was still in the game's executable but heavily broken. In the time since then, we've had some different takes on the Day/Night system (including a DLL implementation by Rei), but the other day Hyper went digging into it, and it turns out it's pretty much all still in the code, we just didn't know the right syntax to use it.
The game has a method called LoadTimeLight which reads a TimeLightTable from Lua. This table is meant to be an array with some data structs in it specifying time, sun color, BRay, BMie, G, Main light, Ambient light, Sublight, and Bloom information. The code will interpolate the correct lighting, sun position, etc. from the provided structs, going from hour 0 to 23. Unfortunately, the Main/Ambient/Sub light and sun position usually get overwritten immediately by the SceneParameter, so this will need _some_ custom code eventually, but for the time being I can work around it in Lua.
Beyond that, there are two related components in the code, though the most notable is the KhronoController. This has its input listener stubbed (which is likely how they manually advanced time in TGS 05), but otherwise it appears to function fine, provided you request a time of day update each frame. This allows you to modify the rate time progresses as well as set the number of seconds in a "day", among other things. For this video, I set the day length to 2 minutes.
It's worth noting that this would still take a fair bit of work to implement everywhere as you do have to construct TimeLightTables for each stage, and some object shaders need adjusting, but for this video I used a simple helper to auto-generate the TimeLight entries from the base SceneParameter file to get a proof of concept going.
Song: Mimi's Delivery Service (LoFi) - Good Kid
#sonic #sonicthehedgehog #cutcontent
Yes, this is actually the code from the day night system they used in the TGS 2005 demo. Turns out the time of day was intended to persist between stages in a play session, always starting from Hour 6 when you boot the game (which roughly aligns with where Sonic's story would begin post-festival).
A couple years back I mentioned it was still in the game's executable but heavily broken. In the time since then, we've had some different takes on the Day/Night system (including a DLL implementation by Rei), but the other day Hyper went digging into it, and it turns out it's pretty much all still in the code, we just didn't know the right syntax to use it.
The game has a method called LoadTimeLight which reads a TimeLightTable from Lua. This table is meant to be an array with some data structs in it specifying time, sun color, BRay, BMie, G, Main light, Ambient light, Sublight, and Bloom information. The code will interpolate the correct lighting, sun position, etc. from the provided structs, going from hour 0 to 23. Unfortunately, the Main/Ambient/Sub light and sun position usually get overwritten immediately by the SceneParameter, so this will need _some_ custom code eventually, but for the time being I can work around it in Lua.
Beyond that, there are two related components in the code, though the most notable is the KhronoController. This has its input listener stubbed (which is likely how they manually advanced time in TGS 05), but otherwise it appears to function fine, provided you request a time of day update each frame. This allows you to modify the rate time progresses as well as set the number of seconds in a "day", among other things. For this video, I set the day length to 2 minutes.
It's worth noting that this would still take a fair bit of work to implement everywhere as you do have to construct TimeLightTables for each stage, and some object shaders need adjusting, but for this video I used a simple helper to auto-generate the TimeLight entries from the base SceneParameter file to get a proof of concept going.
Song: Mimi's Delivery Service (LoFi) - Good Kid










