How do I increase FPS / Increase Performance

0 favourites
From the Asset Store
Create a game inspired by great arcade classics as Operation Wolf
  • Hello guys!

    I am working on a game that is actually pretty simple. The thing here is that it performance is really low! It is possible to play it on Desktop Computers somehow... but it gets ugly on Android or iOS.

    Here is an image of its debug running. Any ideas on how I could improve its performance?

    For this game I have a chronometer (showing minutes and seconds), 16 objects using collision detection, 4 unmovable objects as walls and 4 objects as detection areas / zones.

    Also (maybe it is here) on every tick I count how many of those 16 objects are on each of the detection areas.

    Any ideas? Thanks!

  • Tried changing your renderer to WedGL?

  • Hi Tekniko! What do you mean? At project's properties? Its WebGL is On already...

    Physics Engine is Bpx2D Web.

    One thing that I did is to change most of its "detecting" actions from "Every Tick" to "Every 1.0 seconds". But didn't see much improvement.

  • Upload your capx.

  • There you go. Please take a look.

    I've seen around here that collisions do take a lot of processing. But in this case I don't see any other way.

  • There you go. Please take a look.

    I've seen around here that collisions do take a lot of processing. But in this case I don't see any other way.

    Unless I missed something, You have a lot of events (60 to 75, all the token collision group in fact) that checks for collisions for no apparent reason, which will of course be an issue for performances.The physic behaviors already do it's own collisions checks by itself without you needing to do anything, so doing other collision checks on top of that is not needed.

    Also maybe switching to Box2d asm.js can help, but not 100% sure about that.

  • Hello Aphrodite !

    Yeah, from 60 to 75 it is supposed to play a sound of objects colliding with each other. I have removed the sound for this capx and forgot to remove the events. So I removed it from the capx attached now ... but it didn't really help.

    And yes, switching to Box2d asm.js helped with +- 10 frames =) ... I will try to use it with mobile devices as well.. I will post it here later.

    Tks

  • Also, did you try exporting the project to test it on mobile?

    I know the debugger adds an overhead to performances, and previewing isn't as good as exported version.

  • I have just tried exporting to Android and using XDK (Crosswalk). It got worst =(

    It is an Android 4.0 Tablet - 1GHz Processor / 512MB RAM

    I also tried on iPAD Mini (1st version). It isn't smooth yet... =(

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, I also tried CocoonJS... it is not worthy! Compilation takes a lot of time and it can be even slower.. =(

    Seems like I have to quit using embedded physics and aim some work-around....

  • One last suggestion I can make regarding physics:

    change the Precision of the physic simulation using the action "Set stepping iterations" for one of the object (will apply to every object using the physics behavior), a lower value is faster

    Also if slowing down is the issue, maybe you can also change the stepping mode with the "Set stepping mode" action, which will also apply to all of them.

    https://www.scirra.com/manual/98/physics

  • its pretty obviuos that your project or your pc is not running webgl, but canvas2d... that why you get bad pefromance.

  • Hi, I also tried CocoonJS... it is not worthy! Compilation takes a lot of time and it can be even slower.. =(

    Seems like I have to quit using embedded physics and aim some work-around....

    Physics is always an issue with JavaScript. But I am getting smooth 60fps on my old desktop.

  • its pretty obviuos that your project or your pc is not running webgl, but canvas2d... that why you get bad pefromance.

    Are you sure about that? As far as I know physics have nothing to do with WebGL. This all runs in JavaScript. Not on the GPU. His graphics hardly matter for such a simple demo.

  • One last suggestion I can make regarding physics:

    change the Precision of the physic simulation using the action "Set stepping iterations" for one of the object (will apply to every object using the physics behavior), a lower value is faster

    Also if slowing down is the issue, maybe you can also change the stepping mode with the "Set stepping mode" action, which will also apply to all of them.

    https://www.scirra.com/manual/98/physics

    Aphrodite, thanks for your suggetions. Looks like it got better.... but not smooth yet on Android. I think that I will have to publish it only for the new devices. =/

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