A multiplayer game?

ExcludeReality

Active Member
Licensed User
Hi all.
I'm making a big update to my old game Anarchy Republic.
I'm thinking about including a multiplayer mode, so you can play with other people over the internet.

However, I have no experience at all with network programming.
I don't even know what network programming is.

The game is quite simple, so the only data the 2 players will need to exchange is a few strings and a set of coordinates.

The only thing that came to mind is opening a website, where the players will upload and download data from.

I have no idea where to go from here, so can anyone please point me in the right direction.
Thanks.
 

derez

Expert
Licensed User
Longtime User
I have not done that also, but if you look at this http://www.b4x.com/forum/share-your...chat-file-transfer-application.html#post19297 you'll see a way to communicate between several members of a lan. This works not only on Wi-Fi, but on wired lan as well.

The connection between members on the internet (Wan) is not so simple because you probably have routers in the way, and they hide and use other IP's. It can be done by telling each router which ports to pass through.

See also this discussion which explains a big part of this issue. http://www.b4x.com/forum/questions-help-needed/3528-networking-over-wan.html#post20096

I attach a module which is used for making the connection between members of the net (in the chat it is integrated to the main module, I separated it later).

See this application example of a simple game using remoting library http://www.b4x.com/forum/share-your-creations/4946-game-two-using-remoting.html#post28687

I hope this will help you.:)
 

Attachments

  • Connect.bas
    8 KB · Views: 310
Last edited:

ExcludeReality

Active Member
Licensed User
Thanks for the examples.
But it seems rather complicated, and I hate to work with code I don't understand.

I'll look into it later
 

ExcludeReality

Active Member
Licensed User
I don't think it's what I'm looking for.
I'd like to keep it as simple and fast as possible.

I might go with my idea on reading and writing data from a private webpage.
Which brings me to another question; How do I write data to a webpage?
 

mjcoon

Well-Known Member
Licensed User
Using the HTTP library you can connect with an HTTP server. Then you can send the data.

But won't you (ExcludeReality) need a program of some sort running on the server to accept the data and park it somewhere?

(I did do some of this stuff using M$'s IIS at work last year before I retired but seem to have forgotten the details since!)

Mike.
 

ExcludeReality

Active Member
Licensed User
But won't you (ExcludeReality) need a program of some sort running on the server to accept the data and park it somewhere?
To my understanding a server IS a program that stores and delivers content.

As I said before I have no experience with this.
 

mjcoon

Well-Known Member
Licensed User
To my understanding a server IS a program that stores and delivers content.

True! Although in an expression like "server farm" I think that the hardware is meant.

But I was just drawing a distinction between any old freebie web server which allows you to put HTML files in their filestore with a few simple rules (e.g. top-of-tree being called something like "index.htm"), and others that allow you to write your own server-side programs to run on their hardware (which might run Unix).

Of course if you offer your own PC as the server (and I'm not sure what arrangements are needed with an ISP to do that) you can make up your own rules!

Mike,
 

ExcludeReality

Active Member
Licensed User
This turned out to be more complicated than I thought.

I guess I could experiment with the code and get a PC to use as a server, but I don't think it's worth it.
Besides, I really want to get this game published as soon as possible.

Thanks for your help anyway
 
Top