Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Internet lag - Tag
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Bored




PostPosted: Thu Jan 20, 2005 11:20 am   Post subject: Internet lag - Tag

Hi i'm having problems with my final project i which i'm creating an online tag game. I have the basic sytem down except for one thing, each computer lags but only the other computer. For example: Player 1 is at position 20,20 moving up player 2 is "it" and is at position 20,15 and is moving up. Player 1's screen shows player 2 at position 20,10 and himself at 20,20 so he see's a 10 gap while player 2 see's himself at 20,15 and player1 at 20,15 and so he thinks they're touching. please look over my code and give me any sugestions you have (I've tried everything though)

p.s. The programs are the exact same except at the top when one opens a conection and the othe waits



Tag client.t
 Description:
Client program

Download
 Filename:  Tag client.t
 Filesize:  3.07 KB
 Downloaded:  161 Time(s)


Tag server.t
 Description:
Server program

Download
 Filename:  Tag server.t
 Filesize:  2.93 KB
 Downloaded:  141 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Jan 20, 2005 2:48 pm   Post subject: (No subject)

code executes faster on a local computer than data travels. So its possible for a player to move before the update of another player is recieved and processed.

That being said - you need to syncronize moves. Meaning you have to check that the other computer is aware that you have made a move before allowing the local computer to process the turn
Bored




PostPosted: Fri Jan 21, 2005 10:10 am   Post subject: (No subject)

Any idea on how to go about it without slowwing down the program. I had a couple but I found errors in all of them on a second look. and o ya thx for the help
Tony




PostPosted: Fri Jan 21, 2005 12:43 pm   Post subject: (No subject)

think creativly Wink

though since it's turing, speed it not your main consern.. you're not going to get anywhere close to a desent FPS using Net
MysticVegeta




PostPosted: Sat Jan 22, 2005 8:37 pm   Post subject: (No subject)

tony wrote:
think creativly Wink

though since it's turing, speed it not your main consern.. you're not going to get anywhere close to a desent FPS using Net


Even some of the shockwave content experiences lag in multiplayer
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: