Tips about otimization

I searched for all internet questions about otimization and performance in 2D games and i found questions like overdraw and shader alpha blend / alpha test. I’m making a 2D game using 2D Toolkit and i tried so hard to obtain 60fps on iPad 2, and i got just 30fps. In my scene i have about 5 layers like parallax and some compressed textures which looks ugly. I tried every solution that i found and my game continues laggy. I don’t use any particles, but i have to use some special fx.

What makes a beautiful game, without affecting on performance?

Anyone have this problem? Any tips? Ideas?

Did you do Application.targetFrameRate = 60? Because 30 is the default.

–Eric

Yeah, and now i have 45.

This function might force to 60?

targetFrameRate just gives sets the maximum. If your game does not render faster, you cant “force” a framerate of 60.

Can you confirm that it’s GPU and not CPU related? Have you run a profiler on it?

Yep, it’s ‘cpu-waits-gpu’.

Did you turn on Rigidbody interpolation?

Oh… and in the Asset Store there is a package called: Core Framework which includes a smooth 2D parallax scrolling scene with palm trees. Maybe a good starting point for you project.

Peter.

Slow down your Fixed Timestep to much slower than 60fps in Edit - Project Settings - Time, but keep Application.targetFrameRate = 60.

If you have several layers with transparent full size images, watch your fill rate. Shut off layers for testing.

Keep Collision Detection = Discrete.

When running in debug mode from xCode, you can click on the framerate icon, and then on the framerate bar. This will show you 2 vertical bars about the CPU/GPU usage in milliseconds. Obviously, if those ms add up to slower than your frame rate, that spells trouble.

Can also find core framework in my sig for now. Triple’s advice is good if framerate is a problem.

I’m barely using rigidbody and physics in my project. Just one or two. But thanks to advice, i’m gonna turn on.

Good to know, my parallax scrolling it’s messy. Really worth paying for it?

It’s adjusted to 0.03, but i don’t get it yet how this works.

About the layers, i’m using the layer Default for the whole scenario, this is bad?

Yeah, the collision detection it’s checked like discrete.

Thanks, gonna check in debug mode in XCode. Don’t thought about it. I was using the internal profiler.

Yeah, i think i’m gonna try if i can’t with these tips.