Unlimited Framerate Mode

0 favourites
  • 15 posts
From the Asset Store
Photo Slider Puzzle with unlimited no of grids & pieces
  • I've searched the manual and tutorials - is there a way to set this in C2 for testing?

  • I don't think so. The rendering is automatically capped at 60FPS.

  • Not at the moment, no. Not sure if this is a browser limitation or a C2 limitation.

  • It's a browser limitation - most browsers have v-sync forced on (which is a good thing IMO). Some browsers have a way to disable it - you can in Chrome from chrome://flags for example.

  • Hmm. So what's the best way to test your game to make sure it works properly on low fps machines?

  • Make sure to use delta time wherever possible.

    See this tutorial (and especially the "Advanced considerations" paragraph).

    Also, test on a low-fps machine you can have access to and decide it is your "lowest recommended gear".

  • May as well ask real quick: Is there a way to turn off VSync in Node-Webkit? :P

  • Kyatric - I do always use DT - the advanced considerations is currently what I'm having trouble with. How do you stop an object from "teleporting" through another collision object at low fps if you're using dt to move it (or a behavior)?

  • Node webkit can have vsync turned off, because it can accept the same command line args that chrome can. You can incoperate them into the manifest, more info: https://github.com/rogerwang/node-webkit/wiki/Manifest-format

    Also, low fps can be tested by simply giving the CPU too much work to do, like adding an event that checks collisions thousands of times each tick.

  • Arima - Sorry for my ignorance, but what would an event like that look like?

  • Repeat 10,000 times

    If sprite is overlapping sprite 2

    Adjust the number of repititions until it affects the framerate appropriately.

  • Okay here's another question - if you can't set the fps to unlimited, can you set a minimum fps? And if not, how do you get around low fps collision issues using dt?

  • Just avoid very small fast moving objects moving towards thin barriers. You can calculate how fast an object steps every tick, it's:

    speed x dt

    For example an object moving 100 pixels per second at 20 FPS will be stepping

    100 x 0.05 = 5 pixels/tick

    So if the object is bigger than 5 pixels wide, it will never skip a collision. Even if it was only 3 pixels wide, it could only ever skip a wall that was only 2px thick. So both larger objects and thicker obstacles help prevent the issue.

    The C2 engine implements a minimum FPS of 10. So dt never goes above 0.1 - the game goes in to slow-motion at that point.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not really a good idea. Legend of Grimrock players complained about their videocards overheating. Devs chased the bug for a long time, until a day when they found out the game wasn't frame limited and this caused not only overheating, but consuming a lot of power as well resulting in increased electricity bills...

    The game was basically idling or not really GPU hungry, but during idle it commanded the videocard to render the same frames over and over.

  • Interesting - so if I set a bullet at 2500 speed, it would need to be a minimum of 250 pixels wide in order to collide with an object 1 pixel wide at every fps?

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