Real Time!

Poking around in the MV Script Library today, I found that MV uses the Date.now() function to track the passage of time for most purposes.  Without getting too technical, this JavaScript command returns the actual date and time of day, in milliseconds - so if ten real world seconds have passed, the number returned by this function will increase by 10,000.

In the past, RPG Makers would use Graphics.frame_count (or similar) to judge time based on the number of frames that have passed.  This was different than real time because issues such as computer performance would affect the number of frames that would actually pass in a second (and because it wouldn't continue to increase if the game was out-of-focus, or shut down for that matter).  It looks like Graphics.frameCount is still available in MV (as it's used for things like graphical updates), so we're not losing anything in this transition, which is awesome.

But I'm really excited by this new ability to track the passage of real time!  If I want precisely one second to pass between updates of a Parallel Process event in my game, I can do that, instead of adding a 60-frame Wait and then hoping that the game is running at 60 FPS rather than 25 FPS.  That two-minute deadline you give to a player when something chaotic happens can now actually be a two-minute deadline!  (Additionally, if I want to have an event occur in my game once every eight real-world hours, I can do that with some extremely simple scripting instead of needing experts like Hime or Dekita to write extensions that go way beyond the functions of RPG Maker itself.)

What kinds of cool gameplay elements can you think of that will be feasible in MV with this new method of time-keeping, that weren't available in previous RPG Makers?
Game_System.prototype.playtime = function() {


return Math.floor(Graphics.frameCount / 60);


};
Personally I'm not a fan of using "real time" to track game time, unless you actually wanted to synchronize it with real-time.


I think game time and real time should be tracked separately, where you have the option of having game time flow at the same rate as real time (I tend to call it "world time" or "earth time", since game time is processed in "real time" as well).


For example, if you go to the inn and sleep for the night, would it be necessary for them to literally turn off the game for 8 hours or so?


There are definitely use cases where you would like to use earth time, but there are just as many times when you want to disassociate from it.

Original thread: https://forums.rpgmakerweb.com/threads/real-time.53291/