No announcement yet.

What's involved in a game playable across the internet?

  • Filter
  • Time
  • Show
Clear All
new posts

  • What's involved in a game playable across the internet?

    I've been writing little tiny games for fun and I've been wondering about making a word game that can be played across the internet or a local network. I've been reading this forum a little looking for clues as to what's involved but if I saw them I didn't recognize them.

    About 25 years ago I did a lot of communications programming for a few years but that was all over a serial port and that is the extent of my experience. I've never dealt with networks at all except as a user.

    I have a small home network that I think I can test on by myself.

    What I have in mind is a simple word building game. I've already made a solitare version of it and it might work nicely as a two player game. The amount of communication would be minimal so there's no speed issue. I'd like to make it very simple for non-techie peeople to connect to one another and I haven't the slightest idea what's involved in that.

    Can anyone give me some ideas about what I'll need to learn and what tools I might need other than PB9, if any, and especially any thoughts on the difficulty of this. I'm retired and I don't want any large projects. I want to do simple things that can be done quickly. I don't mind spending time learning. I just don't want the project itself to be very big.

    At this point this is just something I'm wondering if I want to get into but I really don't know where to look for information or what information to look for.

    Thanks for any ideas or suggestions you might give me.


  • #2

    From a 10,000 ft view:

    You need to communicate over TCP/IP which means you'll need to know what each person's IP addresses are. Since most Internet connections get an address from a "pool" of available addresses, its not "easy" to always know what addresses to use. There are three common ways to get around this.
    1. Use a special service that keeps track of your current IP and 'publishes' it (see DynDNS, etc)
    2. Have each person check their address (or have your program show it to them) when they want to play, then use EMail, chat, or some other service to tell the other what address they need to enter to make the connection.
    3. Have a dedicated computer on the Internet that has a static (non changing) IP address. Every player connects to this server first, and the server locates the other players that are "on-line". When you connect to a server like this, it can see what address you have so it is able to "tell" each gamer (your program actually) what addresses to use.

    The 3rd option is the most common, and the easiest for 'non-techies' to use, but obviously you need some fairly serious stuff to make it work. Most ISP charge at least $10.00 extra per month for a static address. You could however, create a CGI application that runs on a web server which would probably be cheaper for you in the long run.

    Once you know the addresses, you'll need to write a Client/Server application. These two programs (could be one program but doing both serving and requesting) do the actual "talking" back and forth. The take the information from the other side and 'feed' it to your game. This functionality could be built into your game, in which case you'd probably want to run a few separate to send, one to listen, and one for your actual game program.

    If you look at the echo server example in the PB samples folder, you can get a basic idea of how a client/server application works. Its not really all that hard, but there are a number of little pieces that need to work together in order to pull it all off. The hardest part though, will be finding out the necessary IP addresses of each player, and dealing with any firewalls that may be between them.
    Software makes Hardware Happen


    • #3
      Thanks for the overview. That gives me some ideas where to look to learn more about this.