Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

iOS optimization

Discussion in 'iOS and tvOS' started by Prophet6989, Mar 3, 2016.

  1. Prophet6989

    Prophet6989

    Joined:
    Jul 8, 2012
    Posts:
    37
    We making strategy game for iOS, but we met the issue with performance. Game is 2D isometric strategy with big count of object and units. Now we have about 400 - 600 units and hundreds of buildings (in the main walls). Since game is isometric we need to sort all units and object, this breaks batches. Now we have about 1300 batches and 20-30 fps on iPad mini Retina.
    Following this article I first check if we limited by fillrate by running with smaller resolution (native is 2048x1536, I run game in 1331x998) and no performance change.
    Second I switch off sorting of objects, so batching can work properly. This drop down draw call count to ~400 (3 times smaller) but also no effect.
    So I can't understand what is bottleneck. Please help anybody. :(

    P.S.: All measuments make with profiler, Rendering taking 50-70% of frame time.
    P.P.S.: In Quality settings I remove all quality levels except one. On this quality level shadows is off, anti-aliasing is off, VSync is off.
     
    Last edited: Mar 3, 2016
  2. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    Did you try making an atlas containing multiple building textures?
    If all buildings are different ones and using different material, it will consume lots of drawcalls.
    Check your shaders, if you use multiple pass shaders it will consume multiple drawcall.
    Making an iOS game with a lot of units and building require to think of optimization when you make your game and not after.

    Simple way to know what is making time to draw is using the new frame debugger. It will show you what each drawcall is drawing so you can find ways to optimize rendering.
     
  3. Prophet6989

    Prophet6989

    Joined:
    Jul 8, 2012
    Posts:
    37
    Of course I use Atlases (Unity Sprite Packer) and there are no materials on sprites. New frame debugger is cool tool and I know what is eating draw calls. But need to sort ALL static object with units and static objects with itself cause breaking batching. And it's an issue. Also scene contains about 120k verts and 80k tris.
     
  4. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    Why update every frame all your buildings? You don't have to sort everything every frame if buildings doesn't move.

    You could update buildings only when it needs to be updated
     
unityunity