borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB Home | News Home | Forum Home | Downloads | Register | Search | PM | Profile

Previous Topic (cannot open pdf doc from VB)Next Topic (QUICK! how to c what parameters were passed to my app?) New Topic Post Reply
AndreaVB OnLine : VB General : timer speeds on different computers
Poster Resource
CpxAzn
Level: Trainee

Registered: 01-07-2006
Posts: 2
icon timer speeds on different computers

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
View Profile Send Email to User Show All Posts | Add Comment
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: timer speeds on different computers

Hi,
A quick googlin around gave me this link... Its a good tutorial on the topic...

Best of luck  

Regards

____________________________
lOsT...

01-07-2006 at 02:30 PM
View Profile Send Email to User Show All Posts | Add Comment
CpxAzn
Level: Trainee

Registered: 01-07-2006
Posts: 2
icon Re: timer speeds on different computers

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
View Profile Send Email to User Show All Posts | Add Comment
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon 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)

02-07-2006 at 08:22 AM
View Profile Send Email to User Show All Posts | Add Comment
AndreaVB OnLine : VB General : timer speeds on different computers
Previous Topic (cannot open pdf doc from VB)Next Topic (QUICK! how to c what parameters were passed to my app?)New Topic Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder