Multi player games

Blitz3D Forums/Blitz3D Beginners Area/Multi player games

Moraldi(Posted 2008) [#1]
I want to make a multi player game with Blitz3D. A game for 2 or 4 players maximum. I have no idea how to start. Is there any good tutorial for absolute beginners in network games?
If it is possible a "Hello world" program will be appreciated. Is it possible to test a network game in a single computer?


D4NM4N(Posted 2008) [#2]
Im sure i saw an example FPS game in the codearcs. Might help.


WolRon(Posted 2008) [#3]
Is it possible to test a network game in a single computer?

I haven't touched netoworking in so long, I don't remember much. My initial reaponse would be no, since you have to send the data to another (IP or network) address. However, can't a person send data to the 'self' address? Isn't it something like 127.0.0.1 ???

Someone help me on clarifying this...

I once made a very simple messaging program for my own needs and it wasn't too terribly complex. If you bugged me enough, I might dig it up...


KillerX(Posted 2008) [#4]
Each computer has its own IP adress
This is from the Blitz3D manual.
It will return your computer's IP:
; First call CountHostIPs (blank infers the local machine)
n = CountHostIPs("")
; n now contains the total number of known host machines.

; Obtain the internal id for the IP address
ip = HostIP(1)

; Convert it to human readable IP address
ipaddress$ = DottedIP$(ip)

Print "Dotted IP Test"
Print "=============="
Print ""
Print "Internal Host IP ID:" + ip
Print "Dotted IP Address:" + ipaddress$
Print ""
Print "Press any key to continue"

WaitKey()

End 



LineOf7s(Posted 2008) [#5]
Is it possible to test a network game in a single computer?

The short version is "yes", because you start your server on your computer, then your client, and the server's IP address is 127.0.0.1 (also known as "localhost") as WolRon mentioned.

The catch is that you'll have an almost-perfect network then, and the internet (and even LANs) aren't almost-perfect at all: you have latency guaranteed, and very often packetloss too. Good old BlitzPlay has functions built-in specifically for simulating latency and packetloss especially so you can test on a single computer. Sadly, it would be fairly safe to say now that BlitzPlay is no longer supported (or sold), but I'm sure it's not doing anything any other library couldn't do. Conceptually, that sort of latency/packetloss simulation is quite straightforward...

On another note, you can get the fully commented FPSnet (networked FPS game) from this entry in the code archives (credit to RottBott), or get the very capable ROTTnet UDP network library for free from his website directly (also full of other goodies, very generously).

I hope that helps you get started.


Moraldi(Posted 2008) [#6]
Thank you guys.
At first glance the FPS game in the code archives looks very interesting for me to start.


boomboom(Posted 2008) [#7]
http://www.rottbott-studios.com/rottnet.html a good simple networking library.


LineOf7s(Posted 2008) [#8]
Excellently spotted, boomboom. :o)