Texture tearing and stuttering of rotations

Hello all,

Has this stuttering thing returned? I have it on the game I’m working on, and I’ve tried many things so far, and very unsure what’s causing it… The game is a fast paced stroller: helicopter type of game.

I thought it is the creation of new things, but I tried it with background scrolling only, and it stutters…

Testing on iPhone 4, a Verizon version.

If you have any idea, let me know.

Thanks [import]uid: 91771 topic_id: 909 reply_id: 62729[/import]

Want me to have a look see? [import]uid: 5354 topic_id: 909 reply_id: 62740[/import]

We have noticed this problem as well. Just moving an object across the screen at a steady pace will cause it to stutter.
Also, it seems like the problem is more visible when running at 60 FPS as well.
If you want to see the problem, here is an example:
http://sharesend.com/i3dwb

…By the way, we have tested on:
Windows simulator
Mac simulator
Droid 2 hardware

using builds:
2011.630
2011.591 [import]uid: 75926 topic_id: 909 reply_id: 63556[/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-04

[import]uid: 79884 topic_id: 909 reply_id: 65043[/import]

@rasheed it causes big problem also in my game
so i cant release it in market

i need help form corona staff …
[import]uid: 74537 topic_id: 909 reply_id: 65045[/import]

@ZeeGee IS THERE ANY SUGGESTION ??? [import]uid: 74537 topic_id: 909 reply_id: 65054[/import]

This bug does not cause bad performance. It was an old build related to how the screen refreshed, locking at 30fps solved a lot of those issues and also a few other fixes were introduced.

It sounds like the problems you are experiencing are related to your app / code rather than Corona.

A few things…

  1. Loading images during a game will cause a drop in frame rate

  2. Processing a lot of code per loop will cause a drop I’m frame rate

  3. Not recording and accounting for time differences between frames can also make your animations stutter

You also have to remember that the iPhone cannot process anywhere near the same amount of code per frame as the Simulator can. When programming a game / app this really does need to be accounted for. [import]uid: 5354 topic_id: 909 reply_id: 65059[/import]

Big problem for my app as objects move in time (in sync) with audio files and often objects are in the wrong place.

Has anyone filed this as a bug? Is there a work around?

Many Thanks [import]uid: 47300 topic_id: 909 reply_id: 65060[/import]

@Matthew Pringle this code sample show the stuttering problem

download

i am waiting for somebody that can give me any help about this issue …

[import]uid: 74537 topic_id: 909 reply_id: 65063[/import]

its just one image moving in my game screen whats the problem why it is still stutter ???

any help please … [import]uid: 74537 topic_id: 909 reply_id: 65064[/import]

also fps in this sample code dropped to 22

[lua]local fps2 = display.newGroup()
local fps = require(“fps”)
local performance = fps.PerformanceOutput.new();
performance.group.x, performance.group.y = display.contentWidth/3, 0;
performance.alpha = 0.4;

local movingObj = display.newImage(“obj.png”)

movingObj.x, movingObj.y = 0, display.contentCenterY

local function GameLoop()

movingObj.x = movingObj.x + 2

if movingObj.x > display.contentWidth then
movingObj.x = 0
end
end

Runtime:addEventListener(“enterFrame”, GameLoop)[/lua]

my config code

[lua]
application =
{
content =
{
fps = 30
},
}[/lua] [import]uid: 74537 topic_id: 909 reply_id: 65066[/import]

The demo code is wrong, in a few different ways.

  1. Don’t use 60 fps, it basically halves the available time you have per frame to compute the loop.

  2. The time diff calculations in the sample code are wrong, you need to multiply the velocity by the difference in time which is dependant on the fps you have set. So for 60fps its 1/60 and for 30fps its 1/30.

Something like alien.x = alien.x + ( ( 0.03 * alien.speed ) * timeDelta )

  1. You can tell the demo is wrong using logic, you have set the speed at 400, thats 400 pixels per second. It the code worked as it should you would never see the image it would be moving too fast.

  2. The screen refresh in the simulator can tear a bit, this is different to the devices where the screen refresh is locked, on computers it can vary from screen to screen and that tearing is sometimes down to that. [import]uid: 5354 topic_id: 909 reply_id: 65067[/import]

@Matthew Pringle also causes stuttering

local fps2 = display.newGroup()
local fps = require(“fps”)
local performance = fps.PerformanceOutput.new();
performance.group.x, performance.group.y = display.contentWidth/3, 0;
performance.alpha = 0.4;

local movingObj = display.newImage(“obj.png”)
local getTimer = system.getTimer
local lastTime = getTimer()

movingObj.x, movingObj.y = 0, display.contentCenterY
movingObj.speed = 9000;
local function GameLoop()
local elapsedTime = (getTimer() - lastTime) / 1000
lastTime = getTimer()

movingObj.x = movingObj.x + ( ( 0.03 * movingObj.speed ) * elapsedTime )

if movingObj.x > display.contentWidth then
movingObj.x = 0
end
end

Runtime:addEventListener(“enterFrame”, GameLoop) [import]uid: 74537 topic_id: 909 reply_id: 65071[/import]

This is a better way of doing it, again a speed of 9000 pixels a second is too fast.

local movingObj = display.newImage("obj.png")  
local getTimer = system.getTimer  
local lastTime = getTimer()  
  
movingObj.x, movingObj.y = 0, display.contentCenterY  
movingObj.speed = 10;  
local function GameLoop()  
  
local elapsedTime = (getTimer() - lastTime)  
 lastTime = getTimer()  
  
 movingObj.x = movingObj.x + ( ( 0.03 \* movingObj.speed ) \* elapsedTime )  
  
 if movingObj.x \> display.contentWidth then  
 movingObj.x = 0  
 end  
end  
  
Runtime:addEventListener("enterFrame", GameLoop)  

And as I said before in the simulator, on your computer, the animations may jump / tear when the simulator gets out of sync with the screen refresh. All 3D / OpenGL apps and games suffer this as the screen refresh can be 100 times a second when Corona is doing 30 times a second.

On your device however you should not see the tearing. [import]uid: 5354 topic_id: 909 reply_id: 65088[/import]

i have test this code using build 591 of corona simulator and use it in

windows simulator
android os ( samsung galaxy s1 )

the same still suffer from stuttering

does anybody test this code sample on real device ??

is this problem from android , galaxy s1 or from corona ??

any help ??? [import]uid: 74537 topic_id: 909 reply_id: 65204[/import]