Accurate Timers

MelodyCatsMelodyCats Member, PRO Posts: 128

Hi,
Does any one have a project example of this timer example originally posted by @domenius?
http://forums.gamesalad.com/discussion/44707/timers-are-for-chumps-gs-optimization-tips/p1
He posted a project example but the link is no longer active and don't seem to be clever enough to understand all the instructions...

My current game needs a super reliable timer as everything is synced precisely to a background music track and if the timers start gradually slowing down which they all seem to do (even when tied to game.time or self.time) then everything gets thrown off.

@domenius example though looks like it could do the trick - also interested in any other precise timer solutions you may have.
Thanks!

Comments

  • ArmellineArmelline Member, PRO Posts: 5,331

    That was done when the timers in GameSalad were really unreliable. They're not, now. There's no need to jump through hoops. A timer behaviour should be as accurate as one using the self.Time method that, from memory, @domenius used.

    If you're having problems with ones tied to the time attributes, which it sounds like you are, then you presumably have a very very busy game, and the framerate is dipping noticeably. Nothing in that thread or project will help you there.

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069

    Yep, profile your games performance if you can. Probably taxing it at certain points and it slows down. The engine does try to compensate for frame drops, but any massive frame drops will cause this issue (like going from 59-60 fps to 40-45 fps).

    Follow us: Twitter - Website

  • MelodyCatsMelodyCats Member, PRO Posts: 128
    edited February 2017

    Thanks @Armelline @AlchimiaStudios - yes I think you're both right. It does seem like the issues I'm having with timers are mainly in a couple of scenes that are particularly spawner heavy... will see if I can reduce the load somehow.

Sign In or Register to comment.