Game Development Community

1.5 1.6 1.7 - Camera Jitter

by DragonSix · in Torque Game Builder · 07/16/2007 (5:59 pm) · 194 replies

When the camera is mounted to a moving sprite, the sprite and the background are trembling (when moving).
Especially visible when there's multiple parallax backgrounds. I have the sprite moving using setlinearvelocity at about 50 and the camera mounted with a force set to 0 or higher than 5, the design screen size is 100*75 on a game resolution of 1024*768. Also, it is clearly more visible with vertical sync (and vertical sync is more than necessary for high resolution). The shaking is not something constant, but it is happening very often. When it happen, it seems like the camera go in the wrong direction then catch up back for the time of 2 frames (so, the lower is the framerate, the more remarkable is the issue).

I just tried a workaround by not mounting the camera. For that, I updated the camera position at the player position in updatescene callaback, using getrenderposition to get the exact drawn sprite position... With no success, everything is still trembling a lot.

It could be many things causing it : something with drawn sprite interpolation or camera interpolation or some updating no more happening precisely on each frame. If someone could take a look at it, I would appreciate the help.
Page «Previous 1 2 3 4 5 6 7 Last »
#1
07/17/2007 (12:44 pm)
We had the same problem when we had sceneWindow2D mounted to our "camera" t2dSceneObject and this sceneObject mounted to the player (so sceneWindow2D was mounted to a parent which was mounted to another object). then we mounted sceneWindow2D directly to the player omitting the camera object and there was no more tremling. hope this helps
#2
07/17/2007 (11:11 pm)
It does the issue when the camera is directly mounted (and also when indirectly), so that's not it.
#3
07/29/2007 (4:14 pm)
Bump.
Unfortunately, the bugs don't magically disappears if you don't look at it.


You can directly test the issue in the dummy project I made for testing (.cs in it) : dragon.six.free.fr/deviantgames/Cameramountbug.rar

(Or you can create a new project, with the following code in game.cs : dragon.six.free.fr/deviantgames/CameraBug.txt Make a random sprite named "player" and other random sprites in background)

Start the game, move in one direction using the keyboards arrows (left or right is better), you'll notice the rock player trembling. The background will not shake, but in games in which the framerate is lower (with much more content and things happening) the trembling will worsen and the backgrounds will shake too.


And, I repeat, this is happening only on 1.5(.1) version, 1.3 and prior do not get me the issue.
#4
08/05/2007 (10:50 pm)
Could anybody tell me if I'm the only one having this issue ? Is anybody at GG going to answer ?
#5
08/06/2007 (7:38 am)
It does this in 1.5.1 with me when I use the mounting camera behavior. Does it do it in code? Don't know. I noticed it less when I put some lag on the camera.

Interesting to note: *ALL* FPS games I've played on "modern" graphics cards on *ALL* OS's (mac, win, linux, ATI 9xxx+, nvidia 6xxx+) do stuttering to a certain degree, even with v-sync on. In Doom 3 based games this could be eliminated by telling the engine to draw only 1 frame per refresh cycle but then if the action got busy the game slowed down in to a "slow motion" deal as every frame was forced to draw. It happens in DX & OGL based games.

Could be the same issue.
#6
08/06/2007 (8:21 am)
Happens for me too.

Won't be using any new version of TGB for a while, until it is useable again for the stuff I want to make. :)
#7
08/15/2007 (5:56 pm)
Please GG or ANYONE do something about this bug.
I must present my game in 4 weeks for the Video Game Festival in Paris (there's for about 40 000 visitors anticipated for this year). And without any camera fix the demo is mostly screwed :/
#8
08/15/2007 (10:53 pm)
I was messing with some things... i made a mount force of "2" & there was no stutter at all. How much stuff do you have on screen?
#9
08/16/2007 (10:15 am)
The camera still jitter in "2" both in the camerabug demo and my current project.
My hardware config is Athlon XP 2ghz, 1go of ram and geforce 6600gt on Windows XP SP2. Nothing fancy.

Edit : I've tested it on 2 other PC, the bug is happening every time.
#10
08/16/2007 (2:07 pm)
So this problem didn't occur in 1.1.3?
#11
08/16/2007 (2:16 pm)
It occurs only in 1.5, since the first beta to the last version of it. And I can't really roll back to 1.3, I need the ticked physics badly.
#12
08/16/2007 (2:26 pm)
Hmm ok... I might be able to squeeze in time for a quick look to see if I can figure out the problem... since it most likely is due to the physics being ticked.
#13
08/16/2007 (7:58 pm)
That's (the file you put for download) not stuttering for me at all. nothing.

I'm using AMD 64 3000, 1gb RAM, Win XP SP2 & ATi x1950Pro.

i've run it from the editor & with the standalone EXE.

full screen or window.
#14
08/17/2007 (4:46 am)
If I comment out the line:

scenewindow2d.mount(player, 0, 0, 5, false);

the player's movement is still jerky.

However if I comment out the line

setverticalsync(true);

Everything works fine. Perhaps this problem is related to Vsync and the OnUpdate callback, rather than camera mounting?

AMD 64 3200+, 1Gb RAM, Win XP SP2 and ATI Radeon 9800XT.
#15
08/17/2007 (8:46 am)
Without vsync the issue still happen when the framerate is lower, with also a very noticeable tearing.
#16
08/17/2007 (11:15 am)
If i go full screen with v-synce on it stutters.

it looks a lot like the bug I saw in Doom 3 initially. It does the same thing but it's on all platforms, API's, venders & setups (you can view the tics per frame in the console).

looks like it is a tic issue. in doom 3 it could be fixed by forcing 1 frame per tic.
#17
09/04/2007 (12:30 pm)
I'm experiencing the problem with a dual-core AMD 64 4400+. It looks like a timing / interpolation problem, but I haven't dug into the code to find out for sure.
#18
09/13/2007 (2:08 pm)
Still no update ?
#19
09/20/2007 (7:41 pm)
Stutters for me also in 1.5.1. Everything except the background shakes just before the camera comes to a stop.

sceneWindow2D.mount($player, 0, 0, 3, 1);
#20
09/25/2007 (8:46 am)
Any updates on this one? I get exactly the same thing in 1.5.1 and not in 1.3.
Page «Previous 1 2 3 4 5 6 7 Last »