BlockLeftTop, PRELOAD BlockLeftBottom, PRELOAD BlockLeftStretch, PRELOAD BlockTop, PRELOAD BlockBottom, PRELOAD BlockStretch, PRELOAD BlockRightTop, PRELOAD BlockRightBottom, PRELOAD BlockRightStretch, PRELOAD
Latest Game

Increasing performance on the iPhone

by Ferdinand Lange 20. March 2009 10:14

After finding our game not running as fast as we expected, I dedicated the last 3 days of work on finding ways to increasing the performance.

There are 2 issues which have a heavy impact on the framerate. Drawcalls and Physics.
Both have several roots and solutions.

For the graphics part you should decrease the drawcalls as much as you can. Since every object has its own drawcall it doesn't take too long to have several hundreds of themm, which is by far too much. What you want to do now is combining them. Basically telling Unity to draw them as one object. This only works for objects that share the same material, so you might consider using the same texture with some fancy UV layouts for several objects. You start by creating an empty gameobject and assigning the desired objects as its child. Next you need the CombineChildren script, which is found in the Standard Assets.unityPackage and assign it to the gameobject you created earlier. Tadaa, all those objects will be drawn in a single drawcall now.
If you're working on a 2d game you also might consider using the SpriteManager class, which is a convenient way to draw lots of sprites in a single call. It supports UV-Animation, Billboarding and other goodies you might enjoy.
You can optimise your lightning by creating lightmaps for your meshes in your 3d composing tool instead of using dynamic lights, since Unity has no baking function.
Another rather unlikely scenario is a too high polycount. But remember just in case: it's an iPhone, it has a tiny display, you won't even see that much of a difference between 500 and 2000 poly characters, and even if, it's still just a phone. :)
That said you should be fairly well if you stay within this stats:
Drawcalls < 30
Polycount < 10k

As for the physics, if you're using a lot of physical objects, you should consider using the simplest collider you can (e.g. enabling Convex mode on MeshColliders, using SphereCollider instead of BoxColliders)
If this doesn't help, you have the possibility to decrease the precision, or increase the collision checking interval. Head to the Menubar>ProjectSettings>Time and increase the Fixed Timestep. Remember that decreasing the physics precision can lead to penetrating objects, objects getting stuck in each other, and other graphical impacts, so you should thoroughly test which works best for you. If you still want to get more out of it you can consider slowing down your gameplay. While doing this you can increase the Fixed Timestep even further.

Fixed Timestep Defaultvalue: 0.02

That sums it up. You can find more detailed explanations and help in the Unity Forums and the irc channel #unity on freenode.org

Happy coding

Comments


3/19/2010 1:23:12 PM #

People in all countries receive the <a href="lowest-rate-loans.com/.../personal-loans">personal loans</a> in different creditors, because that is easy.

Carmela34Mueller | Reply



4/28/2010 6:20:53 AM #

I\'m happy I found this blog, I couldnt discover any info on this subject matter prior to. I also run a site and if you want to ever serious in a little bit of guest writing for me if possible feel free to let me know, i\'m always look for people to check out my site. Please stop by and leave a comment sometime!

Rapidshare | Reply



4/30/2010 11:42:26 AM #

Only those who dare to fail greatly can ever achieve greatly.

payday loans | Reply



5/4/2010 10:40:45 PM #

After finding our game not running as fast as we expected, I dedicated the last 3 days of work on finding ways to increasing the performance.  There are 2 issues which have a heavy impact on the framerate.  Drawcalls and Physics.

Rapidshare Search engine | Reply


Add comment




biuquote
  • Comment
  • Preview
Loading



Disclaimer: The opinions expressed in this blog are own personal opinions and do not represent the companies view.
© 2000-2010 exDream GmbH & MobileBits GmbH. All rights reserved. Legal/Impressum

Recent Games

Fireburst

ArenaWars Reloaded

Jobs @ exDream

Current Poll

Do you know what the Delta Engine is?



Show Results Poll Archive

Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

Blogs

Download OPML file OPML