I’m making a game where I push the iPhone to it’s limits. Second gen iPod actually. Right now I can’t get more then 25 fps. I need to get another 5. I’m pretty sure I would get it on a 3GS but I don’t want to limit my potential buyer’s pool.
The geometry is optimized and can’t be change.
There’s a lot of collisions (It’s a maze!)
I tired with and without textures, no noticeable changes.
I tried different shaders. Best results with Vertex Lit.
I tired with and without lights. no noticeable changes.
I don’t have a lot of scripts and they are quite simple too.
Here are the stats:
Editor Draw Calls: 49
Batched: 41
Emulated: 12
4 textures. one is 512x512, two are 256x256 and one is 128x128, all compressed. But as I said, even without textures at all it doesn’t make a very noticeable difference.
Tris: 32.2 K and verts 18.6k (Yep, ridiculously high but I do get a steady 25 fps so far. I’m actually quite impressed to get that.
I changed the accelerometer setting to sample every 10 times per sec instead of 60. I set the FPS at 30. I use the THREAD_BASED_LOOP approach.
In the physics manager I changed the Solver Iteration Count to 1. no noticeable changes.
So what else can I try to optimize?
As for losing 10 kilos I guess stopping eating Oreo cookies, do more exercise and spend less time in front of my Mac would help.
Can you put the textures into one texture atlas, and use one material for everything? This will require you to change your uvs, but you could script that.
Before you change all your uvs, just replace all materials with one material, and see if it goes any faster.
I thought about combining the textures but there’s a problem in one of them. I tile it 4 times and I can’t find a little space to combine another texture with it. Anyway even without any textures I still get 25 fps so it’s not going to help much.
I only have the base surface (the maze itself), the thing that goes through it and some stuff that you can pick up (money, bonuses etc) that are actually just a simple square poly. Nothing I can combine. Since theses bonuses all have the same shader they already get combined in the drawcalls.
What kills me it that collisions only happens according to the normal of the polys. So the collision only happens on the visible side of the polys. Since I can’t render both sides I have to double my walls, invert the normals and merge them with the original walls to cover both sides. That doubles my poly counts. If there was an option to make the collisions on both sides of the polys that would help me a lot.
Your poly count really shouldn’t have to be that high - are you culling any part of the scene at any time? And if you’re using mesh colliders with dense meshes, that’s extra bad. I’d try disabling your colliders to see if that’s the main bottleneck, or if its simply rendering-bound. As for limiting your audience… hate to break it to you, but you already have, even if it runs at 30fps on itouch 2nd gen, you’re already eliminating a massive percentage of the market. Excluding iPhone 3G or 2G is unwise, but from the sound of things you’d have to completely redesign your game to get an acceptable framerate on those devices.