The International Simutrans Forum

Development => Extension Requests => Topic started by: Yona-TYT on September 17, 2016, 01:22:37 PM

Title: Real date for chat messages.
Post by: Yona-TYT on September 17, 2016, 01:22:37 PM

Why not show the real date or maybe both?. Because the date of the game does not give much accuracy in my humble opinion.

Title: Re: Real date for chat messages.
Post by: Ters on September 17, 2016, 02:37:15 PM
Probably because Simutrans has no clue what the real date is (not that it is hard for it to find out). And I think chat messages are just messages, and messages in Simutrans in general are tied to events happening in the game, where in-game dates make more sense than the real-world time.
Title: Re: Real date for chat messages.
Post by: Yona-TYT on September 17, 2016, 02:44:52 PM
Maybe show how long ago was written, can also be useful.
Title: Re: Real date for chat messages.
Post by: DrSuperGood on September 17, 2016, 04:29:34 PM
Because real time is a real pain? You could have messages posted from the future or at times that never existed if one is not careful!

One could tag every message with an approximate unix style time and then compute a delta from the current unix style time to get approximately how long ago it was posted. However to reflect this in chat the calculation would need to be re-applied every update of the chat window so the messages would need to be handled separately from the normal immutable messages. If one wanted to approximate localized times from these then some form of conversion would be required which factors in things like leap years, seconds and the existence of time zones.
Title: Re: Real date for chat messages.
Post by: Ters on September 17, 2016, 06:13:20 PM
Quote from: DrSuperGood on September 17, 2016, 04:29:34 PM
Because real time is a real pain? You could have messages posted from the future or at times that never existed if one is not careful!

I learned the hard way a few weeks ago that the clock never was midnight in Berlin on April 1st 1893, which was a problem in two ways.
Title: Re: Real date for chat messages.
Post by: prissi on September 17, 2016, 08:11:53 PM
One could certainly tag messages in game time; but real time does not make much sense, or may misleading for international players, as 21pm in England might be rather 4am elsewhere.
Title: Re: Real date for chat messages.
Post by: Ters on September 17, 2016, 08:21:04 PM
Quote from: prissi on September 17, 2016, 08:11:53 PM
One could certainly tag messages in game time; but real time does not make much sense, or may misleading for international players, as 21pm in England might be rather 4am elsewhere.

Indeed, the time can not be part of the message text, it would have to be metadata that is converted into each players time zone when displayed. Which I think is what DrSuperGood meant.
Title: Re: Real date for chat messages.
Post by: River on September 18, 2016, 06:24:00 PM
Quote from: Ters on September 17, 2016, 08:21:04 PM
Indeed, the time can not be part of the message text, it would have to be metadata that is converted into each players time zone when displayed. Which I think is what DrSuperGood meant.
'

This would be nice, but as a start maybe use server time? or if the calculations are to intensive to the game.
Title: Re: Real date for chat messages.
Post by: Ters on September 18, 2016, 07:20:16 PM
Quote from: River on September 18, 2016, 06:24:00 PM
This would be nice, but as a start maybe use server time? or if the calculations are to intensive to the game.

The calculations are not hard, except for relative times ("x minutes ago"), which would also need continuous refreshing. I think the biggest hurdle is that one would essentially have to implement chat messages, as they would no longer be like the other messages.