[Suggestion] Custom Clock functionality

Discuss anything about DraStic here.
Post Reply
ssj4maiko
Posts:5
Joined:Sat Mar 29, 2014 9:07 pm
[Suggestion] Custom Clock functionality

Post by ssj4maiko » Sat Mar 29, 2014 9:32 pm

I searched if there was any mention about this, but couldn't find any, so I guess there really is no way to do it, and then, it goes as a suggestion.

Some games (Read Pokemon) uses time and weekdays for events, but because of work and stuff, I can't exactly do things that require playing the game in weekdays, and at times like 10AM~12AM or 1PM~6PM (Getting the gym leaders phone numbers, and that includes Blue's sister Tea time, which I don't think can be manipulated using the Daylight cheats available), so my suggestion would be, if possible, create an optional internal clock functionality, something that allows to select a date/time, and while it's activated, it runs normally on real time, allowing to do events from times when I can't play, because changing the clock of the phone/tablet (Android OS itself) could be problematic for some apps, unlike doing it if I had the console itself (I did a lot of date/time manipulation on my PSP because it doesn't really matter if the time is right in the console, it's not a phone, which is important for other reasons).


Not sure if there are more games that use this type of functionality, and I know there are usually a few penalties on them if you change the clock to a time before the last saved one, but still, it would be an useful extra functionality, I think, at least. =/

Exophase
Posts:1715
Joined:Mon Aug 05, 2013 9:08 pm

Re: [Suggestion] Custom Clock functionality

Post by Exophase » Sun Mar 30, 2014 3:12 am

So basically, you want to specify what the time is when the game first starts running, but the time would still increase like normal from then on? I think doing it any other way would break things. Games could get really confused if the time changes all of a sudden (especially if it goes backwards), or if doesn't increment at one second per second.

Also, you'd have to be really careful with this, because some games will freak out if you load a save file that it thinks was made in the future. Like, it'll consider it corrupt.

ssj4maiko
Posts:5
Joined:Sat Mar 29, 2014 9:07 pm

Re: [Suggestion] Custom Clock functionality

Post by ssj4maiko » Sun Mar 30, 2014 11:41 am

Exophase wrote:So basically, you want to specify what the time is when the game first starts running, but the time would still increase like normal from then on? I think doing it any other way would break things. Games could get really confused if the time changes all of a sudden (especially if it goes backwards), or if doesn't increment at one second per second.

Also, you'd have to be really careful with this, because some games will freak out if you load a save file that it thinks was made in the future. Like, it'll consider it corrupt.
Yeah, in a programming way, I either select real time via a checkbox that disables the calendar, or I deselect it, and select a custom time, this way, after selecting Day, Month, Year (Not sure if there is a native calendar funcion, to be able to see weekdays too and select this in a single tap), Hour and Minutes, a "Date Difference" function would run, and this result, be it for positive (Future) or negative (Past), would be added constantly in the emulator's Internal Clock.


Also, I don't think something like corruption would happen, because everyone is able to mess up their consoles times, and games should always consider this "cheat", so, unless we are talking about a really bad programmed game, it shouldn't be a problem. I read that in pokemon there is an anti time cheat about certain events in case you change the clock to some time in the past, so this should be proof enough that games will usually account for something like that, and won't break just because of time problems.

Exophase
Posts:1715
Joined:Mon Aug 05, 2013 9:08 pm

Re: [Suggestion] Custom Clock functionality

Post by Exophase » Sun Mar 30, 2014 3:03 pm

ssj4maiko wrote:Yeah, in a programming way, I either select real time via a checkbox that disables the calendar, or I deselect it, and select a custom time, this way, after selecting Day, Month, Year (Not sure if there is a native calendar funcion, to be able to see weekdays too and select this in a single tap), Hour and Minutes, a "Date Difference" function would run, and this result, be it for more (Future) or less (Past), would be added all the time in the emulator's Internal Clock.
Okay, I went ahead and implemented after you made the first post, and it's like you describe. We just need to implement the GUI stuff for setting the date/time, which is of course where all the work is ;p

For what it's worth, when I said games can get confused, I know because I have a debug option in the source to make the RTC report a fixed time in order to improve deterministic playback, and it does occasionally cause weird things to happen in games.
ssj4maiko wrote:Also, I don't think something like corruption would happen, because everyone is able to mess up their consoles times, and games should always consider this "cheat", so, unless we are talking about a really bad programmed game, it shouldn't be a problem. I read that in pokemon there is an anti time cheat about certain events in case you change the clock to some time in the past, so this should be proof enough that games will usually account for something like that, and won't break just because of time problems.]
All I know is you get corruption in Pokemon saves if savestates and saves are decoupled, and you load a savestate taken before the save was made, the game will say the save is corrupt. I assumed it used the RTC for this, but it's possible it just uses some internal counter.

ssj4maiko
Posts:5
Joined:Sat Mar 29, 2014 9:07 pm

Re: [Suggestion] Custom Clock functionality

Post by ssj4maiko » Sun Mar 30, 2014 3:57 pm

Exophase wrote:All I know is you get corruption in Pokemon saves if savestates and saves are decoupled, and you load a savestate taken before the save was made, the game will say the save is corrupt. I assumed it used the RTC for this, but it's possible it just uses some internal counter.
Oh, I think I understand now what you said. By using savestates, the console shouldn't be able to change clocks to the past and that could cause problems. So the main secure way would be by saving ingame and resetting it, without using savestates to reload.

I think maybe, the proper option should look like:

Change internal clock Modifying this option will reload the game
- Checkbox
- Will trigger an alert/confirm popup, and should also force reset the game if confirmed
# The term "Reset" may cause confusion as "clearing the whole game data", which is not true
# By changing the clock, the game will be be reloaded, discarding any non-saved progress. Be sure to save your game "in-game", and when reloading, load your game normally. DO NOT USE SAVESTATES FOR THIS OPERATION or your save could get corrupted. Do you wish to continue this operation?
(Not best english, though)

Realtime clock
- Checkbox
- Always disabled by default (Can't change the option, it will be checked/unchecked based on saved options). Will only be enabled if the previous alert was confirmed. Checking it will disable the next option.

Calendar options
- text/combo/calendar
- Always disabled by default, will only get enabled when alert windows gets confirmed, and Realtime clock is unchecked.

When saving the options and returning to game, it will reset.

Sorry if I'm meddling in unnecessary things. =/

Exophase
Posts:1715
Joined:Mon Aug 05, 2013 9:08 pm

Re: [Suggestion] Custom Clock functionality

Post by Exophase » Sun Mar 30, 2014 5:00 pm

I don't think that modifying the clock option should reload the game. Just a note that it won't take effect until the game is restarted (that's how it currently works anyway). Other than that, it's just an option, like "use custom clock time" and then the actual time to use.

Upon further reflection, I'm thinking of changing the way the RTC is emulated entirely. Right now, when the game reads from the emulated RTC the current time on the device is reported. So if the game isn't running in real time, or a savestate is loaded, the game could get confused with the RTC time. The alternative is to use the system time, or a custom time, only when the emulated DS starts, then have this time increment by one second for every emulated second. This means if you fast forward the time will start going faster, and if the emulator slows down it'll go slower, and if you load a savestate it'll pick up from the time where you loaded it. This may confuse some people who are trying to get the game time to line up with real world time when using savestates. But I think this is a fair tradeoff to avoid potential problems this could cause, especially if this has anything to do with Pokemon save issues. It also has the benefit of making save states more repeatable, which is good for testing, and good for some things save states are used for.

If people want the time to stay synced with with real world time they'll have to rely on in-game saves and not fast-forward.

ssj4maiko
Posts:5
Joined:Sat Mar 29, 2014 9:07 pm

Re: [Suggestion] Custom Clock functionality

Post by ssj4maiko » Sun Mar 30, 2014 11:48 pm

Well, things are getting a little to advanced for me, since I don't really know the whole context, but it's awesome to see my suggestion being considered so fast.

Thanks :D

xperia64
Posts:307
Joined:Fri Feb 28, 2014 7:41 pm

Re: [Suggestion] Custom Clock functionality

Post by xperia64 » Sun May 04, 2014 7:16 pm

Custom clock doesn't seem to stick. If I set the custom date and enable custom RTC, it doesn't save/set it. When I exit and go back into settings, it doesn't show the custom date, but tapping on the custom date displays the calender dialog with my last set date.

Lordus
Posts:517
Joined:Mon Aug 05, 2013 9:05 pm

Re: [Suggestion] Custom Clock functionality

Post by Lordus » Sun May 04, 2014 10:02 pm

Does it update the date, if you set a custom time, too?
This should be fixed in the next update, but the problem only affects the custom date display in the settings dialog, the date you set is still saved and used.

xperia64
Posts:307
Joined:Fri Feb 28, 2014 7:41 pm

Re: [Suggestion] Custom Clock functionality

Post by xperia64 » Sun May 04, 2014 10:10 pm

It doesn't appear to update the date in the game itself. I was trying to figure out how content timestamps worked in WarioWare DIY and when I checked the timestamp on something it was still the real date.

Post Reply