Non-network lag?

Hello everyone!
OK, my game runs fine on a 2.8GHz laptop, but it runs kinda skippy on
another 1.4GHz comp… I mean, both run at the same actual speed…
Like, if I put them both at the right side of the screen and push the
Left key at the same time, they both get to the left side at the same
time… But the 1.4GHz is laggy… Is there a common workaround to
this, or should I post some code? Thanks! ;-)–
~ Leo, M@$73r L3170, Sulfurik, Kixdemp, L-28C… Whatever you wanna call me.

Hey Leo, do you have any “fixed rate” logic in your game?> ----- Original Message -----

From: sdl-bounces+atrix2=cox.net@libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of L-28C
Sent: Sunday, September 10, 2006 12:01 AM
To: sdl at libsdl.org
Subject: [SDL] Non-network lag?

Hello everyone!
OK, my game runs fine on a 2.8GHz laptop, but it runs kinda skippy on
another 1.4GHz comp… I mean, both run at the same actual speed…
Like, if I put them both at the right side of the screen and push the
Left key at the same time, they both get to the left side at the same
time… But the 1.4GHz is laggy… Is there a common workaround to
this, or should I post some code? Thanks! :wink:


~ Leo, M@$73r L3170, Sulfurik, Kixdemp, L-28C… Whatever you wanna call me.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hey Alan! :smiley:
You mean like this:=====================================
// Main game loop
while (true)
{
// Get the current time
float newTime = (float) SDL_GetTicks();

float deltaTime = newTime - currentTime;
currentTime = newTime;

accumulator += deltaTime;

while (accumulator >= dt)
{
	game.Respond();
	t += dt;
	accumulator -= dt;
}

game.Render();

SDL_Delay(10);

}

That’s what I have… Thanks!

Alan Wolfe wrote:

Hey Leo, do you have any “fixed rate” logic in your game?

-----Original Message-----
From: sdl-bounces+atrix2=cox.net at libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of L-28C
Sent: Sunday, September 10, 2006 12:01 AM
To: sdl at libsdl.org
Subject: [SDL] Non-network lag?

Hello everyone!
OK, my game runs fine on a 2.8GHz laptop, but it runs kinda skippy on
another 1.4GHz comp… I mean, both run at the same actual speed…
Like, if I put them both at the right side of the screen and push the
Left key at the same time, they both get to the left side at the same
time… But the 1.4GHz is laggy… Is there a common workaround to
this, or should I post some code? Thanks! :wink:


~ Leo, M@$73r L3170, Sulfurik, Kixdemp, L-28C… Whatever you wanna call me.