Results 1 to 6 of 6

Thread: network multiplayer game

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    12

    network multiplayer game

    I'm making a battleships game and i have a working single player but i want to add a network multiplayer mode. As far as i can tell all i need to be able to do is find a way to send messages between two instances of the program. Can anyone help me with this or point me in the direction of a good tutorial?
    There are 10 types of people in the world, those who understand binary and those who don't

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: network multiplayer game

    What language are you using?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Re: network multiplayer game

    What language and what protocol? There are two different ones you can use and each have their pluses and minuses.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    12

    Re: network multiplayer game

    using VB.net 2010 so far i have a semi working program that uses TCP that can send messages to each other but i can't figure out how to check for a disconnection and it will only work if both instances are trying to connect at the same time
    There are 10 types of people in the world, those who understand binary and those who don't

  5. #5
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: network multiplayer game

    You can not get notified when the TCP connection is closed. When a client disconnects "peacefully" (ie, when the connection is not abruptly terminated), you should handle this by having the client notify the server of this just before it closes its connection. For unforseen connection drops, there's not much you can do other than handle the exception that will occur.

    As for the other problem you mention:
    it will only work if both instances are trying to connect at the same time
    You're going to have to give a more elaborate description of your problem.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  6. #6

    Re: network multiplayer game

    You could check out RattleSnake [link in my signature] or you can check out JMC's Asynchronous Client/Server system, both use Async methods and both handle connections, disconnections, and data sending/receiving.

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