How do I stop my game lagging on mobile?

0 favourites
From the Asset Store
a ready made template of Mobile Advert, Google Play and Mobile IAP Plugin,
  • I have just exported my game into Android in form of an APK file and installed it on my Nexus 4. Unfortunatly the game runs pretty bad with obvious stuttering (about 13-15 FPS) which for a side scrolling game is pretty poor and unable to release it. When I run it on my Desktop and over the web via "preview" to the device it works flawless.

    I have read articles on how to get the most out of mobile hardware and really tried dumbing it all down (removing all particle effects, changing background from sprite -> tileset, shrinking my background. etc.) but it still doesn't work properly and performance is still poor.

    The game from what I can see has 116 Events. No Loops and each level has no more than 6 layers.

    I have really tried my hardest to understand the articles on how to dumb my game down to mobile devices but it's far too complicated, I have no talent in art or coding what so ever. If you have any tips on how I can solve the problem please write it in simple terms for me.

    Thank you

  • We need to see your capx file before we can offer any help.

  • are you using webgl effects? do you have text objects around? are there objects using pathfinding behaviour? did you check in debugger how many collision checks are being öade per tick? how many objects are spawming? what is your layout size?

    I know lots of questions but these are what caused my apps to run slow on mobile. also which mobile device are you checking it with?

  • We need to see your capx file before we can offer any help.

    How do I get that ?

  • Edited

  • are you using webgl effects? do you have text objects around? are there objects using pathfinding behaviour? did you check in debugger how many collision checks are being öade per tick? how many objects are spawming? what is your layout size?

    I know lots of questions but these are what caused my apps to run slow on mobile. also which mobile device are you checking it with?

    No WebGL effects.

    All Text has been made into a sprite and even then it's only 3 sentences.

    No Pathfinding.

    3500 Collision Checks ? In debug mode I think

    How do I find out how many objects I have ?

    Layout Size is 5000, 500

  • In the debugger, there is a border belt seperating gameview and info tabs. The first thing in the far left of this belt is the object count.

    3500 collision checks per tick or per second?

    Which phone are you testing on?

    Did you use crosswalk or cocoonjs to apk it?

    Layut size is fine, everything else is fine. Are you using physics objects?

  • In the debugger, there is a border belt seperating gameview and info tabs. The first thing in the far left of this belt is the object count.

    3500 collision checks per tick or per second?

    Which phone are you testing on?

    Did you use crosswalk or cocoonjs to apk it?

    Layut size is fine, everything else is fine. Are you using physics objects?

    I used Intel XDK to APK it up.

    Testing on a Nexus 4 (Pretty powerful hardware)

    The Performance Tab says Collision Checks/sec: 4004 (~89/tick)

    120 Objects apparently.

    No Physics at all.

  • " When I run it on my Desktop and over the web via "preview" to the device it works flawless."

    Do you mean that the preview on the device runs great? (if so, does the HTML5 exported runs great in the chrome browser of the device too? If so, then I'd say it is a problem not on your side IMO)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • " When I run it on my Desktop and over the web via "preview" to the device it works flawless."

    Do you mean that the preview on the device runs great? (if so, does the HTML5 exported runs great in the chrome browser of the device too? If so, then I'd say it is a problem not on your side IMO)

    I exported it as a regular HTML 5 and just put the files on the device, It didn't run through chrome because "Exported games won't work until you upload them" JavaScript error happened. No idea what this means and no idea how to fix it.

    But when I preview the game via my localhost in chrome on the mobile device it works fine (other than the Audio takes forever to catch up).

  • if you use the default browser then webgl is off and that is the reason you see this terrible performance

    you need to install in your computer the intel xdk and export from c2 as "android".

    read the tutorials here on how to do this and create your apk.

    it will be wrapped in chrome(canary) and it will take advantage all the speed boost that the xdk gives.

    you never EVER export in mobile as plain html!

    edit: i just read that you already used xdk. the latest build gives terrible performance but your game is very simple from what i read for this to be a problem.

    please try cocoojs and tell us your results.

  • if you use the default browser then webgl is off and that is the reason you see this terrible performance

    you need to install in your computer the intel xdk and export from c2 as "android".

    read the tutorials here on how to do this and create your apk.

    it will be wrapped in chrome(canary) and it will take advantage all the speed boost that the xdk gives.

    you never EVER export in mobile as plain html!

    edit: i just read that you already used xdk. the latest build gives terrible performance but your game is very simple from what i read for this to be a problem.

    please try cocoojs and tell us your results.

    I managed to get the "raw" HTML game to open in Firefox mobile and it worked amazing. I think that Intel XDK is just crap and doesn't work in that case, I will try cocoonjs.

  • > " When I run it on my Desktop and over the web via "preview" to the device it works flawless."

    >

    > Do you mean that the preview on the device runs great? (if so, does the HTML5 exported runs great in the chrome browser of the device too? If so, then I'd say it is a problem not on your side IMO)

    >

    I exported it as a regular HTML 5 and just put the files on the device, It didn't run through chrome because "Exported games won't work until you upload them" JavaScript error happened. No idea what this means and no idea how to fix it.

    But when I preview the game via my localhost in chrome on the mobile device it works fine (other than the Audio takes forever to catch up).

    I meant like acessing the html5 export via the web (exemple: dropbox) from the mobile browser

  • the reason people do not export for mobile using html is because a huge percentage of people use the stock browser that does not support webgl.

    if chrome was standard on android then there wouldn't be a reason for an apk.

  • the reason people do not export for mobile using html is because a huge percentage of people use the stock browser that does not support webgl.

    if chrome was standard on android then there wouldn't be a reason for an apk.

    So I just downloaded the cocoonjs apk file and installed it. Just gives me a black screen so I give up for tonight.

    I don't understand why Intel XDK gives me such bad performance? Is it the newest version that's broken or do I need to set the browser in the XDK to wrap it in?

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