• 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
0
Question by Dreeka · Dec 10, 2011 at 08:56 PM · android

Performance

Hey,

I am creating a 3D marble rolling game to Android, and I am having some performance issues.

All of my levels (75) are running on 15-20 fps, no matter how many object are on the screen (between 10 and 100). Even if I turn on anti-aliasing, the performance only drops a few fps. Because of this, I think my code is unoptimalized.

What do you think, can an unoptimalized code cause big performance drop? If yes, can you give some tips abouth code optimalization?

Also, I am using iGUI, which is using unity's onGUI function. Can that cause a problem like this? If yes, what GUI system should I use?

Comment
Add comment · Show 7
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 FLASHDENMARK · Dec 10, 2011 at 09:26 PM 0
Share

I have heard(not sure) that the built-in GUI system is really slow on mobile devices.

avatar image Jason B · Dec 10, 2011 at 10:19 PM 0
Share

Just wanted to mention that I personally have been using a "roll my own" system for all my games where my GUI consists of textured planes that are viewable on a second orthographic camera. I develop PC games though, not iPhone games, so I can't say whether or not that'll be a faster solution, but it certainly gave me more freedom, and the performance is just fine. $$anonymous$$eep in $$anonymous$$d though that you'll want to model your own 2-triangle planes rather than Unity's built-in planes that have like 100 triangles.

It takes some extra work, yes, however you get the added benefit of the HUD setup being completely visual. If elements aren't in the right spot, you just move them around in-world, and since they're just 3D objects like any other, you don't need to do any fancy calculations for varying resolutions.

This is only going off the assumption that the built-in GUI is the problem.

Have you tried disabling physics to see if your ball rolling physics are causing the FPS drop?

avatar image Eric5h5 · Dec 10, 2011 at 10:41 PM 1
Share

I don't know if Android has a profiler like iOS does, but if so, use it.

avatar image asafsitner · Dec 11, 2011 at 12:22 AM 0
Share

Also, yeah, Unity's OnGUI method causes huge garbage-collector spikes (up to 99.9% of available resources) and quite often causes noticeable drops in framerate. Even an empty OnGUI() call in your code will result in GC spikes.

Other than that, Unity has published some tips on optimization: http://unity3d.com/support/documentation/ScriptReference/index.Performance_Optimization.html

avatar image Dreeka · Dec 11, 2011 at 10:16 AM 0
Share

Thanks for the replies. I have optimized the scripts, now working on the rendering performance.

Also, is there any way to print the current fps to the screen? And how many is the ideal draw calls 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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Restart App on iOS and Android 0 Answers

When Black Screen android issue is going to be fixed? 1 Answer

Accessing Data from a Android java class 1 Answer

IOException : Failed to Move File / Directory 4 Answers

APK size question 0 Answers


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