im making an online 2 player game with winsock and used timers
i have a laptop and a desktop and i ran the game and connected them two over the network
the timer intervals are the same obviously because its the same exe file that im running
in my game, the timer executes the code for u move around
i line up in the game on the left side of the screen and race to the right side of the screen and the result is that my laptop hits the other side 4 seconds before my desktop does
is there any way to get the timers to run at the same speed? this will greatly affect the online gameplay if i cant fix this. the bullets that you can shoot will be traveling at different speeds and the movements are way different causing a great advantage for the comp that is running the timer faster
01-07-2006 at 08:08 AM
|
misterxed Level: VB Lord Registered: 12-06-2005 Posts: 151
Re: timer speeds on different computers
Hi,
A quick googlin around gave me this link... Its a good tutorial on the topic...
i tried the tutorial, result is that speed got flipped around, my desktop which was slower before is now faster than my laptop that was faster before
02-07-2006 at 12:10 AM
|
stickleprojects Level: Moderator Registered: 09-09-2002 Posts: 891
Re: timer speeds on different computers
Hi,
I use GetTickCount and limit the game loop to be a fixed FPS, so all PCs run at the same speed. This is very similar to the link previously suggested.
____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)