retrodude's Recent Forum Activity

  • I noticed that alot of people have been having trouble getting there games to run on mobile devices, so I decided to convert one of my games to see how well I could get it to run. The original version of this game was 25mb in size with 158mb of memory usage. I was able to optomized this and bring the file size to 4.4mb and the memory usage to 29.2mb, however even with such a huge change the game still has issues running on android devices despite the memory usage of 29.2mb.

    The Phone I used to test the game was the samsung galaxy nexus, hardware specs can found online. I imagined a phone such as this could run a game like mine unless I made some major errors in coding the game.

    If you have cocoonjs on your mobile phone then try this link:

    dl.dropbox.com/s/ggjymf6b9n20mzj/jethero.zip

    I won't make a pc to phone comparison because I'm well aware how great the difference is between the performance of Pc to higher-end mobile phones is, but I'm assuming 29.2mb of memory should run fairly well. Once again, that's not the case for my app. Maybe it has to be lower?

    Here's the list of things I believe is important to make apps run to there maximum performance (this is mainly directed at my app:

    ->Backgrounds and sprite objects have been converted to PNG8, then resized (went from 1024 to 256)

    ->I don't recall any third party plugins except the clay.io plugin

    ->No physics object is used

    ->I deleted music/sounds from the project

    ->I used dt in the parts that I thought were most important

    ->Lots of groups have been used to ease up some of the programming

    ->blank space sprites have been resized

    ->Because this example is an endless runner I decided to use a different method then Scirra's example. Instead of destroying the platforms and respawning them, I have two platforms that simply leave the leftviewport and respawn at a different location changing in width, and X position everytime it changes to the right of the screen. I heard this saves on performance, but then again I'm not to sure.

    ->No sprite object/background is greater then 2048, however two objects on the canvas have a size greater then 2048 (however in editor its 1024x512)

    ->No webgl effects are being used

    Additional information that I found and think might be helpful:

    -->I believe I read in a post somewhere that 50mb of memory usage should be fine and fairly universal, anything below that should run fairly well (I think).

    -->Ram with the Mobile Os is usually shared, so you only get access to like something like 10% (it might have been 20%)

    --> Apple recommands to not go more than 20 mb or 20%

    -->Make sure you've apply dt in every equation where speed matters.

    -->Avoid using large sprites (images in the construct 2 editor that are greater then 2048)

    -->Pixel rounding should be on

    -->Use families to categorizes the sprite objects to simplify the programming

    -->And sprite objects with the same functions should be placed as one sprite object with more instances. For example, instead of using two sprite objects, use one that has both animations and create two instances of that same sprite object rather then using two sprite objects.

    If people are confused on what I wrote, then ask for clarification. I'll see if I can explain it better. I still don't have enough knowledge to fully understand the functions of C2 so I can't fully explain some things in great detail.

    But anyways I'm not really sure of the problem, and I'm not to fond in sharing the capx file unless Ashley or Tom would like to see it, however its still fairly messy even with groups. I'll probably recheck over it a bit later today to see If I can find any more problems or find ways to optimize the game further.

    If anyone wants to input anything else then post it here, or if anyone wants to verify anything above claiming its not true or inaccurate then post it here as well. I'll update the post.

    Edit**If this is in the wrong section, then I would appreciate it if a mod could move this

  • I agree with The cocoonjs splash screen is rather annoying and kinda ruins the experience for native apps because of how different its art style is compared to the apps your making. It just doesn't fit in too well and takes time to load. It also makes majority of the apps look more amateurish as you kinda have this random splash screen that is unrelated to the game, just randomly pop up. If only it was more customizable. But I'm assuming its left on there to get more coverage and advertisement, so other developers can become more aware of it.

  • Ashley

    Oh I see, that's good to hear then

  • 1) Don't worry about this. We handle it in the engine for you, so you don't need to worry about it when using Construct 2. Position, angle, opacity and size are not optimisation killers on many platforms too. See performance tips.

    2) Construct 2 does not impose any limit, so it's as many as the device hardware can handle.

    I thought the size of sprite objects affected memory usage, or am I wrong? I remembered have background images that were 1024x512, but then when changed to 512x512, I saved around 3-5mb of memory usage

  • I don't see the problem, I'm getting around 32-35 fps on my Samsung Galaxy nexus. Also your memory usage is perfect right now, however if you want to get the maximum performance then read over California's list.

  • I'm not sure if this helps anyways out but my sprite character had 100+ sprite frames and that took up around 25-35 mb of ram, so if anyone is seeing heavy memory usage, then check that out, also check over the sprite sizes on your sprite objects as well, the "sizes on the editor".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't just compare it to the amount of ram your phone has, because you have to share that ram with the os and other apps. I read somewhere that on iOS you only get access to like something like 10% (it might have been 20%, I don't recall exactly how much memory the device had) of the device's memory!

    Darn I almost foregot about that.. On Iphones, Samsungs and some of the newer phones (older ones too, I think) show roughly how much memory they are using on the device in the options menu, so maybe checking those can help give a better estimation?

    I'm too sure how to do it on iphone because I don't have one, but there are videos on how to check your memory usage, usually its in the options menu anyways. But even so, I still get high memory usage for my endless runner, so I'll revise over it and see if I can find a way to lower the usage.

  • Rhindon, np :)

    I'm not sure if I mentioned it here or a different forum post, but I was able to get more smoother gameplay for my app by changing my background images to an exponent of 2 (for example 1024,512, etc..) as it seems to save up memory usage. With the new construct 2 updates you can see how much memory usage your wasting by looking at the memory use at the bottom of C2. Now compare the memory usage of your game to the ram/memory usage of your phone and you should get a rough idea of how well your game will run.

  • Will this method work for mobile devices as well, or is it a completely different process for multiplayer on android/ios devices?

  • There are many reasons why games lagg on android devices and it really depends on the optimization you as the user do to save ram on android phones. Also keep in mind not all phones have the same specification, so could you tell us what kind of phone your testing on? Also as Ashley said, use cocoonjs to prototype the games on your phone, there's a dropbox method of doing this.

    I recommend reading this guide as well:

    scirra.com/manual/134/performance-tips

  • If your not sure how to store variables then post it here, and i'll help you out

  • 2.Maybe using Rojos canvas plug you can do something mystical and solve this, other then that i'm not to sure how to achieve this (also i'm to lazy to think of anyway to accomplsh this lol)

    3.For momentum all you really have to do is store a value for player speed (velocity if your going in different directions) times the mass, when the player collides with a portal. Then add another value such as the "fall distance" to the stored value and a physics impulse when the player exits the portal.

    So lets say you jumped off a cliff and landed on a portal, well I guess as the player is falling down, a global variable called "fall" would add 1 to itself until the player hits the portal. Then when the player collides with the portal, the variable stops adding 1. A physics impulse is then placed on the portal after the player changes to the new portal position, assuming we use one of newtons law then the force applied to the player plus the fall down variable, we should get some kind of force acting on the player and pushing it a bit higher depending on the impulse plus the momentum gained when falling.

    It is kinda tough but definetly not impossible

retrodude's avatar

retrodude

Member since 11 Oct, 2012

None one is following retrodude yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies