When discussing my very modest game on TouchArcade, it was interesting to have this comment made about it.
Some effort was put into performance, especially in making sure the physics were smooth and reliable. Despite that effort, the greater portion of the quality comes from the quality code provided by the UT, OpenGL, and PhysX developers. When I read that remark though, it made me wonder how this user developed such an opinion.
Certainly, the user’s opinion was not entirely baseless. That he would dream up a dislike for Unity without exposure is ludicrous, so he must have seen some poorly performing titles which use Unity.
Hang in there, I will get to the point in the next paragraph.
Do other developers make legitimate efforts at performance optimization throughout development? With a very liberal interpretation of “optimization”, it would be shocking to not see every single team answer in the affirmative in one form or another. Since a user was apparently surprised, in a good way, at performance that must mean that some teams are not making sufficient effort to reach key performance benchmarks.
As a community, it seems important to me that we all try to make sure our games are reasonably good representation for Unity. If the Unity engine were to develop a bad reputation based upon too many games with unacceptable performance it would hurt everybody who uses Unity by association.
Basically, whenever I want to reach a coding milestone, I spill all the new framework as good as I can, and then add it an optimization timeframe to be proceeded one or two weeks later.
This prevents me from drowning into optimizations, and keep the project overview safe.
Although, at the end of the project development, I reserve a final deep optimization process (code + graphics + gameplay).
I want to recommend every new developer first test the game performance, then write the actual game.
So if you want to have 20 moving physical objects with 100 static physical objects in your game, create the scene with appropriate number of cubes with simple move scripts in Update, build for iPhone and test performance.
Do not use unity primitives other than cube (plane, cylinder, sphere) though - they contain way to much triangles to serve well for performance testing.
It would be very sad to discover you have 10 fps AFTER you spend lots of time creating complicated game logic, 3d models.
With 3d models, also first create just a sphere with N triangles, put K bones there, build and test. If your performance is good, continue with modelling actual character, if not - reduce triangle count.
Do not ask here on forum “How many triangles must I use on my character?” no one can tell you, just test with the sphere.
I commonly write “non stupid code” and follow basic guidelines during the development so I know that the behavior of the app won’t be “worsed” through my work. (cache components instead of recurring searching, don’t use script operations unless needed, only use as many Update as you need, …)
But the actual optimization of explicit code and settings is something I postphone until milestones that are complete enough to give me usefull benchmark data so that running it with the profiler defined on the iphone makes any sense at all.
General benchmarks about the doability of the project and potential restrictions are done in the prototype stage.