iPhone frame rate problem

Hi All

I am making one running game it’s having one robot and it runs inside a room . Room are creating dynamically to continue the loop and they will be deleted after the camera passes them. Here I am getting only 95-100 fps, Emulated Draw Calls: 45,Editor Draw Calls: 85,Tris: 33k
So I removed all the walls and roof of the room now its Emulated Draw Calls and Editor Draw Calls are reduce to half even the frame rate is same.

How to increase the frame rate of my game?

The maximum frame rate of the iphone is 60fps, if your game is running at 95-100fps, then I think you are in pretty good shape.

if he has 95 - 100 FPS in the editor though it could very well be dieing pretty well on the device.

the performance in the editor is of really no use, you must test it on the device.

I tested on the ipod(second generation) here I am getting only 12-15 fps.

I removed my character (Robo) and I placed First Person Controller now Tris reduced to half(32k to 17) even the frame rate is same (95=100 in the editor)

To much…try optimizing your models until the current scene visible in the viewport dont goes above 10k vertices. And very important: the less drawcalls the better. Should be below 20 for 2’nd gen device.

The frame rate is always 95-100 in the Unity iPhone editor (unless it goes below that). You can’t use it as a measurement for anything; the only thing that matters is the frame rate on the device.

–Eric

I recommend you turn on the Internal Profiler in the generated Xcode project. The specific line you are looking for in AppDelegate.mm is as below, and set its value to 1

#define ENABLE_INTERNAL_PROFILER 1

That will return millisecond timings for various pieces of the rendering pipeline to the debugger Console as you run your project. Sample output looks like

As far as the frametime millisecond calculations go, your FPS = 1000/fpms…the purpose of the exercise is to see if an obvious bottleneck in the pipeline stands out – as you bring down that workload, fps will go up.

There are numerous articles, tutorials, and threads here on optimizing your scripts and getting FPS up. I’d search both the forum and unityanswers.com. Two quick ideas that will give you an immediate FPS boost if your code is in need of these optimizations:

a) cache all your Component lookups in Start Functions.

private Transform thisTransform;
private Rigidbody thisRigidbody;

void Start()
{
     thisTransform = transform;
     thisRigidbody = rigidbody;
}

b) remove all Debug.Log() and print() statements, or otherwise create conditionals where you can toggle them ALL off to obtain true FPS readings from your app as it will be submitted to the AppStore. They are confirmed FPS killaz :slight_smile:

Hope this helps, BK

20 drawcalls on a gen 2? Sure… if you’re happy with 30fps (which nobody in their right mind is).

Keep it under 10 for anything that will look more slick smooth :slight_smile:

Try to share materials between your models. If say you had 4 robots that were skinned off the same 1024x1024 texture sheet (divided into 4 sections, one for each robot) then Unity should be able to batch those into a single draw call.

Same goes for any other models. More separate textures = more materials = more draw calls.

Depending on the poly count, anyway. Objects with <300 vertices using the same material will batch. Otherwise, they will not.

Though it can be quite a design challenge to do so, I generally try to ensure an entire level never exceeds 2 drawcalls (2 materials, all marked as static geometry will typically get this done)