5
\$\begingroup\$

We made a flash game with a big screen size(1000x600), and the terrain graphic will jitter while the screen scrolling(that's, camera moving with player) continuously.

What's the root cause? Or if you know how to eliminate this problem, please tell me. Any help is appreciated.

UPDATE:

The map's size is more bigger than screen, e.g 6000x1200. And the map has more than one layer, generally it has 3 layers. Terrain is composed by tiles. And FPS is 24.

If the FPS is set to 60, things will be better. But any way, it should work well at 24 FPS. I'm not sure if it is a natural problem of flash player, because some times a terrain object(e.g a house) look like a little bit distorted.

\$\endgroup\$
6
  • \$\begingroup\$ You need to add some more information here. How do you scroll the terrain? Are you testing the release build? Is your terrain tiled in any way? How many FPS do you get? \$\endgroup\$
    – bummzack
    May 17, 2011 at 9:51
  • \$\begingroup\$ Just a guess, but maybe you have too much being rendered at once. Don't render anything that isn't in the camera, and see if that helps. \$\endgroup\$
    – thedaian
    May 17, 2011 at 15:07
  • 1
    \$\begingroup\$ 24FPS looks smooth in film, but anything below 30FPS is unlikely to look smooth for gaming. I'm not sure if that's what's causing your jitter problem, but you should look at increasing the framerate to at least 30, if you can. \$\endgroup\$ May 17, 2011 at 15:33
  • \$\begingroup\$ Can you post the swf in question? I know a lot of things that could fix a bunch of different jittering problems. \$\endgroup\$ May 17, 2011 at 16:11
  • \$\begingroup\$ Lets do the math to find a good framerate. By "good" I mean a framerate that converts into a nice round milliseconds between each frame. 60fps = 16.6... 30fps = 33.3... 25fps = 40 24fps = 41.6... So from this, it looks like 25 makes the most sense. \$\endgroup\$
    – Adam Harte
    May 17, 2011 at 21:25

4 Answers 4

3
\$\begingroup\$

Depending of the kind of Jitter you are getting, this could be the large images snapping to pixels when they move. This will be most noticeable when it is moving slowly.

Try turning smoothing on for your bitmaps, and/or turn cache and bitmap on.

\$\endgroup\$
0
3
\$\begingroup\$

Thanks for your answers, I just find some articles related to this problem :

\$\endgroup\$
1
\$\begingroup\$

This sounds like a VSYNC issue.

https://stackoverflow.com/questions/989471/vsync-in-flex-flash-as3

This may also be worth a browse, but without more details it's really not possible to provide better information.

http://www.craftymind.com/2008/04/18/updated-elastic-racetrack-for-flash-9-and-avm2/

\$\endgroup\$
1
\$\begingroup\$

The thread is a little old but I decided to post my answer anyway.

A strange effect that solved my main jitter issues: Make sure you set your animated MovieClips content to even pixel coordinates!

In my case it was a simple centering that caused major jittering issues:

var bitmap:Bitmap = new Bitmap();
bitmap.bitmapData = bitmapData;
bitmap.smoothing = true;
bitmap.x = -(bitmap.width/2);
bitmap.y = -(bitmap.height/2);
this.addChild(bitmap);

Changing the following lines solved the issue:

bitmap.x = -int(bitmap.width/2);
bitmap.y = -int(bitmap.height/2);

Believe me, this caused some major headaches. I tried it both for vector graphics and smoothed Bitmaps, same effect!

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .