Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Optimizing iOS performace...

Discussion in 'iOS and tvOS' started by Deleted User, Sep 10, 2012.

  1. Deleted User

    Deleted User

    Guest

    Hello. I am encountering major frame rate issues when I run my game in the iOS simulator (and the device is set to a retina display iPhone). My game is relatively simple so I decided to look at the Stats when I am testing the game (inside Unity) and see what I am doing wrong.

    Here are my stats when running the game:
    -Averages about 10-13 draw calls at once, with 0 of them batched
    -Used Textures 8 - 4.8MB
    -Tris peaks at about 600, Verts at 1K
    -VRAM usage is 7-12
    -VBO Total 28-170 KB

    My Player Settings are as follows
    -Dynamic Batching is set to false
    -iPhone only
    -armV6
    -Target Resolution : HD
    -The Accelerometer is turned off

    What numbers should I be aiming for (i.e how many triangles should I try to not go over)? Am I using the "correct" build setting? Does anyone want to share any of their tricks for getting more out of the iPhone for less power?

    Thanks
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Screenshots help. But there's not enough information there for us to help you. I'd like to know why Dynamic Batching is turned off. Also it could be your shaders.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That can never be answered definitively, because it depends on the hardware and what you're doing with the triangles (shaders etc.). Look at the profiler and see what it says, then try to concentrate on the areas that have the highest times.

    --Eric
     
  4. Deleted User

    Deleted User

    Guest

    http://imageshack.us/photo/my-images/441/iossimulatorscreenshots.png/
    Here is a picture from the iOS simulator. I turned off dynamic batching by chance (It sounded like something that would take up more power). Almost all of the materials in my games are using the Transparent>Diffuse shader. I'll try setting up remote profiling tomorrow and see what I can learn from that.
     
  5. timintal

    timintal

    Joined:
    Jul 23, 2012
    Posts:
    8
    I think there is problem not in your game, but in IOS simulator. For some reasons IOS simulator iPhone Retina iPad cant run with framerate more than 30. Just remember, never test your game performance on simulator, its a general rule. Try to test it on real device, and you see really BIG difference.
     
  6. Jtbentley_v2

    Jtbentley_v2

    Joined:
    Sep 5, 2012
    Posts:
    174
    Yeah, that doesn't look too taxing, even if you've chosen sub-optimal shaders.

    Dynamic batching is a must for a top down shooter, so don't be afraid to leave that on. As Timintal said, you shouldn't test it in the simulator, it's not a very good judge of performance.

    We managed to get a shooter working with only 4 draw calls total (pre-Unity days) because one of our coders here is the code version of Jesus :) But 13 draw calls shouldn't be an issue either.
     
  7. Deleted User

    Deleted User

    Guest

    After waiting at the initial loading screen, the app crashes. With nothing in the way of error shown in the xcode console. This happens when I am trying to test it on a 4.2 ipod touch (2nd gen...I can't use my iPhone 4 because it has 5.x installed and I do not want to upgrade to the required xcode version, which would require I upgrade to os x 10.7 or higher...which I will not do because that causes several pieces of third party software that I use to not work...yeah I know that was a long explanation).

    If I was to zip/post my xcode build, would someone be willing to try it out for me?
     
  8. Jtbentley_v2

    Jtbentley_v2

    Joined:
    Sep 5, 2012
    Posts:
    174
    A gen2? Can you even build to those anymore?
     
  9. Deleted User

    Deleted User

    Guest

    I don't know. That would get rid of one of my problems. As for being unable to test it on an iphone 4...would anyone be willing to? You don't have play it for a long time, just boot it up, hit play and see if the frame rate is not choppy.
     
  10. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    I still test updates to my old game on an iPod Touch 1st gen. Still works with the latest Unity 3.
     
  11. Jtbentley_v2

    Jtbentley_v2

    Joined:
    Sep 5, 2012
    Posts:
    174
    I believe Apple is now dropping support for anything prior to fourth gen on both ipod and iphone.
     
  12. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    You can't be building HD res as a 1st gen ipod / iPhone is not HD.

    If you like I can test on 1st gen iPod and 4th gen iPod: just this once.

    Should I update to the iPod 4th gen to iOS 6 first? When is Unity fixing the basic license issue with iOS6 and xCode 4.4.5?
     
  13. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Yes this is true too but you're wrong about '4th gen' They are going as far back as iPhone 3GS.

    Basically they are dropping support for arm6 / GLES 1.1. If it's arm7 GLES 2.0 it will be supported (for how long who knows).

    Does dropping 'arm6' officially start with the ability to target arm6 / GLES 1.1 in xCode 4.5.5 or not? Has anyone tried the newest xCode?
     
  14. Jtbentley_v2

    Jtbentley_v2

    Joined:
    Sep 5, 2012
    Posts:
    174
    I'm on the newest Xcode, but we haven't supported (well, Mini Motor) never supported Arm 6, i think one of our other apps still supports it though.

    I don't mess with xcode much anymore, i just set it from within Player settings to not support the platform.