User Tag List

Results 1 to 8 of 8

Thread: Optimization suggestions for ipad2

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,261
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)

    Optimization suggestions for ipad2

    I've run into some baffling frame drop issues on ipad (and to a lesser extent, iphone5). My game involves a single screen environment where an object bounces around and rams into things (think billiards). The engine uses pure math to deal with object collision and deflection. The collisions are just radius checks that use the Advanced Direction Object to get distance every frame the player object is moving (using a For Each loop). I can have anywhere from 6 to 20 objects for the player to calculate against.

    On ipad2, I am seeing a pretty consistent drop to 30 fps when the player is moving or when the object count increases to anything over 5 or 6 objects. I have tried disabling all my collision routines but there seems to be no affect. No matter what I do to regain frame rate, nothing seems to work. There are even times when just sitting idle on the screen causes a drop to 30 fps. My general object count at any time is around 200 in the debugger.

    I should also add that the game is at 160x240 window and 180x284 frame resolution. The assets are tiny, ranging from 16x16 to 48x48 for normal objects. The background is half the size of the frame and tiled once.

    I have done the following to try and optimize:

    1. Color Reduction: ON
    2. Group all loops and enable/disable them as needed.
    3. Create object (like bullets) at Start of Frame and keep them in a pool offscreen. This is to avoid too many create/destroy actions, although I saw a slightly worse frame rate when I did this.
    4. Direct 3D 9: ON
    5. Vsync: OFF

    Can anyone suggest a more direct way to track where my problems are coming from? Is anyone at Clickteam able to run any sort of profiler to see where I am being inefficient? I have spent 3 days now toggling different groups of my code on and off and I am not seeing any real change.

    Any help is appreciated,

    Reg

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,111
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Even though the iPad2 is 5 years old.. I'd expect it to run fairly well.. what version of iOS is it running? Have you tried making sure all other apps are closed and see if it effects performance? It might be a background app ruining things for you.

    I don't think Direct 3D or Vsync have any bearing on the iOS runtime.. if anyone knows for sure that'd be nice to know.. probably not much help.. but some possible things to try:

    -- (if possible and not already done) Reduce the color depth from 16 million to 32,768
    -- turn off "use fine detection" on all objects that don't need it (sounds like very few will need it in your case)
    -- remove all the sound from your app to see if sound is causing an issue (I've had sound file related lag before)

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,261
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    Some things to clarify:

    -- I am using iOS6 on this ipad2 since it is my iOS6 testing device. I am not sure if the OS really plays a part in the speed of the apps, especially since upgrading to iOS9 now would almost definitely result in the device running slower overall.
    -- Almost no actives use fine detection, so I don't think that would be a problem. Also, there are very few overlap conditions since almost everything is a radial distance check.
    -- All my sounds are called from an external folder for PC testing. This means there are no sounds in the exported project. But the code that is trying to call them still exists. Could that be a problem?
    -- I have read various posts saying Vsync can have an affect on app frame rate, so I thought I would mention it.

    Changing the color depth of the app didn't have any affect. Since my game is pixel art, I can keep that setting though. :P

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,336
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    If you can't find what's pressing the FPS down, make a debug system where you can turn off chunks of code and destroy objects at runtime. That's usually very helpful to me

    What I always do for optimization on iOS and Android.
    - Set FPS to 30 (this removes most fps problems).
    - Have as few active objects as possible on screen. (For my current game with much going on, around 50-60 64*64 sized objects (that does nothing), is the limit before it drops directly from 60fps to 30fps on my iPad 2, while on my Android it gradually reduces fps depending on number of actives.)
    - Don't use nested fastloops in always events (or at least reduce the use heavily).
    - Don't use ForEach loops for more than 5 objects at a time (iPad2 might handle a bit more than this).

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,261
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    I have been disabling entire groups of code and re-exporting, but with little luck. Since I don't think it is related to any one system in my game, I am hoping someone from Clickteam might chime in and offer advice about any smaller things that could affect framerate. I can try making a more robust system that works at runtime, but it seems a bit tedious considering how complex my code is now.

    - I need the game to be 60fps. It just feels a bit off at 30, especially since it is a fast action game. And the times when I do get full framerate, it feels infinitely better.
    - Sadly, I have a bit of ui necessary for the game which adds up fast. This includes enemy lifebars, lifebar backgrounds and shadow spots (non-transparent). I guess I could try removing these to see if the framerate improves. I also have treasure that spawns when enemies are hit. These are scaled up and then down as they move to simulate them "popping up" toward the player (it is a top down view). I thought maybe the scaling operation was a problem, but the frame drop happens when no treasure is even visible.
    - I have actually removed all nested loops, but found no improvement. And I only have a single Always event --> setting a bitmap counter to the framerate.
    - As for ForEach loops, I made a conscious effort with this game to use them almost exclusively due to the evangelizing of them by most people on the forums. If using normal loops will actually benefit me here, then I wish it was made more clear int he documentation that ForEach are not as optimized as everyone claims. I will try swapping my ForEach loops to normal fastloops today and see what happens.

    Can anyone comment on whether having a pool of inactive objects offscreen will harm their framerate? I saw a bit of a drop when I switched to using a pool for enemy bullets. I keep 80 of them in a pile at -50,0 so I don't create/destroy them all the time.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a not of AAA games that still uses 30fps......of course 60fps is much more "fluid", but you can make a good game using 30fps, you will just need to double yours speeds (animations, movements...).

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    arthurh's Avatar
    Join Date
    Sep 2010
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    difficult to answer you mobichan. Try to test if it is a group call that decrease the framerate. This is the case for me : i lost 15-20 fps when a certain group is open (tutorial). Try to desactivate a group at once to detect what group is the problem...
    Sorry to not help you more

    Ah and try to make 32x32 instead of 48x48. Make a zoom to the 32x32 item to have the 48x48 you want and see if you always have the lost fps. 48x48 this is the same than 64x64

    good luck mobichan !

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,261
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    So after disabling everything and then re-enabling things one at a time, I think I may have found the major issue. I do have one nested For Each loop inside my movement fastloop. It is doing a distance check every movement loop on all objects (8 objects in my test case). But since I am needing to do this distance check, I can't think of a way to do this differently.

    Can anyone offer an alternative way to keep checking distance with every movement update? This seems like a pretty big limitation. And I don't think I ever ran into anything like this on Slayin, even though I had plenty of nested loops that were way less efficient.

    EDIT: I am starting to think that just displaying the fps in a bitmap counter is a major source of slowdown as well. Although I don't know why the fps dips for a second or two and then returns to 60fps during the player movement loop. The distance check is done every frame during movement, so I would expect frame drop to last the entire loop.

Similar Threads

  1. Optimization on my iOS Game ?
    By MagnetoX in forum iOS Export Module 2.5
    Replies: 8
    Last Post: 30th July 2015, 11:21 PM
  2. iOS & Ipad2 ?
    By equinox in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 27th January 2012, 10:04 PM
  3. My wife just came back from the shops with a shiny new iPad2!
    By mrmdesign in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 29th December 2011, 11:50 AM
  4. MMF2 iPad2 question
    By Drcooper in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 4th July 2011, 12:55 PM
  5. Optimization
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 9th June 2009, 11:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •