Corona Cant Keep a Smooth 30fps - Animation Useless

This should already have been posted as bug # 156 but I got to ask whats going on with this?

Corona seems to stutter every few seconds causing any animation to jet jumpy. This is only noticeable on the iPhone itself, in the simulator the screen looks like it tears briefly, ive tested back to 1.1 and on iPhone 3G and 3Gs

Can I get some feedback on this, ive emailed support directly and posted as a bug.

This is a cornerstone of Corona and its disappointing that I haven’t even heard back about this, just an acknowledgement would be better than nothing. [import]uid: 5354 topic_id: 980 reply_id: 300980[/import]

This has been updated by Carlos in the Bugs forum, its being looked into.

Fingers crossed! [import]uid: 5354 topic_id: 980 reply_id: 2246[/import]

Well with almost 200 cases/bugs in the pipeline, I don’t want to imagine how long it will take. I keep my fingers crossed for you too. Personally I am losing confidence and hope. [import]uid: 5712 topic_id: 980 reply_id: 2252[/import]

:slight_smile:

Engineering is looking at it now…

Carlos [import]uid: 24 topic_id: 980 reply_id: 2255[/import]

Hi guys,

Regarding this subject, I also experienced that in my app, but I was replacing the Runtime:addEventListener(“enterFrame”, functionXYZ) for a timer.performWithDelay(33, functionXYZ) which should be the same as 30 FPS calling function.

At some test it runs better, but I was tempted to decrease its value, like 20 or even 10, just to see if I can force more FPS, but of course, I guess this is limited by CORONA engine, because it doesn´t change anything.

The only thing is that it performs 33 calls in a second to that function, but it doesn´t mean 30FPS on screen, even if it is the same. But I guess this explanation should be provided by ANSCA staff, because I was wondering if these both API are handled in the same way on CORONA engine. I hope they will be different.

My tests were on CORONA SDK 2.0 beta 2 on iPhone 3G 16Gb.

Flavio. [import]uid: 3022 topic_id: 980 reply_id: 2258[/import]

Yeah ive been experimenting with this (for a while!), have a look at this, the circle jumps a little every couple of seconds. http://files.me.com/mattpringle/h8b4ap

Its not just rotations that ive noticed, Corona transitions, normal x = x +1 looped movements all sorts. Looking at the code for the rotating circle I cant see anything that should cause it and its so little code its not pushing Corona.

I was originally testing on a 3G and that stuttered (1.1, 1.3, 2.0) and I thought it was the game I was writing so I got a 3GS and that too suffers, just got an iPad so will test on that shortly.

To my mind

  1. It doesn’t happen after 1 full second’s worth of loops, its more like every couple of seconds or so (but it is predictable)
  2. Device doesnt seem to have an effect
  3. Corona version has no effect
  4. Cant be my programming as I can see it in transition.to animations as well
  5. Not a memory issue as can demonstrate with much memory still free (assumption on assets loaded)
  6. Its not a performance issue
  7. The simulator demonstrates this as a graphical glitch / tear in the redraw (its not that noticeable)

Believe me on 6, im pushing Corona quite far, lots of motions, tons of layered transparent pngs, massive textures, 20+groups, sounds and music and it all runs perfect between jumps, for the 2 seconds before everything is as smooth then the stutter then back to the smoothness.

I perform all tests on cut down versions of the app to ensure its not me / the app.
[import]uid: 5354 topic_id: 980 reply_id: 2261[/import]

Matthew,

I don´t have my MAC right now at my job, but these points:

1st) try to replace all enterFrame schema to timer.performWithDelay(33,radarRotation), this will also avoid to call twice time getTimer() function and it will ensure 30 calls per second to your function.

2nd) You can directly use radarGroup.rotation = radarGroup.rotation * 0.03

3rd) Avoid the use of table here, just rotate the image object, it means imageRadarBlue

Let say you code should be this one (I didn´t test because I am on PC right now, so the code is directly from my mind…) so try this shortest animation schema:

radarGroup.xReference = 160
radarGroup.yReference = 160

– Load Blue Image
local imageRadarBlue = display.newImage( “imageRadarBlue.png” , 10 , 10 )
imageRadarBlue.isVisible=true

function radarRotation()
imageRadarBlue:rotate(0.03)
end

timer.performWithDelay(33, radarRotation,0)

and let me know what happens with your FPS.

Regards,

Flavio.
fpassa@gmail.com

[import]uid: 3022 topic_id: 980 reply_id: 2262[/import]

I added this thread as case # 175

carlos [import]uid: 24 topic_id: 980 reply_id: 2264[/import]

This isn’t the specific issue in this case, but since this is a thread about performance, be aware that judicious use of collectgarbage(“step”) can help some situations.
[import]uid: 54 topic_id: 980 reply_id: 2266[/import]

Thanks Flavio

I changed the speed to 3.3, it still stutters and its noticeable in the simulator with the jump/tear

local radarGroup = display.newGroup()
radarGroup.xReference = 160
radarGroup.yReference = 160

– Load Blue Image
local imageRadarBlue = display.newImage( “imageRadarBlue.png” , 10 , 10 )
imageRadarBlue.isVisible=true

function radarRotation()
imageRadarBlue:rotate(3.3)
end

timer.performWithDelay(33, radarRotation,0) [import]uid: 5354 topic_id: 980 reply_id: 2267[/import]

Hi Eric / Carlos

This should be the same as case #156 I think (I posted both)

Never heard of collectgarbage(“step”), is this documented? [import]uid: 5354 topic_id: 980 reply_id: 2270[/import]

collectgarbage() is in the Lua 5.1 reference manual: http://www.lua.org/manual/5.1/manual.html [import]uid: 54 topic_id: 980 reply_id: 2271[/import]

Hi all, we believe we have identified the culprit. It’s a little arcane but has to do with the the fact that the internal timer gets periodically out of sync with the screen refresh rate. This can cause observable problems on the simulator as well as on device. It can be responsible for stuttering hiccup like behavior as well as visual tearing, since updates are happening during the middle of a screen refresh.

We have a fix (on the device) that makes the problem go away, but it requires the end-user’s phone to be iPhone OS 3.1 or later. Unfortunately, Apple did not address this issue in OS 3.0 so we are unable to address it for end users who have not upgraded their OS.

cheers,
Walter
[import]uid: 26 topic_id: 980 reply_id: 2289[/import]

Hey Walter, that was quick!

Do you guys ever sleep?

Good news you have a fix and it wasn’t me seeing things.

I take it that you will be rolling this into a new beta? [import]uid: 5354 topic_id: 980 reply_id: 2291[/import]

Walter,

I am runing on OS 3.1 in my iphone 3G 16Gb, so I can test that to see if problem is gone on my app.

Regards,

Flavio. [import]uid: 3022 topic_id: 980 reply_id: 2298[/import]

Walter,

Any idea when this release will be out? I’m focusing on ipad right now so by default all of my users are 3.2 or later. I just had to resubmit my app due to the native widget orientation issue, so it wouldn’t be much of a problem for me to reject the binary and replace it with a more stable version of the sdk since I have a fairly large number of transitions in my game.

Thanks,

  • Nick [import]uid: 70 topic_id: 980 reply_id: 2363[/import]

This was fixed today. And should be out in the next beta drop.

Carlos [import]uid: 24 topic_id: 980 reply_id: 2364[/import]

very old post, but the problem still exist!!! [import]uid: 79884 topic_id: 980 reply_id: 62989[/import]

We have started seeing this issue too. There is a definite refresh/tearing problem that happens as we scroll through our game world.
It has been observed on the simulator for both Mac and Windows, as well as on a Droid 2 Device. We have not had a chance to test on an iPhone yet.
Walter mentioned above that people who had not upgraded to 3.1+ were out of luck, but does that mean the problem was or was not fixed for the simulator or Android devices?
The problem is also much more noticeable when running in 60 fps vs 30 fps. [import]uid: 75926 topic_id: 980 reply_id: 63440[/import]

this problem causes huge limitations and very bad performance!!
its a killer bug for corona sdk.

and it seems there is no solution for this bug since this topic posted from 2010-05-09
[import]uid: 79884 topic_id: 980 reply_id: 65044[/import]