How weak is ios, I have heard that it takes alot of time to optimize. Although, since I have unity free, I cannot profile. Do you think that a game that only uses destroy, once, and has about 1000/2000 lines of code in the whole game, enable/disable gui scripts, and 100+ frames per second on a fairly weak mac mini(2.53 duo, 4 ram, and 256 gfx card at 1024x768) needs to be optimized very much(also the levels use mesh colliders but are small, but box colliders just dont work for the cause). Also any pointers on how to make it even smoother.
How weak is Windows? What do you mean it runs on different hardware? All lies.
Try it on the lowest spec target device and see if performance is acceptable.
Its very difficult to say much more really… Everyone will have different levels at which they deem something “acceptable”. Some things may be considerably slower on the device. I seem to remember overdraw being particularly expensive. I think draw calls are also considerably more expensive on mobile devices.
As for number of lines of code; it really depends what you have them doing and how efficient they are. You can write an infinite loop in one line of code, after all.
1.) Firstly, I suggest you read and implement the advice in:
- http://docs.unity3d.com/Documentation/Manual/iphone-PracticalGuide.html
- Unity - Manual: iOS-specific optimizations
2.) “…has about 1000/2000 lines of code in the whole game…” Completely irrelevant. It’s what those lines of code do that matters.
3.) “… enable gui scripts…” Are you using the inbuilt GUI.xxx functions? That’s an absolute performance killer on every platform and, from what I understand, nobody really uses them in production applications. Investigate some of the other GUI platforms on the asset store (NGUI seems to be the de factor choice, but there are alternatives)
4.) “…How weak is ios…” iOS is the operating system. What matters is the hardware on which that OS is running: an iPhone 3GS and the fourth gen iPad both run iOS, but have vastly different performance.
5.) Finally, the only reliable way to tell whether your game has “acceptable” performance or not is to run it on actual hardware. No amount of profiling is a substitute for that.
I have done quite a bit of research on it, as I’m in your shoes as well and can tell you that graphics and physics seem to be the 2 big killers.
-Anything that you can do to keep the amount of textures/materials to a minimum. Look into static and dynamic batching of draw calls. Try keeping draw calls under 30 by sharing materials amongst as many objects as possible.
-Bake your textures instead of using process heavy methods such as normal maps when possible.
-Try not to use those mesh colliders you’re talking about unless absolutely necessary, I’ve heard they are quite expensive ( unless of course your mesh is somewhat simple ).
-Limit the amount of active rigid bodies in your scene….
That’s to name a few of the major players… Oh and customize shaders to do only what you need as built in shaders can have over and above what you need, especially the surface shaders.
Hope that helps