[Guide] Simulating limiting frame rate

  • Rory's guide to simulated frame rate cap

    There's been a feature requested since the start of Construct 2 that has yet been added, which is frame rate capping, something seen in most game titles.

    For various reasons, you may want to limit your frame rate for your game.

    1. Artistic Choice

    Smooth visuals may not be what you're going for with your specific game title

    2. Consistent Framerates

    Some people have 240hz monitors that support 240 fps. But not everyone has graphics cards capable of playing every title in 240fps.

    Having unconsistent drops in frame rates is much worse than having a fixed 30fps,60fps,120fps.

    Not many people may understand this problem because most people use 60hz screen devices.

    3. Preference

    Some people just prefer playing games on fixed refresh rates because smoothness feels artificial. I personally don't get this, but I know people who do.

    So since there has yet to be an official solution, here's one bad work around.

    MY BAD SOLUTION

    1. Detect your game's refresh rate.

    Using the system variable "fps" check what the player's refresh rate is.

    Save it to a variable called RefreshRate in a layout where there's nothing slowing down the game.

    2. Limit it based on what you determined the player's refresh rate to be.

    Eg. If the player is running on a 60fps monitor but you want it to be a 30fps game.

    Eg. If your player is running on a 120fps monitor but you want it to be a 30fps game.

    I have a 100hz refresh rate.

    This is 50fps with it halved

    This is 25fps with it quartered

    Notes

    -Popular refresh rates are 24/30/60/75/90/100/120/144/240hz

    -If you do fancy math, taking your RefreshRate variable and your desired target frame rate, you can find out how many frames you need to tick because you render one frame and at what time scale

    -You may have to work around some other stuff, like not running things on every tick, and instead on every "Moving Tick".

    Of course the system is still actually running at 100fps, it's just pausing the game 1/2 or 3/4 ticks and then speed it up for the last tick. It's only here to help with reasons 1 and 3. For people who want frame rate caps for artistic purposes and preference. You might run into more problems in the future.. but this is the best solution I can come up with until Ashley gives in to the age old request for frame rate caps.

    I'm making this guide to help out anyone who really wants to use Construct to make ANY 2D game they want, but need this. I love this engine. Although, Ashley adamantly says that he sees no reason to do this. I believe that the game engine should cater to the games they make and not the other way around. Just workarounds for now and hopefully we get this simple request looked into some day. Hope this helps for now!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)