Results 1 to 8 of 8

Thread: Visual Basic 2008 Multiplayer Game/MySQL HELP!

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2009
    Posts
    55

    Question Visual Basic 2008 Multiplayer Game/MySQL HELP!

    Hello everyone!


    Thank you for taking an interest in this thread/topic, hope you can contribute to what I need done!

    (Okay, I'm done talking fancy)

    So basically, I want to make a multiplayer game. Now, I understand how a multiplayer game works, and everything, blah blah.


    Basically, I have 2 pictureboxes that can be moved based on the player input.

    So what I'm all out saying, is how can I send data between two .exe /Visual Basic applications without having to constantly upload and download files.



    How my old version worked is, both applications would be constantly downloading files of the other user's positions, and would be uploading theres. This caused a memory/buffer overflow, and timed out with lagg.

    Is there a way with MySQL to transfer such data?

    I have a MySQL.DATA.DLL reference installed, and I'm using the following code to connect to my database, (which is successful)

    Code:
    Imports MySql.Data
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim conn As New MySql.Data.MySqlClient.MySqlConnection
            Dim myConnectionString As String
    
            myConnectionString = "server=127.0.0.1;" _
                        & "uid=root;" _
                        & "pwd=;" _
                        & "database=TEST;"
    
            Try
                conn.ConnectionString = myConnectionString
                conn.Open()
    
            Catch ex As MySql.Data.MySqlClient.MySqlException
                MessageBox.Show(ex.Message)
            End Try
    
    
        End Sub
    
    End Class


    Now how can I input/read data from my MySQL database?
    I'm very good with PHP and connecting that way, so I'm pretty fimiliar with my current structure.


    Okay, so all of this may seem very consfusing in the way I put it. Sorry :P

    If you can answer any of my following questions explained in detail above;

    1. How can I input/read data from MySQL Database
    2. How can I transfer data(preferably strings) between two VB.NET Apps
    3. How can I make a user 'chat' application to get me started



    THANKS EVERYONE!

    *links/projects/code/examples/explanations are all helpful! THANKS*


    OH!

    Forgot to mention!


    The .DLL reference file I'm using, is:
    http://www.mediafire.com/?p67p8z3e8o3ldsn

    PS: It's an installer, not the direct .dll

  2. #2

    Re: Visual Basic 2008 Multiplayer Game/MySQL HELP!

    1. Wrong subforum for this kind of thing.
    2. I'd use UDP for transferring positions of people. I think there's a UDP topic in the codebank actually...

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2009
    Posts
    55

    Question Re: Visual Basic 2008 Multiplayer Game/MySQL HELP!

    1.Yeah, haha. Sorry. Can you move it? I don't know what I was doing, I was in a rush and quickly hit "New Thread"

    2. Yeah, I've done some research on the subject, and when it comes to literally programming using UPD and system.net.sockets, I draw blanks. Could you maybe help me out here? Code? Examples? Links... anything?

    THANKS DUDE!



    LOVE YA LONG TIME!! (no homo. actually, on second thought, definitely homo!)

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Visual Basic 2008 Multiplayer Game/MySQL HELP!

    Moved From The CodeBank

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

    Re: Visual Basic 2008 Multiplayer Game/MySQL HELP!

    Take a look at the UDPClient class. Search for UDPClient on MSDN and you'll find a the documentation for the class. They might have an example aswell.
    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
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: Visual Basic 2008 Multiplayer Game/MySQL HELP!

    If it's a multiplayer game, UDP is unreliable. You want a straight TCP connection. Check out the codebank, there's dozens of examples. You can also search for WCF (Windows Communication Foundation) which is like an automatic client-server project. It takes a lot of the grunt work out of communication for you.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

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

    Re: Visual Basic 2008 Multiplayer Game/MySQL HELP!

    UDP is favorable in real-time communication, where speed is preferred over a low packet loss. Altough some games might be able to use TCP for communication (typically games with "slow" gameplay...strategy games, board games, card games..), UDP is still the main protocol for games.

    It is unclear whether or not this particular game really needs to use UDP or not though.
    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)

  8. #8

    Thread Starter
    Member
    Join Date
    Oct 2009
    Posts
    55

    Thumbs up Re: Visual Basic 2008 Multiplayer Game/MySQL HELP!

    Quote Originally Posted by Atheist View Post
    UDP is favorable in real-time communication, where speed is preferred over a low packet loss. Altough some games might be able to use TCP for communication (typically games with "slow" gameplay...strategy games, board games, card games..), UDP is still the main protocol for games.

    It is unclear whether or not this particular game really needs to use UDP or not though.
    You say UDP is most-likely the most stable real-time communication? ..or the most fast atleast?

    That's what I need. The game I'm working on involves a lot of variables and data to transfer over a 100milisecond time interval. Do you know how I can get started? Sorry. Google draws blanks for me.


    Visual Basic 2008 or Visual Basic 2010

    No C++

    I'm done with C++

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