Author Topic: Date and time in PS  (Read 2137 times)

Idoru

  • Hydlaa Notable
  • *
  • Posts: 981
    • View Profile
Re: Date and time in PS
« Reply #15 on: November 08, 2006, 01:23:58 am »
I would have thought it easy to just connect to a time server every crash and find out what the RW time and date was then run a rather simple calculation to convert it to 30 days and 10 months from a specific 'time zero' set on the server. then agan Im not a programmer making a PC game lol

"May there only be peaceful and cheerful Earth Days to come for our beautiful Spaceship Earth as it continues to spin and circle in frigid space with its warm and fragile cargo of animate life."

eldoth_terevan

  • Hydlaa Notable
  • *
  • Posts: 512
    • View Profile
Re: Date and time in PS
« Reply #16 on: November 08, 2006, 05:39:50 pm »
It would seem to be so, Idoru. That is why I asked... but there must be another consideration here, I think.

bilbous

  • Guest
Re: Date and time in PS
« Reply #17 on: November 08, 2006, 05:54:44 pm »
Why not just have a file that gets incremented every minute or so that could be read on startup and the ingame time/date could be calculated by this nunber difference from 0. If for instance the server was running on linux you could add an instruction to append a character to the file (echo . > time.date, I think it would be. ) Then on startup you parse the file, count the characters and that would be your differential. You could also in the parsing routine create another file that indicates the overall difference at time of parsing and just keep track of the number of ticks between server reboots. Obviously this could be refined to match coding requirements but this night be one way to do it.

eldoth_terevan

  • Hydlaa Notable
  • *
  • Posts: 512
    • View Profile
Re: Date and time in PS
« Reply #18 on: November 08, 2006, 06:18:43 pm »
How does one keep track of the number of ticks between server reboots without another server? I think, of course, that your description is somewhat like they are trying to implement it, Bilbous. Of course, since it probably counts on using the date and time in some manner to do all this tracking, a lot of cycles could be saved by calculating the PS date based on RL date. Which is why I was wondering why that wouldn't work...
« Last Edit: November 08, 2006, 06:24:29 pm by eldoth_terevan »

bilbous

  • Guest
Re: Date and time in PS
« Reply #19 on: November 08, 2006, 06:38:17 pm »
Well to me, time only passes while the game is running. Therefor while the server is down no ingame time passes. If you are talking about while the game is running most programming languages have means of determining duration be it counting clock cycles or whatever. All that I have proposed is that every specified duration, specific file is appended. It need not remain open between writes. Now this may have performance issues, that is a different story. It might be that everytime the PS clock changes hour (as currently displayed) might be an appropriate time to append said file.

I guess that does not directly address your question so I must say I don't know.

eldoth_terevan

  • Hydlaa Notable
  • *
  • Posts: 512
    • View Profile
Re: Date and time in PS
« Reply #20 on: November 08, 2006, 06:55:51 pm »
Correct, Bilbous. But there is no way to tell how much time has passed when the server isn't running. And that appears to be the problem... Heck, I don't know exactly either...

Idoru

  • Hydlaa Notable
  • *
  • Posts: 981
    • View Profile
Re: Date and time in PS
« Reply #21 on: November 08, 2006, 07:14:19 pm »
now I think about it the use of a time server is not necessary, I was just being stupid, obviously the time could just come from the server itself, just because its rebooting and the server software crashes doesnt mean that the servers clock would be out of sync with RW time  :-[

"May there only be peaceful and cheerful Earth Days to come for our beautiful Spaceship Earth as it continues to spin and circle in frigid space with its warm and fragile cargo of animate life."

bilbous

  • Guest
Re: Date and time in PS
« Reply #22 on: November 08, 2006, 07:23:30 pm »
I don't really understand why you would want ingame time to pass when the server was not running. How would it be better in a RP context to lose x number of hours to account for the time the server is off-line than to have the time reset to 12:00? I would think you would want the clock to return to as close to the ingame time before the crash.  You may end up living through and hour a second time but that would be preferable to losing an hour or more of ingame time, to me anyway.

Einnol

  • Hydlaa Citizen
  • *
  • Posts: 241
    • View Profile
    • Plakkem Hverrjanor Guild
Re: Date and time in PS
« Reply #23 on: November 08, 2006, 10:07:50 pm »
Wouldn't the simplest solution just be to store values for year, month, day, and time in the database?  The same process that increments the time by one hour could update the information in the database.  During the server boot, it could set those variables based on the information in the database.  I agree with bilbous.  If the server is down for a week, there is really no need for time to pass in-game.  Our characters are basically 'frozen in time' at that point anyway.

acraig

  • Administrator
  • Veteran
  • *
  • Posts: 1562
    • View Profile
Re: Date and time in PS
« Reply #24 on: November 08, 2006, 10:09:35 pm »
I don't really understand why you would want ingame time to pass when the server was not running. How would it be better in a RP context to lose x number of hours to account for the time the server is off-line than to have the time reset to 12:00? I would think you would want the clock to return to as close to the ingame time before the crash.  You may end up living through and hour a second time but that would be preferable to losing an hour or more of ingame time, to me anyway.

Yes, right now whenever the server restarts it will reset the time ( and day ) back to the start of time.  What I think might be a suitable solution is to place a periodic save time to database event.  This would store the time/date in the database and can be loaded on startup.   Thus you might repeat some periods of time but it will not be very much.  
----------
Andrew
"For all I know, she's lying, everyone's lying; welcome to the Internet"

eldoth_terevan

  • Hydlaa Notable
  • *
  • Posts: 512
    • View Profile
Re: Date and time in PS
« Reply #25 on: November 08, 2006, 10:23:21 pm »
Sounds like a better solution. Thank you. Right, no reason for time to be tracked if the server was down.
« Last Edit: November 08, 2006, 10:28:52 pm by eldoth_terevan »

Idoru

  • Hydlaa Notable
  • *
  • Posts: 981
    • View Profile
Re: Date and time in PS
« Reply #26 on: November 08, 2006, 11:01:00 pm »
true, I suppose it would be hard to RP 'ohhh, we were all knocked out.... that was one hell of a party' ;D

"May there only be peaceful and cheerful Earth Days to come for our beautiful Spaceship Earth as it continues to spin and circle in frigid space with its warm and fragile cargo of animate life."

Nikodemus

  • Prospects
  • Veteran
  • *
  • Posts: 1808
    • View Profile
Re: Date and time in PS
« Reply #27 on: November 08, 2006, 11:26:23 pm »
I don't really understand why you would want ingame time to pass when the server was not running. How would it be better in a RP context to lose x number of hours to account for the time the server is off-line than to have the time reset to 12:00? I would think you would want the clock to return to as close to the ingame time before the crash.  You may end up living through and hour a second time but that would be preferable to losing an hour or more of ingame time, to me anyway.

Yes, right now whenever the server restarts it will reset the time ( and day ) back to the start of time.  What I think might be a suitable solution is to place a periodic save time to database event.  This would store the time/date in the database and can be loaded on startup.   Thus you might repeat some periods of time but it will not be very much. 

Or you can try with the real world clock with proper conversion rate (as suggested), but in this case there would have to be some time zero from which on the time is counted all the time... what make me think that log file is much better, coz there will be less counting. I could have missed this somewhere in discussion, i didn't read every single post.
So yeah, with real world clock based date we would only loose the time the server is down, not repeat the same time as in case of logs.
hm



What you can failure tommorow, failure today.


Better click for shiny stylez Help me with images!

Srenkarth

  • Traveller
  • *
  • Posts: 26
    • View Profile
Re: Date and time in PS
« Reply #28 on: November 10, 2006, 09:39:08 pm »
Reguardless of how it was handled, an in-game calander would be extremely useful. You could plan specific events at a certain time or date. Like a certain person who only shows up during a specific time of the month or something.
You could also celebrate your birthday, since you would then know when it was.   O--)