How long does a stonehearth day last in real time?

Does any of you know what the exact real life time is of 24h in stonehearth time?

Thanks in advance!

It depends whether you play at normal / double / triple speed or not! :sweat_smile:

You might calculate how much does 1 hour in game last and multiply it by 24 (or 15min, and multiply by 4 * 24). The hour appears in a tooltip if you hover over the sun widget.

If it’s about the clocks stuff, you better use specific events like those in calendar_constants.json:

"event_times" : {
      "midnight" : 0,
      "sunrise" : 6,
      "midday" : 14,
      "sunset_start" : 20,
      "sunset" : 22
   }

Or trigger your own events using timers (I’m assuming you’re asking for this reason, if not, sorry for the misunderstanding :confounded:).

thnk for the reaction. no worries ^^
What i actually was looking for is the amount of frames that are used every hour in stonehearth.

I want to make a clock that runs on the correct time and for that i need the animation to fit the exact lenght of 12 stonehearth hours.

I did some testing with what the time could be on normal game speed but i got an very ugly number out of that with a steady rate.

I found that 1 second in real life on normal speed is about 109.5 stonehearth seconds. The numbers varied between 108.5 and 110 but the avrage of all test and most test in generla gave the number 109.5.

I indd found the time setup in the callender_constant.json when i was searching trough the files but i could not find any numer for the second real life/ second in game or a ratio for frames/seconds in game.

Will the player be able to tell the time easily? Will the minutes matter? If not, you can have multiple models for each hour, and swap them using hourly events.

1 Like

There’s

"ticks_per_second" : 9,

But yeah, it’s not the same every time, as you’ve observed.

But, if you’re adding a 12h animation, how will you sync that with the current hour? Players could place the clock at any time in the in-game day :thinking:

My coder is looking into how to work with lua script and create a trigger in which all clocks start there animation. I was thinking about 5:30 and 17:30 making it so that the clock will alway run on the correct time. The animation would not be looping and just start at those 2 times and basicly end 1 or 2 frames before it starts again.

But what deos 9 ticks a second mean. Cause i found it but could not figure out how to translate ticks into a usable time spawn for animation.

@BrunoSupremo Yes munites do matter in game. As i got the animation about right now and it is really nice to slowly see the minute arm go round. I have tought about chnaging model every hour but it looks so much better with an animation :smiley:

I have not looked into the code, but there’s already time-tracking implemented - days turns into night, which turns back into day, and so on. It should be possible to look for each hour using this; I don’t know about minutes though. (Looking back through the conversation, hourly evens is what Bruno and Relyss have already suggested)

Had it been me, I’d much rather base 12 model updates on the time of day, instead of making my own “internal clock” and pray the two clocks will not diverge. Keep in mind that if you base your time between updates on a counter, the two clocks will slowly but surely diverge.
The difference you’ve already observed is for your specific PC - the more load you put on your hearthlings (or increased population etc), the more in-game seconds might be required for each real-life second.

Perhaps what you want to do instead, is to implement an event that is based on the time-tracking that’s already implemented, and then use said event to update the model of your clock. Or something similar to this :slight_smile:

Well, you might be able to retrigger the animation using an event, about once a month, then any divergence that occurred can be reset without having to have 12 models.

(DISCLAIMER: i do not know how the events system works, so it might not be possible what I am suggesting.)

Was just thinking about a game systems when I thought back to this thread.

You can maybe (ab-)use the decay option used to let food spoil to change the model to one where one hour has passen. Look at the eggs for reference. There you can have references to where the new model .jsons are, you can use that to create a chain, (or in this case, a loop), and then you just let it run.