Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Comments & Feedback
  3. Time in frames

Time in frames

Scheduled Pinned Locked Moved Comments & Feedback
5 Posts 4 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Aidan_FireA Offline
    Aidan_FireA Offline
    Aidan_Fire
    wrote on last edited by Aidan_Fire
    #1

    Similarly to how some behaviours let you use screen % instead of metres, things with durations (more specifically Timers and Waits) could have the option to work in frames rather than seconds. As it is now, to have a timer for every frame you would use 0s, or 0.01666...s (since 0s can have some problems). It would be pretty cool to be able to choose how many frames something waits or delays in a timer, instead of multiplying 0.01666... by the amount of frames delay you want. Also that makes me wonder whether it is possible for a timer running on 0.01666...s to ever skip a frame.

    1 Reply Last reply
    0
    • MurtazaM Offline
      MurtazaM Offline
      Murtaza
      Admin
      wrote on last edited by
      #2

      This isn't the best approach of doing this.
      Frames are not consistent, so you don't actually want to do anything based on frames. On some devices (or due to behaviour logic) this can result in slow motion, or fast motion. Kind of unpredictable.

      What you would want to do is something in every render cycle (Some people call these "ticks". While we don't expose this exactly, timer of 0 is pretty much this.

      If you do in fact want to wait for a certain amount of frames, then what you can do is use the play animation behaviour and have an animation with your desired frames playing some where off screen. Then when the animation is done do some thing. It's kind of a hacky trick. But may work depending on what you're trying to do.

      Aidan_FireA 1 Reply Last reply
      0
      • MurtazaM Murtaza

        This isn't the best approach of doing this.
        Frames are not consistent, so you don't actually want to do anything based on frames. On some devices (or due to behaviour logic) this can result in slow motion, or fast motion. Kind of unpredictable.

        What you would want to do is something in every render cycle (Some people call these "ticks". While we don't expose this exactly, timer of 0 is pretty much this.

        If you do in fact want to wait for a certain amount of frames, then what you can do is use the play animation behaviour and have an animation with your desired frames playing some where off screen. Then when the animation is done do some thing. It's kind of a hacky trick. But may work depending on what you're trying to do.

        Aidan_FireA Offline
        Aidan_FireA Offline
        Aidan_Fire
        wrote on last edited by Aidan_Fire
        #3

        @murtaza I suppose render cycle might've been more what I meant. I didn't know the difference between frames and render cycles even existed. Timer 0s doesn't seem to work properly (at least not in movement behaviours), have timer 0s → move by some small distance, the object seems to stutter every second, but timer every 0.01666... doesn't.

        So how does this difference work? At maximum performance, a game runs at 60 frames per second, but how many render cycles? If the game starts lagging, do both of these slow down, or just the frames?

        iTap DevelopmentI 1 Reply Last reply
        0
        • RobinsonXR Offline
          RobinsonXR Offline
          RobinsonX
          wrote on last edited by
          #4

          Yeah, sometimes Timers don't cooperate with transform behaviors. Objects stutter behind. You can see some graphical glitches on my latest game due to this. I think there is a way around it, it just may be very complex to do.

          1 Reply Last reply
          0
          • Aidan_FireA Aidan_Fire

            @murtaza I suppose render cycle might've been more what I meant. I didn't know the difference between frames and render cycles even existed. Timer 0s doesn't seem to work properly (at least not in movement behaviours), have timer 0s → move by some small distance, the object seems to stutter every second, but timer every 0.01666... doesn't.

            So how does this difference work? At maximum performance, a game runs at 60 frames per second, but how many render cycles? If the game starts lagging, do both of these slow down, or just the frames?

            iTap DevelopmentI Offline
            iTap DevelopmentI Offline
            iTap Development
            wrote on last edited by
            #5

            @aidan-oxley a while back I had a timer of 0 moving an object, and had to use 0.01666 too.

            I don’t know if this is right, but when I looked it up I found that it had to do with movement on a 0 timer not always being in sync with the frames.....so like the object might move twice between frames and then once between the next frames. Maybe just if the the fps fluctuated.
            But if the timer is 1/60 or 0.01666... It supposedly keeps the movement in time with the frames.

            Not sure if this is actually true, but it seems to work.

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Search