Need help, really speed... [UPDATED] with Apk examples

0 favourites
  • 8 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Guys, first and foremost, C2 is an execlent tool to make any kind of 2D games and I really love it.

    But whenever I try to create something, it gets so slow ... I know how to do optimizations that the logic becomes clearer and quickly but when exporting to Android, which is the platform I intend to work , the game become extremely slow . I've tried everything , but the final speed of a simple test application is very slow . I've done testing with several exporters but the speed varies very little and remains extremely slow. What can I do to make the game at an acceptable speed? About the conversion of the game to apk , is it encapsulated within some slow engine ? What this happening? When exporting to Windows and HTML 5 is VERY fast but exported to Android , is unacceptable . Please correct this because this tool is very good and fast to create games but this part about speed on Android should be treated more cautiously by the programming team . What can I do to solve this? Using the means we export ? Why the C2 does not generate its own apk directly converting your engine for Java + Android API ? Obs. I tested my apk in 3 different types of devices and the problem persists.

    Thank you all for reading.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I haven't tried exporting to android yet. I assume that apk file generated is a browser, running html 5 page as a game.

    If your game is also works slow on any kind of browser in your mobile device, after you export it as a html 5 website and tested by link, i think you cannot do too much for this. Altering graphics, animations and calculations may only help.

    Also if you didint used "effects", try disableing and enabling "Web GL" on your project properties while exporting to test if there is a faster way with or withouth it.

    while i said effects, sometimes making a sprite for an effect instead of using calculations gives alot of performance.

  • This problem comes up A LOT. This speed problem is a daily occurrence. Often the result of not enough research and a development practice not set up for mobile.

    Here are the development procedure and tips.

    1. Mobile devices are 1/20 the power of PC. If it runs great on PC there is no evidence the game will run great on mobile.

    2. If your game is going mobile. Your primary test device is mobile. Keep your mobile device hooked up to your computer. Develop a quick way to test on your device. And test on that. It's fine to test on the PC more often, but make sure that 1/4 tests are done on the mobile device.

    3. There are tutorials for both memory and performance tips.

    4. If you can. Keep your custom all the time update logic to 24-30FPS. You can do this by a EveryTick 0.0033.

    5. Batch common layer graphics into 1 or few Sprite Objects(ie all types of weapon fire in just BulletsSprite, All HUD elements in HUDSprite)

    6. I've mentioned this before. But it always bares repeating. Minimize your use of Plugins. Some Plugins have heavy overhead on mobile devices. I will give a sample. However these samples are device dependent. Newer devices handle more at one time.

    iPodTouch4G

    Rotation

    RotatePlugin. Graphic size made no difference. 20FPS on a 100x100 sprite, used 50% of the CPU

    EveryTick 0.0033. Set Angle + 8. Graphic size 2048x2048. 60FPS, used 15% of the CPU

    PIN Behavour(not actually pinned to anything, just added to the object)

    No Pins. 220 objects, 30fps

    With Pins. 60 objects 30fps

    *** so with pins, that don't do anything the game performance was cut in less than half.

    MoveTo(third party plugin)

    MoveTo, moving. 20FPS, 60% cpu usage.

    So I'm going to assume you

    Assumed PC and Mobile are close enough to the same power

    Didn't test regularly on mobile

    May have looked at performance tips

    Didn't consider logic FPS(really I only do this)

    Didn't batch your graphics into layered objects(most new users make 1 visual to 1 Sprite... kills performance)

    Probably overloaded your game with lots of behaviours

    My suggestion.

    1. Disable EVERYTHING and only enable 1 Layout(i suggest your simplest layout to start)

    2. Test your loader Layout on mobile.

    3. If it's slow. Go through your objects by disabling them until you hit 50+fps

    4. Re-enable until you find what slows down your game.

    5. Find a performance solution or ask the forums for a solution.

    6. If the problem is Fixed go to 7. If it's still slow go back to 4.

    7. Your Layout is running smooth. Go to next simplest Layout.

    8. Good luck

  • Hey jayderyu, thanks for your tips! I will try it out and redo my tests.

    But I was trying to make a simple physics game, very simple, and was very slow on my Galaxy, maybe I cant use physics on mobile using C2 ?

    See https://dl.dropboxusercontent.com/u/167 ... tRush.capx if you can find any wrong use of events.

    As you can see this is a VERY simple physic test.

    Really thanks!

  • Physics is very CPU-intensive. You can get good physics performance out of Android, but you need a cutting edge device (Galaxy S3 and up) and keep object numbers very low (low as in: maximum 20 or so).

    It's just how it is.. On high-end devices like the Nexus5 for example, the limiting factors decrease significantly. So over time the performance hit of wrapped HTML5 will diminish. Today, with devices like the Galaxy SII etc still around, you have to be extra careful, if you make apps based on wrapped HTML5.

  • Physics is very CPU-intensive. You can get good physics performance out of Android, but you need a cutting edge device (Galaxy S3 and up) and keep object numbers very low (low as in: maximum 20 or so).

    It's just how it is.. On high-end devices like the Nexus5 for example, the limiting factors decrease significantly. So over time the performance hit of wrapped HTML5 will diminish. Today, with devices like the Galaxy SII etc still around, you have to be extra careful, if you make apps based on wrapped HTML5.

    Yes I know abou this issue but I have the same game created with GMS (with more features) and with C2, bellow you can measure the two versions:

    Game Maker version:

    https://dl.dropboxusercontent.com/u/167 ... sh-GMS.apk

    In this version, hold your finger on the ball and pull.

    Run on all my test devices

    Construct version generated with IntelXDK:

    https://dl.dropboxusercontent.com/u/167 ... struc2.apk

    Very slow on all devices, perfect in windows and HTML5

    So the problem is not on the device it is in the C2 engine.

    Thanks a lot!

  • Could you please push an example of the GMS version using an HTML5 export. Then using the same Intel XDK apk?

  • I will try for sure, but GMS html5 code is not optimized to run on apk builders since GMS can make the apk itself, but Im so curious to see how fast it will be. Thanks.

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