some questions about networking

BlitzMax Forums/BlitzMax Beginners Area/some questions about networking

Hardcoal(Posted 2013) [#1]
Since the manual is so cheap in explaining networking i wanna ask some Key questions.

A) whats the difference betwin

Network
Network - GameNet (on the manual)

B) Whats the advantage of import brl... commands..

C) what exactly do I want to do in order to sync for example a mario game when all the enemies should be synced.

-- I just dont know what should I concentrate on.. --

NetWork,NetWork-GameNet,Or the BRL Stuff..

Thats all, cheers thanks in advance


Hardcoal(Posted 2013) [#2]
For some reason not many ppl answer network related questions.
Either many dont know or many just busy sleeping.

Mentioning sleep. Did you notice that while sleeping time has no meaning.
Probably the same when your dead or having fun.
Maybe the ultimate fun is just being dead.

Ok. back to networking..


BLaBZ(Posted 2013) [#3]
Josh Klint has submitted some great networking snippets into the code archive.

This is a simple UDP networking class
http://blitzmax.com/codearcs/codearcs.php?code=2325

Here's a more complicated and full developed chatroom class with additional features
http://blitzmax.com/codearcs/codearcs.php?code=2639


Polan(Posted 2013) [#4]
8h is not enought time for someone to aswer.
GNet is sort of automated blitz-based network. You only create net-variables/objects, and underlay takes care of all optimalization. I've never used it, but I've seen RTS game made in it and it worked (~200-300 units as I remember). GNet is easiest to use.
You can also create streamsocket, with it, you can use writebyte/short/int etc. like if you were saving to file, and then read the same data on the other side. Again, most of stuff is taken care, by some underlaying functionality.
We also have access to raw tcp/udp sockets, they are not documented (highlighted) in default IDE, for those you can use any tutorial about sockets on the internet.


Hardcoal(Posted 2013) [#5]
Thanks polan it helped.
Networking is not simple to understand compering to other stuff i learnt in programming.
But slowly by trail and error im getting the idea.

When ill get it ill make a clear tutorial


*(Posted 2013) [#6]
Well simply put if you want to create a Mario game where everything is on the other computers as well one thing comes into mind is simply how much is gonna be level scripted and how much goes across the network.

with Mario all the monsters were part of the level so they always where there these would appear on everyone's computer, all you would need to send then would be player positions and what they are doing.


Hardcoal(Posted 2013) [#7]
one thing I didnt understand which is important about GNet

Im Trying to Connect via Wireless NetWork

The Command GNetConnect() on the client asks for IP
What IP should I Provide?

I mean on all examples that Ive looked I saw IP "127.0.0.1".

on the same computer running the server and client worked fine.
but not when trying on different computers on the same wireless network.


*(Posted 2013) [#8]
Normally your wireless ip is 192.168.1.x or 192.168.0.x where x is a value from 0-255, you can get yours by going into cmd and typing ipconfig


Derron(Posted 2013) [#9]
As long as you are using IPv4 you can do "broadcasts" (or if on a system without "broadcasting" setup, just traverse through all IPs in range... eg. 192.168.0.x with x=1-254/255).

Now when your client receives a broadcast-announce ("IP a.b.c.d is hosting game XYZ") you just send a join packet ("Hey IP a.b.c.d, want to join your game XYZ"). The Host will recognize the senders IP and can initiate the connection if he wants the client to connect (you can do ban-checks here).


This is not that easy with GNet, so I use BNetX's UDP-Library for sending such packets.


bye
Ron