What is the best way to add multi-player support to a game?
Printable View
What is the best way to add multi-player support to a game?
Are you using Direct X?
You can use the winsock control or if you want to use DX you can use Direct play :)
I'm not using directx. What is the best way to send data over winsock?
The Winsock Hide Out ;)Quote:
Originally Posted by simgirl
Learn Winsock :)
Pino
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.
I am programming in VB. Is the winsock file to use called: mswinsck.ocx?
hold ctrl+tQuote:
Originally Posted by simgirl
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
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?
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.Quote:
Originally Posted by Evgeni
http://www.vbforums.com/showthread.php?t=297570
Pino
Quote:
Originally Posted by BodwadUK
How would you use Directplay in DirectX?
http://216.5.163.53/DirectX4VB/TUT_DX8_DP.aspQuote:
Originally Posted by simgirl
Only send data at certain intervals. You dont need to send it every frame if its a game for example :)
Does anybody know where I can find the DirectX SDK for VB?
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 :bigyello:
Is there 1 for DX 9.0?
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.
if you want to wait for it to finish sending you can alway use the sendcomplete event on the winsock control
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
Quote:
Originally Posted by Nigh™a®e
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.
ØØ