Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Fix the Game Clock

McP

Member

Hi
The Ingame Clock of rmxp calculates the time in the playtime window somehow by dividing the overall frames by the current frame rate...as far as i have figured out.
Now if the game lags or runs a bit slower than it should, the time gets messed up.
Since I dont want to play with a stopwatch besides me, I'd like to ask if there is something out there or someone who can alternate the way the time is calculated independant from the current fps.
 
You could use the PC's time and just record the start time and current time and subtract the seconds. It should be a simple enough thing to do, look for scripts that mess with the computer's time. I'll see if I can find anything that might work, but I don't have RMXP here so I can't test anything.
 

Wichu

Member

Time.now returns the current time.
I used it to synchronise my introduction with music, for the same reason (and if the player decides to switch windows, pausing the graphics but not the music).
Make it store the time in a global variable or something when you load, then when you save etc, add the difference to the previous play time.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top