logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Why does my simple game jitter/lag every 2 seconds?

    Scheduled Pinned Locked Moved
    Help and Support
    5
    11
    1.2k
    Loading More Posts
    • 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.
    • KamdroidK
      Kamdroid
      last edited by

      I've been meaning to ask this question for a while:
      Why does my simple game Bounce Tap jitter/lag every 2 seconds?

      https://www.hyperpad.com/projects/aubjkay_

      The only 2 reasons I can think of:

      • The obstacles move towards the still ball, to give the illusion of movement

      • Constantly setting the ball's X velocity to 0 to prevent it from accidentally moving

      Any ideas on how I could fix this?

      Aidan_FireA 1 Reply Last reply Reply Quote 0
      • RobinsonXR
        RobinsonX
        last edited by

        If you are using a timer having an interval of 0s, the timer will eventually have a bit of delay and some jitterness.

        For my games, I use the play animation behavior as a timer. Simply set an unused object to play a one-frame animation at a speed of 60 fps. Hook the play animation behavior to the other behavior as if the behavior was a timer. :)

        1 Reply Last reply Reply Quote 0
        • KamdroidK
          Kamdroid
          last edited by

          @robinsonx I don't think it's the timer anymore. I disabled it (obviously ball goes off screen) and the jittering still occurs. Possibly disabling it made it jitter less, but it certainly still happens.

          Even if the timer wasn't running at full speed, the only affect would be the ball moves slightly out of place. (Hopefully in next update they let you disable velocity on X/Y)

          iTap DevelopmentI 1 Reply Last reply Reply Quote 0
          • Aidan_FireA
            Aidan_Fire @Kamdroid
            last edited by

            @kamdroid Might be better having a moving ball with still obstacles, and the camera following the ball. So in hyperPad, rather than having a heap of objects moving at once, you just have 1. I played it, couldn't notice much jitter on my iPad Air, only weird things that happened were I somehow got the ball stuck to the ground and couldn't jump :P only once.

            1 Reply Last reply Reply Quote 0
            • iTap DevelopmentI
              iTap Development @Kamdroid
              last edited by iTap Development

              @kamdroid what behaviors are you using to move the obstacles?

              KamdroidK 1 Reply Last reply Reply Quote 0
              • KamdroidK
                Kamdroid @iTap Development
                last edited by

                @itap-development Move to Point

                I think the problem is probably because of the obsticales moving for the illusion of the ball moving.

                iTap DevelopmentI 1 Reply Last reply Reply Quote 0
                • iTap DevelopmentI
                  iTap Development @Kamdroid
                  last edited by

                  @kamdroid are you moving a short distance constantly, or moving a longer distance and having a duration?

                  KamdroidK 1 Reply Last reply Reply Quote 0
                  • KamdroidK
                    Kamdroid @iTap Development
                    last edited by Kamdroid

                    @itap-development Moves to a point (X axis) where it will be off screen and then destroys the object.

                    You could branch the project if you need to find out more.

                    0_1532052157375_25F34A51-A676-43F4-A69F-950D0A77B1A5.png

                    1 Reply Last reply Reply Quote 0
                    • T
                      Thecheater887
                      last edited by

                      Particles are a massacre and object initialization takes forever. Just a few guesses, though.

                      1 Reply Last reply Reply Quote 0
                      • RobinsonXR
                        RobinsonX
                        last edited by

                        Since object initialization is a performance killer, maybe instead of constantly destroying and respawning objects, maybe just reuse them.

                        1 Reply Last reply Reply Quote 0
                        • Aidan_FireA
                          Aidan_Fire
                          last edited by

                          The more behaviours inside spawned objects, the laggier it will be to spawn them. Try to take behaviours out of spawned objects and put them in something else. If the spikes activate some behaviours when they touch the player, try to delete them and put them in the player instead, stuff like that. Could even put them all in a tag and have the world move all the objects at once rather than each object moving itself (though I'd still recommend just having the player move and the objects stand still).

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post