Online games network question

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by BalrogSoft.

Hi!

Im programming a strategy online game, and i have some questions, becauso i dont know anything about network programming. I saw Network server, and Network Client sources, but who is server and client when are three or more user playing a game? And how can i determine the ip client and server numbers to not coincide with another ip client users? If i conect all users as client, can i send info to this clients?

I have this questions if somebody can answer, because i want to code a strategy game with 2 or more players conected at the shame game. And i want to do a web site where users can connect and show their game ip client to organize differents rooms where players can add to play, such as MSN Gaming zone.

Bye, and sorry for my bad english.
Balrog Soft

Balrog Soft
Amiga and PC Coder
http://www.balrogsoftware.com
[url]mailto:balrog@balrogsoftware.com[/url]
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Hi!

Many question at once. I also made my first experiences with networking and I found out that is not so easy as it seems first. (Hi Paul hehe)
There are some techniques to create Gameservers. I would apollogize you to let the player choose at the startup of his multiplayer game if he wants to start a server or a client.

Another way is to create a dedicated server. A Server which is able to process more then one game but without running the game itselfe. (No graphic, perhapes only a small graphical Userinterface to the server or a DOS Console)

Sometime ago I posted a small x-ample in the tips and tricks section how to find out the IP of the local maschine. How to get the IP of an incoming connection, I dont know it till yet. :-(

For your WebSite you need something like a God-Server or Master-Server where all subservers are recognized on startup. Thats what I have planned in my network application.
I want to try the following:
Running a masterserver on my 24/7 DSL Server, just for recognizeing other servers. That keeps the traffic down on my line. Every 5 minute this Masterserver will create a database which will be automaticaly uploaded to a ftp-server which has got a very fast connection. The clients connects to these fast server and download the database which contains the IPs of all known servers.

Dont forget to check if your servers are still alive or your list will become bigger and bigger and all server are unavailable. Just do it by a little ping.

For gaming you need to create you own protocol. Have fun with it. I'm in the same state and its not easy as it seems.
You have to collect packets, split them up, check if their contens is complete and then process them. You will get another problem: Synchron running of your games. Which you fun.
;-)

Mike

Tranquilizer/ Secretly!
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by bluez.

if you like i can post a code sample in gfabasic that uses api winsock calls, it should not be too hard to translate it too purebasic, i guess...




... this copy of me has been unregistered for 36 years (no spam please)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by BalrogSoft.
if you like i can post a code sample in gfabasic that uses api winsock calls, it should not be too hard to translate it too purebasic, i guess...
Hi Bluez, please post it, it could help me.

Bye, Balrog Soft.

Balrog Soft
Amiga and PC Coder
http://www.balrogsoftware.com
[url]mailto:balrog@balrogsoftware.com[/url]
Post Reply