CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Posts
    2

    simple network game

    hi,

    I'm looking for a simple network game/application (ie. TicTacToe) to learn something about network programing with C
    The game should be divided into a client (windows) and a server (*nix) application

    BTW the server shouldn't be much more advanced than the one showed here:
    http://www.pradnik.net/netman/client...l#simpleserver


    Can anybody show me any working examples/tutorials?

  2. #2
    Join Date
    Sep 2005
    Location
    London
    Posts
    208

    Re: simple network game

    Quote Originally Posted by satanowicz View Post
    I'm looking for a simple network game/application (ie. TicTacToe) to learn something about network programing with C
    Learning network programming from 'online games sources' will probably make things more complicated.

    Keep it simple, the URL you've posted shows you how to build a simple client/server application.
    That's basically almost everything you need in order to build a game or any app that simply needs to transfer data over the network.

    In your case (Tic-tac-toe) you can send a single char to represent each one of the players move.
    (The board has 9 positions so any number between 1-9 will do.)
    The 'receiving side' will receive the data and interpret it as needed.


    BTW: if you want I will be more than happy to send you a Tic-tac-toe game that I wrote in C. Bear in mind that it doesn't have online capabilities and it was written in DOS times with mouse support and 256 colors bitmaps, so the code is a bit nasty 8-).

    Regardless, I believe that reading a good book on networks programming and writing your own code will be much more beneficial.


    Good luck
    Doron Moraz


    EDIT: You can also visit the following web site for a nice collection of games...
    http://www.thefreecountry.com/sourcecode/games.shtml
    Last edited by Doron Moraz; June 16th, 2009 at 08:07 AM.

  3. #3
    Join Date
    Jul 2005
    Posts
    185

    Re: simple network game

    Agee with Doron (shalom!)!

    Looking at a made online game would probably only confuse you, and I'm saying that from experience.
    Why you're asking?
    Simply because a game is not about "network programming", but about the game itself!
    It has the game's logic, which means MUCH stuff that has nothing to do with network programming.

    So start looking at client/server examples, google for it.

    Only then try to learn how to implement a game logic into a program, that eventually uses the network part to scale over two or more computers (i.e online game).

    Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured