NetPlay

BlitzPlus Forums/BlitzPlus Programming/NetPlay

siread(Posted 2006) [#1]
I'm trying to add an online mode to my game. My game is running very nicely but this is my first attempt at netplay. I am doing the following on a local network:

On one machine I set up a host game using HostNetGame & CreateNetPlayer.

On a second machine I am able to set up a client and join the game using JoinNetGame & CreateNetPlayer.

Whenever the client presses a button a message is sent using SendNetMsg.

The host machine listens for the messages every game loop using RecvNetMsg.

Now I have determined that some messages are being sent and recieved but the host machine is picking up only a fraction of the messages. As it stands barely any of the clients actions are actually taking place on the host machine.

Do messages actually queue up until the host machine reads them? If so, why isn't it picking up everything that is sent?
Am I even going about this in the right way?
Are the built in Blitz netplay commands the best way to do it (naturally, this game will need to be very tight with minimal lag).

Thanks.


Andres(Posted 2006) [#2]
you need to use ReadAvail and other functions to determine if a whole sentence is received. I think it's like that but I've never used directplay.


boomboom(Posted 2006) [#3]
Check out the RakNet lib. Its pretty easy to use.

http://blitzbasic.com/Community/posts.php?topic=50546


siread(Posted 2006) [#4]
Thanks, i'll check out RakNet. Looks pretty powerful.