GNET tutorial that works?

BlitzMax Forums/BlitzMax Beginners Area/GNET tutorial that works?

Drekinn(Posted 2006) [#1]
I'm very eager to attempt network gaming with BlitzMax but as yet have not found a GNet tutorial that actually results in success.

I've tried Mark's demo (http://www.blitzbasic.com/tmp/gnetdemo.zip) which only resulted in a spate of connection errors. If anyone has succeeded in getting this demo functioning as it should could they please instruct me of the necessary steps involved, as Mark's explanation is a little vague.

Or if not, would someone be so kind as to produce a quick and dirty example of a simple two-player network game, such as a coloured box that moves upon pressing the corresponding arrow key.

Any help would be most appreciated,


peltazoid(Posted 2006) [#2]
Hi, I would recommend using bnet or bnetex

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

as with gnet you have very little control over it, it seems to be a case of creating a gnet host on each machine, then set one to listen for connections and one to listen then create an object fill it with data and each time you perform a gnetsync the data is send to all connections.

It seems to have no ability to find ip address of peers or better control for divorcing the network code from the game logic.

bnet seems to do this.


WendellM(Posted 2006) [#3]
would someone be so kind as to produce a quick and dirty example of a simple two-player network game

I've added a very quick & dirty (not to mention simplistic) example here: GNet (1.16) sample. It only exchanges a couple of ints and strings, but it does work under 1.16 and might serve as a starting point for your further explorations.


Drekinn(Posted 2006) [#4]
peltazoid,
Ok, I'll look into it. Thanks.

WendellM,
Since I don't have the GUI module installed I can't run your code. I don't suppose you could whip up a bare-bones non-GUI-based example?