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.