Benutzer:Amogorkon/PiLife/Time
Time is crucial in all international MMOs. Therefor it is required to put extra thought into it.
To provide a reliable base for calculations, an NTPd should be included to calculate an offset between global time and system time, without modifying the system settings.
Then the Unix time can be used as base and converted to many different formats, like internet-time, UTC, sun/moon circles and calendars, like the muslem one, or any other, also random phantasy systems.
The message system also can make use of a reliable time system, as all types of ingame events can be executed in the correct order, at the right time.
As for interaction ingame, a fixed artificial minimum delay of 30 ms or more should be considered. Especially IPv6 has higher ping delays than IPv4 yet, which means that there will be perceivable delay differences between users that are near and those who are far away. Such delays are most annoying when they are not predictable. Slowing down the interaction can make the world more steady and thus more usable, as long as the delays are not too big.
Unix time also provides a simple yet powerful and ressource-saving means to queue ingame events. For this a simple python dictionary is required which uses timestamps as key and a list of events as content. Every millisecond the dict is queried whether an event is registered for this timeslot and executed accordingly. This way, even long-term events can be scheduled easily, without using more ressources and even surviving server- and clientcrashes. Magic spells can make use of this as well as delayed message delivery or changing the day/night-pattern on the fly in private dungeons, economy management, AI-behaviour or system administration.
Having a local time offset also can be utilized to detect advanced sandboxes and manipulation of CPU-timings. On the other hand, it is a means to provide reliable and correct time, also on fast moving mobile devices, which can be quite a hassle on travels.