Example Space Invaders game jerky

Playing the sample Space Invaders game included in the 0.95 LWJGL distribution I notice the animation is jerky, well it’s smooth for a couple of secs then the player’s ship jerks, then it’s smooth for a couple of secs before jerking again. Happens both fullscreen and windowed. I’m on an AMD64 3000+. Is this simply because it’s a sample game and the animation has not been optimised? Does it play smooth on anyone else’s machine?

How would I smooth out the animation? Average the deltas over the last few frames?

It looks pretty smooth here (AMD64 2800+), but not perfect. I’m sure it’s just something in the game’s code though, nothing to do with lwjgl. Also, the aliens seem smooth, its just the ship that seems to jerk a little. So maybe its just how the animation is performed based on keyboard input or maybe the game isn’t using a high res timer?

It is annoying though, especially when I show my non-Java friends, the first thing they say is “but the ship is jerky”. And I have to tell them it’s not important, it’s the fact it’s OpenGl that’s important… ::slight_smile:

I’m sure there are better lwjgl games to show :stuck_out_tongue: The space invaders game is better suited for teaching basic java game dev than convincing people to start :wink:

Don’t they provide the source? Just fix it :slight_smile:

slink away

Kev

i don’t see anything wrong with the space invaders demo. I’ve gone through the code in depth and have found nothing wrong with it. The example runs as smooth as a knife on butter on my system, i’m on AMD 3000+ (32).

It could maybe be a AMD64 bug cos both u have AMD64? donno just guessing though!

Might be related to the timer issue Cas just found?

Kev

Very likely.

It’s not the AMD64, coz my prize runs everything smooth as a baby’s bum.

Cas :slight_smile:

Does the freuqency LWJGL is initialized at reflect the frequency of your monitor and the fps of the game?

If i mess up those values, I can sometimes see some desync in the form of a scanline moving down the screen. If the background’s black, I can’t see the scanline unless it goes over something, which might cause the problems you describe.