Results 1 to 20 of 20

Thread: multiplayer support

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    51

    Question multiplayer support

    What is the best way to add multi-player support to a game?

  2. #2
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176

    Re: multiplayer support

    Are you using Direct X?

    You can use the winsock control or if you want to use DX you can use Direct play
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    51

    Re: multiplayer support

    I'm not using directx. What is the best way to send data over winsock?

  4. #4
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: multiplayer support

    Quote Originally Posted by simgirl
    I'm not using directx. What is the best way to send data over winsock?
    The Winsock Hide Out

    Learn Winsock

    Pino

  5. #5
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: multiplayer support

    What language you in?
    In VB winsock is actually very easy to learn and get used to.

    I have yet to try winsock in c++, but my next project requires I learn it.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    51

    Re: multiplayer support

    I am programming in VB. Is the winsock file to use called: mswinsck.ocx?

  7. #7
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: multiplayer support

    Quote Originally Posted by simgirl
    I am programming in VB. Is the winsock file to use called: mswinsck.ocx?
    hold ctrl+t

    Go to Micosoft Winsock Control 6.0 and select it,

    The you will see it on your tool bar, look at the FAQ I linked to above

  8. #8

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    51

    Re: multiplayer support

    I've gotten my multiplayer feature in my game almost working now, but I have 1 problem. To much data is being sent at once from the host to the client for some reason. I'm having problems figureing out why its happening so I can stop it. I got it so that the host sends the current game to the client and then the game starts and the host then starts sending the data for the game. Why is too much data being sent at once and how can I stop it from happening?

  9. #9
    Member
    Join Date
    Feb 2005
    Location
    Usa Nyc
    Posts
    45

    Re: multiplayer support

    Because thats the way sockets work. Packets get stacked on the stream. I had that kind of problem, actually I think anybody who coded big winsock apps had that problem. One thing you can do is sleep() which would pause and let the packet get sent out of the stream. Or you can use headers. For instance one packet is "10" the id and the other is "BoB" the name. What you can do is..
    Send the packet "ID:10" and then send the packet "NAME:Bob" if your names and ids contain the delimeter ":" then find another one else its perfect. Then in your dataarrival use a for loop 0 to the occurences of ":" - 1 then in the loop you just split it in a nice way and get all your info.
    Kiss, Aerosmith, Black Sabbath, Nazareth, Judas Priest, Status Quo, Cinderella, Scorpions, Tool, SteppenWolf.

  10. #10
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: multiplayer support

    Quote Originally Posted by Evgeni
    Because thats the way sockets work. Packets get stacked on the stream. I had that kind of problem, actually I think anybody who coded big winsock apps had that problem. One thing you can do is sleep() which would pause and let the packet get sent out of the stream. Or you can use headers. For instance one packet is "10" the id and the other is "BoB" the name. What you can do is..
    Send the packet "ID:10" and then send the packet "NAME:Bob" if your names and ids contain the delimeter ":" then find another one else its perfect. Then in your dataarrival use a for loop 0 to the occurences of ":" - 1 then in the loop you just split it in a nice way and get all your info.
    I dont personally like sleep(), your best bet is delimeters, have a look at the link below, its a guide i wrote a while back.

    http://www.vbforums.com/showthread.php?t=297570

    Pino

  11. #11

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    51

    Re: multiplayer support

    Quote Originally Posted by BodwadUK
    Are you using Direct X?

    You can use the winsock control or if you want to use DX you can use Direct play

    How would you use Directplay in DirectX?

  12. #12
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: multiplayer support

    Quote Originally Posted by simgirl
    How would you use Directplay in DirectX?
    http://216.5.163.53/DirectX4VB/TUT_DX8_DP.asp

  13. #13
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176

    Re: multiplayer support

    Only send data at certain intervals. You dont need to send it every frame if its a game for example
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  14. #14

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    51

    Re: multiplayer support

    Does anybody know where I can find the DirectX SDK for VB?

  15. #15
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: multiplayer support

    It was in the sticky FAQ DirectX starter projects

    http://www.vbforums.com/showthread.php?t=280609

    On #18 is DirectX 8.1 SDK which installs both the C++ projects and VB projects

  16. #16

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    51

    Re: multiplayer support

    Is there 1 for DX 9.0?

  17. #17
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051

    Re: multiplayer support

    Microsoft have broken compatibility between VB6 and DX9.0, meaning that you can't use VB6 to make a game that uses DX9.
    If you're using VB.NET then you can, otherwise you're stuck with using versions of DX that are pre-9.0

    No worries though, DX7 and 8 should be fine if all you're gonna use it for is networking.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  18. #18
    Hyperactive Member notquitehere188's Avatar
    Join Date
    Dec 2004
    Posts
    403

    Re: multiplayer support

    if you want to wait for it to finish sending you can alway use the sendcomplete event on the winsock control
    It's not just Good, It's Good enough!



    Spelling Eludes Me

  19. #19
    Addicted Member Nigh™a®e's Avatar
    Join Date
    Feb 2002
    Location
    Belgium
    Posts
    175

    Re: multiplayer support

    Simgirl

    What programming language and graphics libraries u use?

    If using vb.net, i woulnd use the winsock ocx control ... using the socket classes of the .net framework. There are easy to use and easy to make async sockets streams.

    About DirectPlay for DirectX ... they left it out of the SDK sinds December 2004 release

    U can get the latest DX SDK for free at MSDN
    http://msdn.microsoft.com/directx/di...s/default.aspx

  20. #20
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: multiplayer support

    Quote Originally Posted by Nigh™a®e
    About DirectPlay for DirectX ... they left it out of the SDK sinds December 2004 release


    That is because there has been no changes to it in a looong time. And DPlay is depricated. But there is roumers saying it will be in the next version of DX though. But THAT can take a while.



    ØØ

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