views:

110

answers:

2

I'm working on an iPhone game using OpenGL ES. I recently updated my iPhone 3G to iOS4, and ever since the update, when I've been play-testing my app I've been getting very high latency on my accelerometer and touch events -- my phone will often respond a second later than it should, which makes the game unplayable. This doesn't occur all the time -- about half the time the game works perfectly. I've set up the accelerometer following Apple's guidelines; one of my view controllers calls [UIAccelerometer sharedAccelerometer] in its init method and implements the appropriate delegate method which just grabs the x-component of the UIAccceleration object, and I have another view connected to a view controller that detects touches using touchesBegan:withEvent: and the other touch event handlers.

I emphasize that this worked fine when I was running 3.1.3. I'm totally stymied. Has anyone run into this problem before? Is this a known bug with the 3G and iOS4? Should I update to CMMotionManager?

+1  A: 

I think it's been widely reported that 3G and iOS4 don't play nicely... very sluggish lack of responsiveness over all. You would be wise to do iOS4 testing on an iPhone4 or 3GS.

chilitechno.com
+1  A: 

Touch events shouldn't lag. What you might be experiencing is some form of render lag (not sure how deep the render pipeline, but in many PC games it's noticeable at not-so-low framerates), which feels like input lag.

Apart from that, I dunno. CMMotionManager produces much nicer data, but only works on iPhone 4 IIRC.

tc.