Chris,
My input processing takes less than a fraction of a millisecond. I
put the coordinates into a queue and return. The physics run the same
no matter what the last-touched values are. I don't have any fancy
processing that would cause any sort of a performance hit from touch.
Evidence of that point is shown in that when you use key bindings, the
game runs fine.
The big kicker? If I simply sleep(16) (recommended to control event
dispatch flood) and return false in Activity.onTouchEvent(MotionEvent
evt) and do absolutely no processing of my own, the game still has the
massive frame rate drop. system_service still consumes 1/3 of the CPU
on my G1 - and that's completely out of my hands. This sort of report
is consistent across all game developers I've talked to who have
tested their games. You can actually download just about any 3D game
off the market and watch the framerate get cut in half on a G1 from
touching the screen on it. The more demanding the graphics, the more
dramatic the drop is, so you can imagine that my game is nearly
unplayable in that state. There's absolutely nothing a developer can
do to stop that because it's a result of system_service consuming the
CPU.
Check the bug I filed - I did this test on every phone I had. This is
consistent with OpenGL on the MSM7200. Touch-processing before it
ever reaches the application causes that drop - not the handling in
the app itself (though I'm sure it could if you were writing horribly
inefficient code).
This is not some first-time game dev thing for me. I've spent days
trying every possible thing there could be to work around this
problem. I've pulled other game developers in to ask for help finding
solutions and we all came to the same conclusion - There is nothing a
developer can do but pray to you Android gods for a service that
doesn't kill the framerate on touch.
As far as specifics go, I do run an update counter and display it on-
screen so I can always make sure my updates are as lean as possible.
My average update with vertex animation & collision response is 4ms on
a G1, so the vast majority of the round trip time is spent waiting for
the GPU to draw (which is the same chip as the CPU, probably why the
slowdown is so dramatic on that chip).
As a last ditch effort, I actually did limit it to the frame rate by
using Thread.wait(1000) and notifying it when my logic was ready to
pull some more events in and that had the exact same result. Like I
said earlier, doing absolutely 0 event processing with no sleep, 16ms
sleep and 32ms sleep all produce the exact same effect - terrible
framerate slowdown and system_service consuming over 30% of the cpu.
My update is not going up by 33ms, it remains at 4ms. What's
happening is the GPU is bogging down when the system_service goes up,
probably as a result of some architectural thing qualcomm did with the
integrated CPU/GPU. This is why I keep saying that the problem is
_really_ apparent on an MSM7200 using OpenGL in a game with a heavy
scene. Put that way, it does seem like worst-case scenario but the
fact of the matter is that it is still 2/3rds of the market and I'd
really love to be able to deliver our new games to them!
I'll tell you what - if you want to talk about more details, feel free
to call me. I can even give you a demo and maybe some source for you
to look at so you can see that this is not an application code side
issue and that we game devs are truly powerless to fix it.
Thanks for listening. You're one of very few over there that has so
far!
Robert Green
Battery Powered Games, LLC
(612)234-2288
On Apr 19, 6:57 pm, Christopher Tate <
ct...@google.com> wrote: