Undefined performance issues

Hello,

while developing BeGone (http://forum.unity3d.com/viewtopic.php?t=9551) we noticed small glitches in performance sometimes appearing while playing the game. As we progressed to the final stage - it seemed that performance problems appeared more often. And the weird this is that they appear in a random basis. Sometimes the game runs really well, sometimes it runs terrible (like 10 fps or even less). The most common performance issue is that it slows down to like 1-2 fps randomly during the gameplay. For example when you move the camera quickly or shoot (shooting is only one ray-cast for collision detection).

We cleared out that it is not a graphical performance issue, because with full detail quality on and with lowest quality on - the performance is somewhat the same - but the gliches appear is the same random basis.

(Funny fact: the game runs like 10 fps on a GeForce 8800 Ultra GPU + QuadCore Intel CPU all the time, no matter the graphical details, dunno why).

We use some physics in the game, but I tried to lower the timestep value, but it did not make any difference, just corrupted the object movement in the scene.

Can this be because of the networking complexity? Because our network system is kinda complex and maybe it is the part we should put some work into? Or could you suggest any other parts we should see through?

Also there are major issues with different browsers - I shall collect all the problems into one list and make a post soon :wink:

Hope you can help! We have almost finished the game and these problems seem to be the only obstacle stopping us from releasing it :wink: We really can’t wait :smile:

Justinas Vilimas

Until we get some built-in profiling tools, I’d suggest doing this:

  1. on the Mac, download XCode development tools, or just CHUD (from Apple). It has a profiler named “Shark”.
  2. build a standalone Mac player, with “strip debug symbols” off
  3. run it through Shark and see where the time is spent.

It will show internal class/function names for Unity engine, but often it’s quite easy to guess. E.g. “RenderAllCameras” probably does rendering, and “FixedUpdate” probably calls FixedUpdate on your scripts. Mystical code without debug information is most likely JITed script code (i.e. your scripts).

Can also try memory allocation profiling, to see where you allocate lots of memory each frame, and pauses in that case could be caused by garbage collection.

We have some documentation on optimizing script performance. Also checkout Joe’s performance talk from Unite.

Thanks for the info!

I guess I will have to spend some time optimizing the scripts - did not think that they could reduce the performace so drastically and in such a crazy way :slight_smile: