My game lags in mobile devices.

  • From Performance tips under "common causes of poor performance":

    [quote:5itatcdj]Too many objects using Physics

    The Physics behavior is very CPU intensive. Using too many objects with the Physics behavior can cause considerable slowdown. You should design your games to use a few large Physics objects rather than many small Physics objects.

    Designing a mobile game to make heavy use of the Physics behavior is probably the least efficient first decision you could make. You might be able to get some more performance choosing asm.js physics mode in project properties, but the physics behavior is just about the most CPU-intensive behavior there is, and if you insist on sticking to it and have to use lots of objects then you are probably never going to get good performance.

  • jakobdam: What seriously ?? then why it lags in my iPad 4 ?? Can you please do me a favor. Can you please check it on mobile device, like any normal android device ? If it still don't lag, I will throw away all my devices and will take retirement and go to Himalayas. (just kidding )

    Ashley: If you have seen my game, there are many objects (almost all are static). I was just thinking, do I need to add physics behavior to all objects ? By only adding collider and checking collision with car object (in my game), will this increase performance ?

  • Yeah, performance is not poor with my devices - as stated, I also tested on my iPhone... I don't have anything weaker than that right now - in a few days, I'll have access to my entire test repertoire again, but I don't think it'll matter much.

    It sounds like what you're experiencing is an issue that is common for all devices when they're low on memory; so do check your available memory on the devices that stutter.

    What you can also do, is make a "save as"-version of your game, and create a simple steering, which doesn't involve physics; then you can pin point if physics are creating the issue for you here.

  • Tested on Moto X and I did not have problems here.

  • trovao1990: Thanks.. Now its my time to pack bags to Himalayas.. On serious note, I think I should take another look on my gadgets..

  • jakobdam: Well.. Just a quick question. I think I got the problem. The problem is not performance of game, but the car behavior. The game is running at smooth framerate, but my car is just driving really slow like a turtle. What can be causing this ??

  • I'm guessing the lack of "Dt" or wrong use of "Dt". Do you use it?

  • jakobdam: ahem.. What is 'Dt' ??

  • It's quite important to ensure that things behave at the same speed across devices. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    https://www.scirra.com/tutorials/67/del ... dependence

  • It's quite important to ensure that things behave at the same speed across devices. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

    https://www.scirra.com/tutorials/67/del ... dependence

    Ok I read it. I haven't used it in my game. I am using Car Physics behavior. How can I relate car acceleration with it ? There is no option.

  • Ashley: Can you help me in this ? I want to add dt in the car physics acceleration. Without this, my car is running fast in computer and slow in mobile. But there is no option in Car Acceleration action to multiply it with dt.

    Or is there any way round that the car speed will be fps independent.

  • See Delta-time and framerate independence. All the built-in behaviors already use dt, you don't need to use it with them.

  • See scirra.com/tutorials/67/delta-time-and-framerate-independence Delta-time and framerate independence. All the built-in behaviors already use dt, you don't need to use it with them.

    Yes but there is a line stating that Physics is an exception and it does not use dt. Is this applied to CarPhysics too ??

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • From Performance tips under "common causes of poor performance":

    [quote:13fetlu5]Too many objects using Physics

    The Physics behavior is very CPU intensive. Using too many objects with the Physics behavior can cause considerable slowdown. You should design your games to use a few large Physics objects rather than many small Physics objects.

    Designing a mobile game to make heavy use of the Physics behavior is probably the least efficient first decision you could make. You might be able to get some more performance choosing asm.js physics mode in project properties, but the physics behavior is just about the most CPU-intensive behavior there is, and if you insist on sticking to it and have to use lots of objects then you are probably never going to get good performance.

    hi ahsley,

    is it mean that for mobile, and for better performance, its better to use asm.js ?

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