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. Dismiss Notice

Question about Unity2D Animations and Draw calls

Discussion in '2D' started by Ezwrath, Jul 8, 2014.

  1. Ezwrath

    Ezwrath

    Joined:
    May 17, 2014
    Posts:
    8
    Forgive me if a question like this is already posted, but I could not find a similar thread.

    I am currently working on a 2d platformer dungeon game for IOS, and have read that for optimal gameplay, I should not be above 30 draw calls. I do know this applies for different devices, however I do want to set my draw call cap to 30. Previously, I made my animations through the creation of sprite sheets in blender, where my characters only consist of 1 image therefore 1 draw call. However, this method was tedious and the use of sprite sheets had made my project's file size increase significantly.

    I decided to instead use the Unity animation which no longer requires the need for sprite sheets. This method seemed significantly more efficient in terms of both space and speed.
    However, this would leave most of my characters to have roughly 7 body parts which is 7 draw calls. If my player were to enter a dungeon, and he was surrounded by at least 5 enemies, my draw calls would be approximately 35, excluding GUI, foreground and other background layers.

    My questions are
    What is the optimal project size that my PC should have for an Iphone 3,4, and 5 app? In a scenario, if my project is to be worth 2 gigs compared to 5 gigs, how much of an effect will this impact the app size? If I were to use the unity animation having all characters consist of body parts, is there a way to reduce my draw calls through such methods as batching?
     
    Last edited: Jul 8, 2014
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,738
    If you use Unity's sprite packer. If you put the same packing tag on all 7 body parts, they will be put into the same atlas and will only use one draw call. All your enemies (if they are in the same atlas as each other) would be merged into a single draw call as well. There are situations where things on the same atlas get put into different draw calls (usually if, in layering, there is some other object that is in between them) but usually same atlas = same draw call. The more things you can sensibly put into one atlas, the better off you'll be.


    It's difficult to use project file size to predict final build size; my current project folder is over a gig, and the build for iOS is under 14 MB. You really just have to build it and see.
     
    Ezwrath likes this.
  3. Ezwrath

    Ezwrath

    Joined:
    May 17, 2014
    Posts:
    8
    Thank you Starmanta, this clarified a lot :D