|
-
Sep 30th, 2010, 08:09 PM
#1
Thread Starter
Member
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
-
Sep 30th, 2010, 09:37 PM
#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...
-
Sep 30th, 2010, 09:47 PM
#3
Thread Starter
Member
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!)
-
Oct 1st, 2010, 05:37 AM
#4
Re: Visual Basic 2008 Multiplayer Game/MySQL HELP!
-
Oct 1st, 2010, 05:44 AM
#5
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.
-
Oct 1st, 2010, 08:45 AM
#6
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.
-
Oct 1st, 2010, 08:51 AM
#7
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.
-
Oct 1st, 2010, 01:56 PM
#8
Thread Starter
Member
Re: Visual Basic 2008 Multiplayer Game/MySQL HELP!
 Originally Posted by Atheist
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|