Game lagging on Ipad 4, perfect on Iphone 5S

Discussion in 'How Can I...?' started by hegedusv, May 11, 2016.

  1. hegedusv

    hegedusv Boxer

    Joined:
    Oct 2, 2015
    Messages:
    50
    Likes Received:
    26
    Hi,

    I am making a game which is lagging during 2 scenes on Ipad 4, but when i run it on Iphone 5S it is perfect. I think i tried everything to make it run smoothly on ipad but nothing seemed to work.... Any tips ?
     
  2. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    Hi @hegedusv

    I have compiled this list in the other day
    1. Before any optimization make a copy of your project (backup, just in case...)
    2. If you can reduce or remove light effects -- those are cool but CPU hogs!
    3. If you use scale to reduce size (or increase), then resize the sprite images and use 1.000, 1.000 instead -- this part can take a lot of time if you used it heavily throughout your game
    4. If you use any Hue, Brightness etc modificators on your sprites, better to modify the graphics and reimport the images so no effects are applied
    5. Try to reduce number of objects
      1. Manually: If you have complex structures built up by multiple objects you might need to combine them to bigger block. My upcoming game has "bricks" and figured out if I combine bricks to 2,3,4,5 of them as separate objects I could reduce the number of objects greatly which helped on the perfomance
      2. Automatically: Tools -> Convert to Clones -- That can help too, maybe better to try this first...
    6. Do the usual image optimizations
      1. Tools -> Remove Unused Image Objects
      2. View -> Atlases -> Optimize, Optimize Atlases
    7. Make sure you have no more than couple of Atlases. I have 2, maybe I will have 3 by the time finishing this game. If you have more than 8 after Atlas optimization, probably you need to re-think if you need that much
     
    Christoph likes this.
  3. hegedusv

    hegedusv Boxer

    Joined:
    Oct 2, 2015
    Messages:
    50
    Likes Received:
    26
    Thank you! I think i tried all of this methods before :( none of them worked. And the thing is that the lag comes in only in one part of the scene, where there shouldnt be any problem as i checked it 100x times...
     
  4. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    Sorry to hear that. Have you tried to re-create the scene? How many objects do you have in there? It is quite hard to tell anything without seeing what is in there
     
  5. hegedusv

    hegedusv Boxer

    Joined:
    Oct 2, 2015
    Messages:
    50
    Likes Received:
    26
    I havent tried it yet, maybe i will recreate it. Its almost the same amount of objects as the other scenes. I cant show it now i am not at home. Maybe a recreation should fix it...
     
  6. hegedusv

    hegedusv Boxer

    Joined:
    Oct 2, 2015
    Messages:
    50
    Likes Received:
    26
    Or could it be the Ipads fault? I dont think so
     
  7. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    Nah, i test stuff on iPad 2 and if there are no crazy light effects there it works smoothly. And if there are crazy light effects BB automatically switch those off (runtime, so on slow iPad game is still playable, maybe with less juicy effects)
     
  8. hegedusv

    hegedusv Boxer

    Joined:
    Oct 2, 2015
    Messages:
    50
    Likes Received:
    26
    I just reread your tips, and i came upon the convert to clones solution. I havent tried it before, but will try today, as the maps in the game are made of small objects. I hope it will help!
     
  9. hegedusv

    hegedusv Boxer

    Joined:
    Oct 2, 2015
    Messages:
    50
    Likes Received:
    26
    I have an object which is functioning as a fixed object, but on some scenes it is functioning as a physics object. If i enable convert to clones, will it change the objects role?
     
  10. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,546
    Convert to Clones should only affect objects with all the same properties, except for size, position, scale and opacity. So in other words no, it will not affect the objects role. As noted by @trudnai always make a backup though as this process is not reversible.
     

Share This Page