Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Jakecode · Feb 19, 2015 at 05:42 AM · c#android2dspriteperformance

What can I do to further optimize mobile game? (2D)

Hello,

I'm creating a pretty simplistic puzzle game with lots of boxes the player can move around. Complexity of the scene should be somewhere around bejeweled. However I'm getting really atrocious performance on mobile devices, here's stats.

Android Unity internal profiler stats: cpu-player> min: 64.6 max: 90.1 avg: 71.3 cpu-ogles-drv> min: 0.5 max: 3.2 avg: 1.2 cpu-present> min: 0.0 max: 0.5 avg: 0.1 frametime> min: 65.7 max: 91.0 avg: 72.5 draw-call #> min: 34 max: 34 avg: 34 | batched: 75 tris #> min: 186 max: 186 avg: 186 | batched: 150 verts #> min: 372 max: 372 avg: 372 | batched: 300

player-detail> physx: 0.5 animation: 0.0 culling 0.0 skinning: 0.0 batching: 29.8 render: 35.5 fixed-update-count: 3 .. 5

mono-scripts> update: 0.1 fixedUpdate: 0.0 coroutines: 0.0

mono-memory> used heap: 385024 allocated heap: 643072 max number of collections: 1 collection total duration: 6.2


The statistics window in unity shows ~33 drawcalls, ~60 saved by batching, 144 tris, 288 verts.

Majority of the stuff (the boxes) is contained in a single spritesheet, sprite mode Multiple, it has a packing tag, max size 1024.

I have enabled Dynamic batching, Multithreaded rendering (no crashes yet at least) from the build options and Sprite Packer is set to Always Enabled in the Editor Settings. However none of these seemed to affect my performance much.

Each object I draw is a separate gameobject with spriterenderer, they share the Sprites-Default material however. The scenes have 60-100 of these gameobjects (if this is the culprit, is there a better way?)

By my understanding all my sprites should be rendered with minimum drawcalls and overhead. If anyone knows what I'm doing wrong I'd be thankful.

Comment
Add comment · Show 9
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · Feb 19, 2015 at 12:03 AM 1
Share

$$anonymous$$aybe I'm being blind but point out the really atrocious bit.

avatar image Jakecode · Feb 19, 2015 at 07:47 PM 0
Share

Frametime being ~71 when nothing is happening and often climbing to around 100 means about 10 fps. Touchscreen really does not feel responsive and the game is very jerky.

avatar image DanSuperGP · Feb 19, 2015 at 08:52 PM 0
Share

I'm trying to figure out why your CPU usage is so high with only 34 draw calls... It says your scripts are very fast... 0.1 in update is almost nothing...

avatar image ByteSheep · Feb 19, 2015 at 08:53 PM 0
Share

Looks like batching is whats taking up the most time on the CPU.

avatar image ByteSheep · Feb 20, 2015 at 12:31 AM 2
Share

Interesting, your game appears to be CPU bound, but the internal profiler isn't giving enough information to account for the extremely high frametime. Since batching apparently isn't the problem, perhaps it would make sense to use another profiling tool.

I'm sure there are tools similar to xCode's instruments available for android.

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Choppy Character Movement Unity 2D 0 Answers

Best way to do touch in with Unity2D? 0 Answers

How can I set the position and size of a sprite from inside a script ? 1 Answer

Way to have 2D Sprites lit by Lights? 3 Answers

2 problems when workin with sprites on Unity3D 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges