How do I lock frame rate

0 favourites
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • how do I lock my framerate to 15 fps?

    yes I want the jerky feel

  • There is no way to lower the framerate. It always runs at 60 FPS.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Short answer:

    You can't.

    Long answer:

    C2 is synced to the screen refresh rate, typically 60fps, and there isn't a way to change it. If you want to get creative you could only move objects every 1/15th of a second to get that effect, but you can't use any movement behaviors.

  • wait I won't be able to use movement behaviors if I run everything into a wait command?

  • You could randomise timescale every few seconds.

  • I don't know how a wait command can be used. Another idea occurred to me, just make a repeat loop to eat up time.

    global number time_eater=0

    system: compare fps>15

    --- add 10000 to time_eater

    else

    --- subtract 10000 from time_eater

    repeat time_eater times

    ---

  • What about the system action 'set time scale' ? Set it to zero every so many times/second for a given time should emulate the requested effect? Behaviours get there dt from the time scale action.

  • thankyou guys

  • I don't know how a wait command can be used. Another idea occurred to me, just make a repeat loop to eat up time.

    global number time_eater=0

    system: compare fps>15

    --- add 10000 to time_eater

    else

    --- subtract 10000 from time_eater

    repeat time_eater times

    ---

    this doesn't work it seems to just slow down every n amount of seconds

    What about the system action 'set time scale' ? Set it to zero every so many times/second for a given time should emulate the requested effect? Behaviours get there dt from the time scale action.

    I suspect this only modifies behaviors correct?

  • I made an example to look if 30 FPS will save CPU Usage on mobil. Now it locks at 15 not 30 FPS.

    Hold mouse button to spawn some sprite, then double click on the blue square for 15FPS, double click again for 60FPS. It only execute in 15FPS the subevents under every x second event.

    Have a look:

    https://drive.google.com/file/d/0B5FlDY ... sp=sharing

  • so its not possible with a repeat loop to eat up time then huh?

    I figured it had to do with the every x seconds event

    I just didn't want to have to use it in every piece of code

  • If the loop is big enough it will eat up time. The idea I posted is a possible way to tune the length of it. Changing the numbers could give better results. In the end it's just a random idea. I probably would never use it, instead i'd go for the every x seconds idea.

  • R0J0hound can you explain more on how to tune the loop so that it eats the perfect amount of time and doesn't cause lag?

  • I've never tried it but it should be like what I typed, just tweak the numbers I suppose. However from the sound of it it doesn't work, but no matter, it was something to try.

  • maybe Ashley or Tom would know how something like this could be done?

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