Kopernicus / Kronometer

A mod to manipulate the clock for Kerbal Space Program
MIT License
7 stars 5 forks source link

[Wiki] offsetTime - what's the unit, exactly? #19

Open ratemisia opened 2 months ago

ratemisia commented 2 months ago

Hello, I'm writing Kronometer configs for myself, and have been struggling to find information on some of the details. I'm not sure if Sigma or @linuxgurugamer or perhaps someone else is maintaining the Readme these days - I understand Linuxgurugamer has almost countless other mods to maintain - but I and perhaps some others would benefit from some more information on the offsetTime value. I'd be happy to hear from anyone who's more familiar with Unity and Kerbal time than I am on this.

I understand that offsetTime directly changes the displayed time based on KSP's "epoch" time (the number that can be seen in save files, which directly indicates the time since the save was started as a double, if I understand correctly) and before time is broken up into years, months, days. It also appears to be the only way to get offset precision of less than one day, as the other offsets are all integers.

Say I want days to start at midnight, and not in the morning, as they do by default. Is there information out there on what numerical value to put in offsetTime to offset the time by so many hours? Is there perhaps a smarter way to do that that doesn't involve offsetTime? Would giving such information be impractical (depends on latitude, time of year, etc)?

Sigma88 commented 2 months ago

going by memory, I'd say offset is in seconds (so 1.0 offset would be one second)

this is used to change only the displayed time in game rather than changing the position of the sun, I thought the game clock started at 00:00 otherwise if it starts at a different time (eg. 2:00 am) you should add or remove seconds in order to get 00:00 at the start,

so if it starts at 2:00 am (which is 2h away from midnight, you should offset by -2h = -7200 s)