Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Is there time within SE?

Discussion in 'General' started by SilentShadow, Feb 13, 2017.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. SilentShadow Apprentice Engineer

    Messages:
    286
    I know we can access and display the system time, but is there a time and date within SE that is accessible by scripts that is relative to the game's day/night cycle.

    For instance, when the sun is at its zero position, that would be 00:00. And time counts up for a few hours until the day is over. Then add one day to the date.

    I was curious to know if I missed this feature before I going to the suggestions forum.
     
  2. Cotcan Trainee Engineer

    Messages:
    21
    I don't know of one. I do know that Midspace's Admin Helper Tools has a command that lets you see where the sun should be at a specific time. It will show a 00:00:00 at where the sun starts at the start of the world. As well as say 03:54:23 when the sun has been rotating for that long since the it's start on the track. I don't know if it's the mod itself that is able to track or it just calculates that off of the total time it takes for the sun to do one rotation and finds what time it should be at a specific part in its track. This would be a nice feature though if it isn't already in game.
     
  3. russo_bolado Junior Engineer

    Messages:
    613
    Well... I believe this can be scripted. The only problem would be that this "day/night" cycle wouldn't actually match the hour pattern shown in display, since in SE the sun rotates in the universe, not the other way around. And days would be attached to the "sun rotation" configuration, or use the game creation day as a standard... But this is just a speculation.

    The code savants around the forums can answer your question based on the game's source code.
     
    • Agree Agree x 1
  4. Ronin1973 Master Engineer

    Messages:
    4,955
    Server time is the time/date of the machine. It should match whatever time the OS is reflecting. Timers work on this time as well.

    Server sim speed is the time reference of the game. A 1.0 represents the game working at approximately the same cycle as the server time. When server sim speed drops, the game slows down to match. So at 1.0 the day/night cycle of the default 120 minutes will be approximately 120 minutes. If the server sim speed drops to 0.50. Your day/night cycle will be approximately 240 minutes of real time.

    Timers set to "TriggerNow" will give you one click per cycle based on server sim speed. I believe there are 60 clicks per cycle. At 1.0 server sim speed there are 60 clicks a second. At 0.50 sim speed you're at 120 clicks a second. A 120 minute day/night cycle will be 7200 clicks approximately. I'm not sure if it's a true 7200 or very close. So you may have some drift every 2 hours.

    So the bottom line is that if you want accurate timing to the sun rotation you should base your timing off of game clicks rather than server time as the game is subject to slowdowns depending on what activity you or other players are up to that may dim server sim speed.

    You can also use a static solar panel and track its energy output. Once a day/night cycle it will give off a maximum amount of electrical output. You can reference this event as "noon" even if the sun isn't overhead. You can use this even to reset your clock to compensate for drift.
     
  5. SilentShadow Apprentice Engineer

    Messages:
    286
    Wow. That sounds like a lot of setup for what is basically a wall clock.
     
    • Like Like x 1
  6. SileniusFF Apprentice Engineer

    Messages:
    115
    IIRC Minecraft had some clock designs based on energy output of daylight sensors.
    Not sure how accurate they were.
     
  7. Burillo Junior Engineer

    Messages:
    648
    "time of day" would depend on where on the planet you are as well. if you're on the north pole, you're getting pretty much non-stop daylight, if you're in the south, there's just darkness.
     
  8. Renegrade Trainee Engineer

    Messages:
    40
    There's ElapsedTime.TotalSeconds , but it has some serious problems. There's a post about it here: https://www.forsomedefinition.com/space-engineers/scripting/understanding-elapsedtime/

    The assumes-constant-simspeed is the biggest problem. Simspeed is not constant, dammit.

    The sad thing is it would be trivially easy for Keen to implement an internal counter that maintained the in-game relative time. They'd just have to do a single ADD/FADD to a single variable at the end of every update tick, and let us peek at it.
     
  9. Burillo Junior Engineer

    Messages:
    648
    wasn't elapsed time fixed to follow sim speed?
     
  10. Malware Master Engineer

    Messages:
    9,861
    Partially, but it's imperfect. Another final (I hope) fix is pending but as you know, things like that are very low priority.
     
  11. Devon_v Senior Engineer

    Messages:
    1,602
    I would think what you'd need to get at is the variable that holds the sun's current angle. The length of a "day" in game is also effected by the Day Length slider, aside from being a function of simspeed.
     
Thread Status:
This last post in this thread was made more than 31 days old.