Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 1st Jul 2003 13:37 Edited at: 1st Jul 2003 13:39
I need some help getting to grips with multiplayer coding.

The game I am currently writing is a console-based hacking simulator. I did initially intend on simply making it a single player game (similar to Introversion's Uplink), however....I feel there is much more potential in a multiplayer version....think about it, how cool would it be to hack your mates 'PC' or pilfer his cash?!

What I don't understand, is the principles behind coding something like this. I have read the DarkBasic book section on multiplayer gaming and I think I understand the multiplayer game example. It talks about 2 types of multiplayer...P2P and server/client.

People have suggested a P2P basis but how do I implement this. For instance. At the moment, every player has a username and a password (each stored in a separate variable). Also, the name of all servers in the game, their IP addresses and contents are stored in an array. Another array stores bank account numbers, their corresponding passwords and balances. Just taking this small amount of info, how would I structure my game so that every player had access to all the data?

For instance, it is possible to create a new bank account. This generates an entry in the array BankAccounts$ including the new password and a randomly generated 8 digit account number. It also sets the starting balance at 0 and also stores it in the array. How could I make it so that all players could access the info in that array? I.e: If they somehow find out an account no and password, they could access the relevant info from BankAccounts$, even though another player created it? Does this majke sense? If I can grasp this concept...i'll be able to implement other ideas.

Finally, I presume, I would have to ensure that at least 1 player was always online using the P2P model otherwise all date would be lost?????

Please help guys,

Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 1st Jul 2003 22:12
Anyone?

Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 1st Jul 2003 22:33
Well, the multiplayer tutorial in db is really straight forward and pretty much gives you all the code you need for a P2P system. It's literally copy and paste. Then all you need to do is send the infomation in these arrays to all users using your packets.

Get two systems communicating by going through the tutorial and setting it up (it really is simple). Then when a user creates a new account or whatever, send it to the other user using the send commands. Basically, if each player has a running version of the database on their system, whenever someone adds/deletes/edits and entry, just send this info in a packet.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 2nd Jul 2003 09:34
I imagine that you might as well use player to player...
The server/client would need a master program, or one program set to master to make sure all the other players received the data, after all the data was collected from each player.

p2p could have any program start but would allow for the orginal starter player to leave in mid game (I think)...

I too am pondering this at this time and have come to the conclusion that I will use p2p.

I have started first so I am player one..
I need to collect data from player two three and four.

player two needs to collect data from one three and four.

If I am player one and it is player twos turn, I cannot move until my computer is signalled that four has made it's move and so it is now my turn.

packets are the key; gotta practise...

Login to post a reply

Server time is: 2026-07-19 19:52:24
Your offset time is: 2026-07-19 19:52:24