Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Multi Player Sample Help

Multi Player Sample Help

Scheduled Pinned Locked Moved Visual Basic
game-devsysadminhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mholmes3038
    wrote on last edited by
    #1

    Hello everyone. I have a simple request. I need a simple source code sample of how I would make a p2p style multi player game in Vb 2010. I know it would use a network stream and everything streamed would be in a class. But Ive never worked with network streams before so a very simple code sample would help me a lot. A simple input box, type in IP, connect type sample would be great. Thanks in advance.

    K 1 Reply Last reply
    0
    • M mholmes3038

      Hello everyone. I have a simple request. I need a simple source code sample of how I would make a p2p style multi player game in Vb 2010. I know it would use a network stream and everything streamed would be in a class. But Ive never worked with network streams before so a very simple code sample would help me a lot. A simple input box, type in IP, connect type sample would be great. Thanks in advance.

      K Offline
      K Offline
      Kevin Schaefer
      wrote on last edited by
      #2

      Yes, you will need to do some stuff with network streams. The only network games I've written were over LANs (my home network). That's a lot easier, since you don't have to worry about security issues (at least at my house :) ), and you don't have to worry about dynamic ip addresses and all that... It is possible, but a little tricky. First, it's a good idea to do all of the network communications asyncronously (such as with a backgroundworker. I have a link to a vb source code I wrote to help me with developing a couple of network programs I wrote a while ago. It basically encapsulates all of the details of the network stuff in a class. You can take a look at it and how it works. You can take a look at http://lance.mckendree.edu/~klschaefer/temp/NetworkHelper.vb[^]. As the name suggests, it makes doing network stuff a little easier, but feel free to learn how it works and expand on it. If you haven't done any network stuff at all, I would suggest making a simple chat program just so you can get something under your belt. I would consider what I've done to be a server/client program, so one of the machines is designated as a "server" and the other as a "client", although beyond initially setting up the connection, that designation pretty much doesn't do anything: both can send and receive exactly the same. Anyways, I hope this helps!

      M 1 Reply Last reply
      0
      • K Kevin Schaefer

        Yes, you will need to do some stuff with network streams. The only network games I've written were over LANs (my home network). That's a lot easier, since you don't have to worry about security issues (at least at my house :) ), and you don't have to worry about dynamic ip addresses and all that... It is possible, but a little tricky. First, it's a good idea to do all of the network communications asyncronously (such as with a backgroundworker. I have a link to a vb source code I wrote to help me with developing a couple of network programs I wrote a while ago. It basically encapsulates all of the details of the network stuff in a class. You can take a look at it and how it works. You can take a look at http://lance.mckendree.edu/~klschaefer/temp/NetworkHelper.vb[^]. As the name suggests, it makes doing network stuff a little easier, but feel free to learn how it works and expand on it. If you haven't done any network stuff at all, I would suggest making a simple chat program just so you can get something under your belt. I would consider what I've done to be a server/client program, so one of the machines is designated as a "server" and the other as a "client", although beyond initially setting up the connection, that designation pretty much doesn't do anything: both can send and receive exactly the same. Anyways, I hope this helps!

        M Offline
        M Offline
        mholmes3038
        wrote on last edited by
        #3

        thanks, its looks great. Ill have to play with it some.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups