Hi, I've recently been having framerate issues (sporadic slowdowns, choppiness) in an iPhone game I'm working on. The game runs at 30fps, leaving 33ms to render a single frame. I've timed the code, and the entire update/draw logic takes less than 10ms, occasionally spiking to 15ms. I've also run the game with Activity Monitor in Xcode, and the total cpu usage for the iPhone stays around 30-40%. The draw logic is based on EAGLView from Apple's examples if that helps. From my tests, it doesn't seem like I'm putting any real strain on the device, but the framerate still occasionally drops. Has anyone else has problems like this? Is there anything else I could try to help diagnose the problem? Thanks, - Galen
there are a few things ive noticed that cause quick dips in fps.. background stuff running and the internal times. calls to webkit stuff etc. since you have no control over background processes you cant do much about it.. for fun go into itunes and start downloading a podcast, and then go back and lay your game.. watch how much different it runs
Music streaming causes semi-random performance hits in our experience. Experiment with other music formats and/or lower bit rates.
You do spin? Sounds like mod/tracker music to me, is it? I guess the benefit is small file sizes and basic samples. I remember a 486 could play a 32 channel XM (like mod) file with samples, but couldn't play a 128kbs MP3 EDIT: sorry for thread hijack, i'll leave this now
Thanks for the ideas. Unfortunately we still get the framerate drops even without music playing. It must be something else.
Have you run your game in Shark to see where the majority of time is spent in your game? Also, the iPhone just does crap. Nothing is frustrating than that buzz when you realize the stupid phone just checked email during a game. Also, take a careful look at your texture loader, Apple's previous sample projects leaked memory horribly.