Game Development Community

Camera Stutter

by David Everhart · in Torque X 2D · 02/03/2008 (6:27 pm) · 6 replies

I have a camera that is mounted to an animated sprite. Whenever my animated sprite changes animationdatas, the camera stutters briefly, causing a hard shift on the screen. My current setup is my Custom Player object implements ITickObject and IAnimatedObject. In the Processtick, I handle all Physics logic, and in the UpdateAnimation, I handle all the animation changes as needed.

My understanding , is that Process tick is based on a time step, and interpolate and updateanimation are called per frame. I unmounted my camera to make sure it wasnt my animations changing causing stutters, and my animated sprite changes animationdatas and moves in 8 directions with no stutter. As soon as I mount my camera, and update its center position in interpolatetick , I get the stutter again. Am I missing something obvious? I am using 1.5 code as well.

#1
02/03/2008 (7:49 pm)
Try using the camera.Mount feature. I get smooth camera movement and I always have my camera either mounted to something, or fixed.
#2
02/03/2008 (9:10 pm)
When its mounted, its mounted to the "Center" linkpoint on the animated sprite.

currentCamera.Mount(_sprite, "Center", false);

I followed some threads a while back, and tested some of those out, so far its a no go.
#3
02/05/2008 (7:23 pm)
Ok, but its kind of weird that you are using interpolate tick. Most people don't use that for anything, as its been explicitly said, interpolate tick is not normally used. Anything that you want to do in interpolate tick, you can probobly just do one "processtick" before your other action. Interpolate from what I have heard, is more important for doing something before or between, every tick, if you had some thing you were trying to do. Just try mounting the camera once, probobly after the object is registered.., and nothing else..
#4
02/05/2008 (9:36 pm)
I was following the advice given by a GG dev here:


http://www.garagegames.com/mg/forums/result.thread.php?qt=62360

I tried it in process tick as well, and it still stutters. Initially, it was just mounted once, at registration time, and that was it. Unfortunately, the stutter persisted. I then tried to add the camera.centerposition peice in process tick to no avail, so removed it. I added it to Updateanimation, to no avail, so removed that as well. Then tried to put it in processtick, to no avail either.I read on the tgb forums, there is an open bug in regards to this. Although they are different, I am wondering if their is a link.
#5
02/06/2008 (4:39 pm)
Hmm, it seems my updateanimation is causing a slight draw lag, which is causing the camera to stutter. Looks like I will need to tweak that even more. Thanks for the help Wil, I think I will try some other approaches and see if I can eliminate the draw lag.
#6
02/11/2008 (5:55 pm)
Sorry for the delay in my reply. A good idea, none-the-less, might be to check out the platformer starter kit. There you have a animated sprite, and mounted camera scenario, without any problems I've heard of. That would be my guess.