DirectPlay

BlitzPlus Forums/BlitzPlus Programming/DirectPlay

Whaleyboy(Posted 2005) [#1]
Hi all,
I've just started to take a look at some of the DirectPlay (TCP/IP) commands to see if I can get a multiplayer game going. I've written a simple test app that shows two squares on the screen, one controlled by the host, one by the joining computer. It works fine, but the movement of the remote players square is quite 'laggy' and stuttery. I've changed it so it only sends a net message when either the x or y values change which helped a bit, but is there other ways to optimize this sort of net code to make it virtually lag-free?
Thanks!


Nicstt(Posted 2005) [#2]
depends on connection speeds and traffic at the routers you are going through.

I also understand that optimising packet size will help, no idea on that though.


Rck(Posted 2005) [#3]
I started making a game with a new friend on mine and we tryed out DirectPlay as our first network experience. It is very helpful in getting games connected and keeping track of players but is VERRY slow. It really is only functional for board games or other slow-action probably almost turn based gaming for any good performance. Nevertheless, UDP provides an excellent way to communicate.

Since those trials, we have been working for almost a year now and have really decent netcode, requiring about 1 KB/sec up and down per player in game. Although this is not optimized in any way, we have been playing with up to 7 people at once and have enjoyed it greatly (it is a side-scrolling action-shooter).

UDP is faster than the TCP/IP backbone of DirectPlay as packets are not counted, ordered, or even guaranteed to arrive. Don't worry though; unless you're on dial-up or sending above your capacity, packet loss will remain very low on today's improving networks.


Whaleyboy(Posted 2005) [#4]
Thanks for the replies guys...looks like UDP is the way to go. The documentation in blitz is a bit sparse about the whole thing, could anyone post a simple example of getting a UDP net game going? I'll be using a network to play over by the way, not the internet...if that makes any difference.