night/day cycle


By Asmanel 11 Sep 2019 19:18

New member · 6 comments

Several Pokémon games have a night/day cycle and I think add one to Tuxemon will be a plus. However, I don't want it like in Pokémon.

Also, I don't want the work on this actually start now (there are in the game other things to improve, complete or implement before and I don't want the development of this idea slow them), unless a group of developpers do it on their own side (in this case, only the latest parts of the work will slow the remain), but I think it's already time to discuss about it.

First, I think the duration of the cycle is an important aspect of this mechanisn :
* In the Pokémon games including this mechanism (at least the ones I played, but probably also all the ones I never played), it's 24h. I think it's a bad idea because doing some thing, such as find some creatures, can require to play (an, so, bein awaken) at a certain time. So, it's to avoid, unless you want the game tagged as for adults only (I obviously don't wan't it)
* In some (non Pokémon) games, it's some tens of minutes (in Minetest, it's 20m). Even if I haven't any real argument against it, I think it's too fast and, so, also to avoid.

I think 20h is a good compromise.

On the wiki, there is a visibly abandonned idea, that will probably never be implemented. In that idea, it was possible to go to the possibility to go to several planets. In this case, there is no reason their night/day cycle have the same duration. It can be 26h on the second, 28h on the third and only 18h on the fourth.

If it implemented a day, I suggest these restrictions for any new world :
* no too short cycle (at least 3h)
* no too long cycle (less than 120h (5 real life days))
* no cycle too close from 24h or one of its multiples (at least 2h from the closest one)
* planets with cycle shorter than 16h are stated to have an unusually fast speed rotation and are less than 5% of the reachable planets
* planets with cycle longer than 48h are stated to have an unusually slow speed rotation and also are less than 5% of the reachable planets
* for both of the limits matching the previous restrictions (3h and 118h), no more than one world matching each, ever

Globally, the idea isn't making the game non real time but keeping it real time but without any 24h night/day cycle.

The second point is how to determine the local in game time. About it, in one hand, there is the time zones and, in the other hand, there is solar time.

The local "official" time depend on the local time zone. This tends to determine time related aspects of npc's conduct and can more or less directly affect tuxemon frequencies.

The local solar time depend on both the one on the prime meridian and the local longitude. The tuxemon frequencies will mainly depend on it. This also set when happen the switching between night and day time.

Both times depend on the real life POSIX time, using this base : on epoch, it was midnight on the time zone 0 and, on the prime meridian (that is, like in the real world, on the middle of the time zone 0) the solar time was also midnight.

This will require for each map a json file, (a more generalist equivalent of the current encounter json files), specifying its time zone, its longitude (not via an angle but via the number of seconds of time difference from the prime meridian) and, if there are several worlds, its world. If there are several worlds, each world will also need a json file, specifying its name, the duration in second of its night/day cycle and, on epoch, the time of its time zone 0 and the solar time on its prime meridian (both in secondes since midnight)

About the switching between night and day, I suggest make it progressive (in Pokémon games I played, this change happen suddenly), the one from night to day happening from 23 to 26% of the cycle and the other one from 74 to 77%. (0/100%=midnight; 50%=midday).

Next, there are the time dependant changes, that can affect several aspects of the game

The most obvious is the variations of tuxemon frequencies. There will be first base frequencies, that are the ones at midnight (local solar time) then changes specifying (for each of them) the change time (in secondes since midnight) and the frequencies that change (each entry is identified by its couple (or trio) monster+level range)

The time can also affect npc in various measures. Here are some example :
* several npc run, depending the time, a same shop, but only one of them can help you for a side quest
* if you want to talk with an npc, this one's reaction can depend on the time
* an npc can also be at different  location (or turn unfindable) depending on the time
Depending on the time, some doors can be locked or not.

Even if, in json, all times are in secondes, when the time will be displayed somewhere in game, the regular hour/minutes/secondes system will be used instead.

About the render, it will, obviously, be darker on most maps during the night time, with variations near from light source (that themself can be turned on or off). This aspect is, for now, vague and yet to set more accurately.

I think this will be enough for a first generation of this mechanism but this wont prevent later evolutions

Later development include things like :
* more realistic night/day transitions
* variations of the night/day ratio during the year (this will also require the latitudes of the tropics an of each map and the duration of the year; and this will make many things more formula based)
* moon(s) light
* etc...


By Cavalcadeur 12 Sep 2019 11:26

Member · 49 comments

Hi Asmanel.
I think that's a great idea. Having a non 24-hour cycle can be a great way to encourage people to play more often. And it's also a lot of fun. I would love to see that in game.

It's clearly not a top priority but it's still a nice concept to implement later, I guess.

I also love how it would work with different planets. I think having multiple planets is an amazing idea. But it's kind of hard to do sadly. Maybe later in development, this proposition will prove to be useful.