simple LAN lag issue

Blitz3D Forums/Blitz3D Programming/simple LAN lag issue

syntax(Posted 2007) [#1]
first off i understand that this is a somewhat stupid question, but i happen to be networking retarded and im just trying this out of curiosity. also please dont overflow me with an answer like i saw someone doing on the mmorpg topic a couple of minutes ago. thank you very much.

now the question! i have a first person shooter. i have it running on two computers. im using the "direct play" commands on the help menu to send a message that consist of : (the X,Y,and Z, the Yaw Rotation of the player, and whether or not the player is shooting) so both computers are sending a message to the other one consisting of that, and constantly checking for a message that might be sent to them. once they recieve a message, they will place a little person at the XYZ and turn them and if they are fireing, it will do a little animation. it seems to work great except for the fact that one is updating BEAUTIFULLY and the other computer is almost 3 secs behind. (and its not really laging because its moving smoothly but its 3 seconds behind)

so yes its lengthy but i wanted to make sure i was understood. thanks to anyone who can help the "3 second behind" problem


Ked(Posted 2007) [#2]
I heard a while back that it is better not to bother with Direct Play. Too slow. You'd better start testing TCP/UDP! :)


syntax(Posted 2007) [#3]
which is better for a simple 2-maybe 4 to 8 computer LAN?


Ked(Posted 2007) [#4]
Well... for sending user messages or just messages in general, TCP. For sending player coords, rotation angle, etc., UDP.


syntax(Posted 2007) [#5]
gotcha. thanks alot Ked.


Vertigo(Posted 2007) [#6]
Direct Play is not bad in my experience. Its now deprecated in direct x. Meaning at any point in time Microsoft could stop supplying it with directx. Everything now days is using the managed socket crap in visual studio. I would suggest using UDP with the time stamp cheat like quake 3 used to gain that sheer speed over the lan. I have an article bookmarked somewhere that talks about it if you are interested.


syntax(Posted 2007) [#7]
i am intrested. if you could supply a link to an online version of the article, that would be great. thanks.


Vertigo(Posted 2007) [#8]
"With Quake3 he dropped the notion of a reliable packet altogether, replacing the previous network packet structure with a single packet type -- the client's necessary game state. The server sends sequenced game state updates that are delta compressed from the last acknowledged game state the client received."

http://trac.bookofhook.com/bookofhook/trac.cgi/wiki/Quake3Networking

This isnt as detailed as I remember it though. Still its an interesting concept. Just not caring if packets arrive haha.