Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Client/Server mode in DBpro Multiplayer

Author
Message
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 28th Feb 2004 10:31
As far as I know, DBpro's multiplayer commands are built on DirectPlay. And if I am not mistaken, DirectPlay support Peer to Peer or Client Server mode.

Has anybody tried create a multiplayer game in client/server mode using DBpro? I know it can be done (well, from the documentation) by setting the flag of CREATE NET GAME. But how I do send message to the designated server after the net game is created? I can't find any function like SEND NET MESSAGE TO SERVER.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 28th Feb 2004 10:38
Sorry I can't answer your question because I haven't tried, but on a related note - Wasn't someone creating a Winsock plugin? Whatever happened to that?


"Computers are useless they can only give you answers."
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 28th Feb 2004 11:05 Edited at: 28th Feb 2004 11:05
well... I tried to avoid using Winsock if possible. DirectPlay has the session management, and all the message handling built-in, which can save me some time for that.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Mussi
22
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 28th Feb 2004 12:36




Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 28th Feb 2004 14:33
Quote: "player 0 should be the server"


Are you certain about this? Have you tried sending to player 0 and it always route it to the server?

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Mussi
22
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 28th Feb 2004 15:19
doh so wrong, that's sending to all players, it's player 1(99.9% sure).



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
AciDucK
21
Years of Service
User Offline
Joined: 13th Aug 2003
Location:
Posted: 28th Feb 2004 15:26
I am currently working on a server-client game, and this is how I send data to the server:



Player 0 is not always the server. He starts as player 0, but he is pushed to higher places when other players join.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Feb 2004 15:27
Player 0 is everyone connected to the game

All that client/server mode does is tell DirectPlay to route *all* messages through the server machine no matter who the message is for. It doesn't give the server any special functionality. You may as well use peer to peer, so you have the option of fast message transmission to the other clients.

I guess that the best way to do the server is to reserve a special message type that you transmit to all users, but only the server machine responds to (either because it is a server-only program, or because it knows it is the server by checking NET GAME NOW HOSTING function)

The winsock plug-in is done and the help files and tutorials are being written as we 'speak'. It's all taken far longer to do than was thought at the start.

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Mussi
22
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 28th Feb 2004 15:32
who made the plugin? where can I get it when all is finished?



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
unjust
22
Years of Service
User Offline
Joined: 25th May 2003
Location:
Posted: 28th Feb 2004 15:50
I currently have a working prototype. Your problem with strings is that they are inefficient. You are better served using a memblock to transmit chat using a guarentee packet. People would be upset if they try to send a message to a friend five times before it got there. Get what I mean? If you are using Client/Server like I am then when you send a message, use 0. Other clients don't have the same code to receive messages as the server, so they wouldn't know how to handle the packet if they did receive it. The message doesn't become available to the other clients until the server sends it to them.
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 28th Feb 2004 17:38
@IanM:

Quote: "It doesn't give the server any special functionality. You may as well use peer to peer, so you have the option of fast message transmission to the other clients."


Erm... I want to maintain the entire game state on the server. The client is merely a view and controller of that game state. This will make synchornizing easier, and improve security. And client/server model scales up better as well, which most game like Half Life and Quake use.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Feb 2004 18:03
A Client/Server *design* will give you what you need ... this does not mean that you need to use the multiplayer commands in client/server mode.

As I understand it, the Client/Server mode in the multiplayer commands forces all of your game data to go via server, whether the data is targetted at the server or not, whereas peer to peer transmits the data directly to its destination.

The main point that I was making is that chat-type messages are better inplemented as peer to peer, while your game messages would continue to be transmitted to the server

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 28th Feb 2004 18:36
Quote: "A Client/Server *design* will give you what you need "


Yes, that's what I am thinking of. That's why I need to designate a player as the server to route all messages. I read that DirectPlay have a designated player for that if I specified client/server mode, I read that in MSDN. There is a special player ID called DPID_SERVERPLAYER but I don't think DBpro implements that.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
AciDucK
21
Years of Service
User Offline
Joined: 13th Aug 2003
Location:
Posted: 28th Feb 2004 18:44
Have you read my post? I gave you a way to find the host:

Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 29th Feb 2004 11:42
Yup. Thanks for that. I guess that's the only way huh? I was thinking of some shortcut.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Overdroid
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location:
Posted: 29th Feb 2004 13:37
On a related note, does anyone have any code snippets for synchronising clocks on machines or predicting player movement between packets?

I'm working on a multiplayer game myself and there doesn't seem to be a lot of info on the forums about things like this.

I'm guessing there aren't a lot of MP projects being worked on.

"If you want an audience, start a fight."
- Gaelic Proverb
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 29th Feb 2004 14:56 Edited at: 29th Feb 2004 14:58
I am working on one, with the target of max. 32 players on a 56kb modem. Quite challenging, but still in research phase. Email me and we can share our progress and findings.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Cartmanbeeps
21
Years of Service
User Offline
Joined: 9th Dec 2003
Location:
Posted: 29th Feb 2004 20:52
Is the multiplayer for darkbasic pro good for MMORPG's (Massivly multiplayer online role playing game) or should i just make a multiplayer shooter?
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 1st Mar 2004 08:05
Well, the DBpro multiplayer commands are quite substantial actually, it is essentially using the DirectPlay API, and it covers all the basic multiplayer functionalities that is needed. Whether it will able to support a MMORPG or not is really depends on how well you use it. I had done some research on various multiplayer techniques and architecture, and I am convinced that the network efficiency in multiplayer games (and also MMORPG) are based on the way you synchronize your game, and also optimizing the amount of data you sent. If given that the multiplayer commands in DBpro are bugless (can anyone confirm this), I am pretty sure you can implement a sound multiplayer game provided you had acquire enough knowledge on the "secret" of various networking techniques behind multiplayer games.

Good luck!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/

Login to post a reply

Server time is: 2025-06-05 19:02:18
Your offset time is: 2025-06-05 19:02:18