Game is SLOW when touch and holding screen

I’m using Corona v243, I’ve built for Android 1.6 and Android 2.2. I’m using an HTC G1 device as the target device.

Whenever I touch and hold the screen in ANY Corona game (Mine, or the Sample Apps) the game slows down to a crawl.

This is totally unplayable. The same game works fine on my iPhone 3G (no S)

This is a critical flaw.

Please help!
[import]uid: 8741 topic_id: 4508 reply_id: 304508[/import]

I have a droid x and a droid and a nexus…

do you have some some code that i can test that exhibits your problem

c [import]uid: 24 topic_id: 4508 reply_id: 14154[/import]

sure, run the Bullets sample, or the JungleScene sample, probably any sample will work but i’ve tried those two in addition to my code.

Then press and hold the screen while it’s running and notice how slow it gets while your finger is on the glass.

[import]uid: 8741 topic_id: 4508 reply_id: 14157[/import]

Also, the Fishies and Chains demo show off the problem well.

[import]uid: 8741 topic_id: 4508 reply_id: 14159[/import]

i have two devices here with me. droid and droid x running 2.2 - i can’t reproduce the problem.

c [import]uid: 24 topic_id: 4508 reply_id: 14163[/import]

They mention the same problem in the Android forums. Apparently touch events are being delivered ~ every 1/10th of a second and that is killing the frame rate on older devices.

Please read this:

http://stackoverflow.com/questions/792185/why-are-touch-events-destroying-my-android-framerate

Is it possible that the Droid and Droid X are so much faster than the G1 that you are not perceiving the problem but it’s still there, just imperceptible to the human eye on fast devices?

The game runs silky smooth so long as I don’t touch the screen, of course that is totally unusable since the player needs to be able to provide input.

I’ve even tried overclocking the G1 to 614Mhz (stock is 528mhz) and still, all corona games are dog slow. Other non-Corona games from the Marketplace run fine while I touch the screen.

This problem happens on Android 1.6, 2.0.1, and 2.2.

Is there a G1 you can test on?

I’m stuck. Help please.

[import]uid: 8741 topic_id: 4508 reply_id: 14176[/import]

Would it matter that I’m using the debug signing keys that come with Corona? I don’t see how the keystore that I use to sign it would matter, but I thought I’d throw that out there just in case… ???

[import]uid: 8741 topic_id: 4508 reply_id: 14177[/import]

Here is a video of the problem:

http://www.youtube.com/watch?v=fxSoUdAejeA
[import]uid: 8741 topic_id: 4508 reply_id: 14187[/import]

bump

this is a critical problem, please help! [import]uid: 8741 topic_id: 4508 reply_id: 14245[/import]

scheduled for review and see if we can figure out a fix …

[import]uid: 24 topic_id: 4508 reply_id: 14254[/import]

I had the same problem while testing on ipod 2g, even if not that bad as you describe it on the android.
I thought it’s because while you’re touching the screen, the “garbage” starts to add up really fast, and the work that the garbage collector does is really heavy for older devices, like my poor iPod (on my iphone 3gs no problem at all). You have to play around with garbage collector’s settings.
In my game, I just added those two lines in the enterFrame loop:

collectgarbage("step", 0.7);  
collectgarbage("stop");  

And everything is much better. I get a little hiccup every once in a while, but rarely and it does not affect the gameplay (it’s pretty fast paced).
I thought that making steps that little would soon fill up my ram, but I left it on for like…a night, and it didn’t stopped, so I left it like that xD
Not sure if it can solve your problem too, though :slight_smile: [import]uid: 8486 topic_id: 4508 reply_id: 14614[/import]

Thanks for your suggestion H4ch1, unfortunately it doesn’t seem to fix the problem on Android :frowning:
Strangely enough, on my old iPhone 3G (no S) it my game runs just fine, even without the hack you mentioned. No slowdown at all when I touch the screen.

It almost seems like under Android the touch events are clogging up the cpu.

[import]uid: 8741 topic_id: 4508 reply_id: 14624[/import]

Hew, that’s bad :\
Maybe something like the accelerometer intervall is needed to not get too much calls? If that’s even possible though. [import]uid: 8486 topic_id: 4508 reply_id: 14635[/import]

ps: been monitoring this thread and we have been running test on our devices … it is a combination of a fix and android — we are figuring out a fix … and i hope to have an answer soon

c [import]uid: 24 topic_id: 4508 reply_id: 14788[/import]

Thanks Carlos,

In addition… I sent a bug report a while back regarding an issue on Android where you open an html page in a webPopUp and are unable to get the virtual keyboard to appear when touching a form field inside the loaded html page. I never heard anything further about that issue.

(Case #2514)

Thanks.
[import]uid: 8741 topic_id: 4508 reply_id: 14792[/import]

Im having the same issue. Im using a G1 too with Android 2.2. [import]uid: 24981 topic_id: 4508 reply_id: 25400[/import]

This was fixed in the daily builds, but it broke performance on droid 2, droid X and Nexus S.

I’m waiting eagerly for a fix, since i’m now beginining to get seriously bad ratings by people on the market :frowning: I mean how can it not work on googles flagship phone - then Nexus S :confused: [import]uid: 8872 topic_id: 4508 reply_id: 25404[/import]

This is good to know … I have a hunch that I’ve run into this same issue … although, it’s just nice to see that these things are being addressed.

I can’t wait to successfully reproduce my App on my PHONE as it looks in the simulator!

Heck - I’d rather the simulator look as bad and slow as my app on my phone :slight_smile: (G2) - just for consistency. [import]uid: 19875 topic_id: 4508 reply_id: 27800[/import]

What’s the status on this issue? I’m running into it running a device with 1.6 on it. The build runs great on iPhone 4 but anytime I touch the screen on my Android device it slows down to a crawl. Is this fixed on a daily build? If so, I may purchase Corona earlier than I intended to just so this goes away and I can continue development.

I should also note that I removed all event listeners for “touch” and “enterFrame” and if I still touch the screen, it crawls. [import]uid: 19383 topic_id: 4508 reply_id: 28555[/import]

Did you see my Android update?

http://developer.anscamobile.com/forum/2011/03/01/android-update-please-read

Our early users of Android 2.2 for ARM7 builds show a 50% increase in performance.

C [import]uid: 24 topic_id: 4508 reply_id: 28556[/import]