LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Eternity on December 18, 2009, 07:55:50

Title: moving from XP to 7 and my timing went to hell
Post by: Eternity on December 18, 2009, 07:55:50
Hey!

i managed to get my game mostly smoothed out on XP but it looks terrible on windows 7 (running at 60 fps in both cases - logic is on a separate thread and needs to do 100 iterations per second). the timing methods in the Sys class just doesnt seem to be accuate unless of course im messing things up somewhere else... Is there any known issues? and if someone here has timing that works perfectly from windows XP and up please let me in on the secret since its been eluding me for a long time.

Thnx in Advance!
Title: Re: moving from XP to 7 and my timing went to hell
Post by: bobjob on December 18, 2009, 15:24:28
I test my program on XP and Win7 mostly.

I have found that the sync method runs different on different cpu's

because i try to force vsync on, but also fall back on 60 frames (in the sync method).

on my own pc the game will flux from 54/59 fps. but on my bro's xp it will get capped at 60, because the screen refreshrate it 60, and the sync method will run 60, as 61, threfore giving a smooth flow of graphics. there isnt much I have been able to do about it. Im guessing it has to do with my cpu (Pentium E5200 Dual Core @ 2.50GHz) Wereas my bro's comp is a single core.

on my windows 7 laptop the fps reads as 62, when vsync is on running at 60.

personally i find the variation in speed and its measurement not so bad. i cant think of any other accurate timers that run in java.

Title: Re: moving from XP to 7 and my timing went to hell
Post by: Eternity on December 19, 2009, 07:42:21
Sorry i wasnt very clear. The framerate is not the issue. That is running happily at 60 fps using vsync. i have a separate logic thread thats supposed to run 100 times a second and the timing on this one became erratic when i moved to windows 7.
Title: Re: moving from XP to 7 and my timing went to hell
Post by: bobjob on December 19, 2009, 08:02:43
I do my logic in the same thread as rendering.
nun the less all my issues are due to the Lwjgl Sys time. so im just guessing your having a similar problem.
Title: Re: moving from XP to 7 and my timing went to hell
Post by: Eternity on December 21, 2009, 14:46:43
hmm... i found that using getPerformanceCounter (via JNI) instead of the lwjgl sys time drasticaly improved my situation. it was stil a bit choppy but i realised its because my interpolation isnt working 100%.

Thnx
Title: Re: moving from XP to 7 and my timing went to hell
Post by: Matzon on December 21, 2009, 14:59:02
getPerformanceCounter has issues - which is why we're not using it (try throttling the CPU).

if you have issues with the mmsystem - try printing the clock values
Title: Re: moving from XP to 7 and my timing went to hell
Post by: fictiveLaark on January 15, 2010, 18:52:32
I wondered if this could be the same problem I have.  My game uses Euler integration with the lwjgl timer and I've noticed that sometimes, but not all the time, the character that the player controls seems to shake when he moves.  It's only a small amount of shaking but I it makes the game look kind cheap to me.  The computer I'm using is an AMD dual core and runs Windows 7.