Online Multiplayer

Blitz3D Forums/Blitz3D Programming/Online Multiplayer

Baystep Productions(Posted 2005) [#1]
Any one want to help me understand and create some multiplayer code? I don't know how the whole server thing works... I'm pretty sure how to send messages.


Ross C(Posted 2005) [#2]
If you know how to send messages, then, turn them messages into positional data messages :o)


Baystep Productions(Posted 2005) [#3]
But what about servers? I want people to be able to host one, or join one, and talk in between. And as far as messages are... I just used the example in TCP commands


jfk EO-11110(Posted 2005) [#4]
You may use the gnet fps example. THere are two servers: ONe is a webserver with PHP and MySQL. It hosts a list of games you can join and also allows to host a new game. It basicly lists the hosts and delivers the IPs.

Then there's the game host, which is a server too. Each player can act as host or as client, the game exe supports both. The player who starts a game usually hosts it. When this host is leaving, the hosting job will be handed over to the next player, so the game can continue. Unfortunately this is exactly the point that makes me some troubles with jeremys code. when a host was handed over to an other player, new players cannot join anymore. I just sent jeremy a mail, maybe he knows why, but I'm afraid it's microsofts fault again :). But this seems to be the only problem. It's a great example. Tho it requires a webserver and basic skills to set up the gnet PHP script and the MySQL Database table.

Here's his example: http://www.blitzbasic.com/codearcs/codearcs.php?code=1149


Baystep Productions(Posted 2005) [#5]
Thanks, I needed that.


ozak(Posted 2005) [#6]
Search for blitzplay. See the free edition and the multiplayer game sample that comes along. Fast and easy. Oh yeah!


jfk EO-11110(Posted 2005) [#7]
Yeah, probably that's what I'm gonna do too. Although blitzplay is UDP based, so there is no detection of lost packets. This means if you want to be on the save side, you need to add some error correction code (like using sequential packet IDs , packet reordering and checksum based integrity checks, basicly everything TCP is doing automaticly by default)

But I agree, DirectPlay, that is used in Jeremys code is kind of bugous IMHO.


Xaron(Posted 2005) [#8]
Or you try my wrapper for the UDP-lib ENet (take a look into the userlibs forum), which can send _reliable_ UDP-packages. ;)

Regards - Xaron


_Skully(Posted 2005) [#9]
jfk

BlitzPlay has reliable UDP packets as well


Wings(Posted 2005) [#10]
GNet is one of the best thing about blitz :)