Frame Skipping - Weird Results

This forum is currently in read-only mode.
From the Asset Store
three fully animated characters ideal for your RPG side scroller projects
  • I've set my application at 60FPS V-synced (also tried fixed). Whenever the CPU gets momentarily busy with other activities, the game's framerate drops, but the game seems to keep processing invisibly and misses all the frames that werent rendered to screen. Eg, if the character is falling and just before he is about to hit the ground, the game hitches for 0.5 seconds, by the time it resumes, he has fallen way past the ground and the collision detection that should have stopped him on the platform while the game was frozen never takes place. This is just one example of the issue but it happens in other cases as well.

    Any ideas how to prevent something like this happening?

    An almost certain way for me to reproduce the error is to use FRAPS to record a video of the game while playing it. From time to time, it hitches, and weird sh*t happens.

  • Objects using delta time, like behaviors, can do things like "jump" through walls when the framerate stalls, because movement is basically a series of teleports that happens every frame. If the framerate gets too low, as delta time results in pixels per second moved, the gaps between "teleport locations" can jump entirely over obstacles, meaning the collision detection doesn't catch them.

    The easiest solution to this is to set a minimum (or maximum, I can't remember how it's labeled at the moment) dt in the project properties (I think it's under some advanced section). Set it to something no higher than 0.1, and if the framerate stalls lower than 10 fps, the gameplay will slow as well, preventing the player from jumping through obstacles.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • There's a timer FPS setting at 100 FPS, override timer which is disabled, and minimum FPS setting which was set to 0. I've set that to 40, so I think now the game slows down if the FPS drops below 40. Think that's resolved the issue. Thanks Arima :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)