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.

Author
Message
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Dec 2010 13:29
For starters, I don't need suggestions for different plugins, I'm using the default DB multiplayer commands.

I've gone through the included example in the help file and that's managed to get me started. The machines connect and I'm able to send messages. My question though is how can I determine when a new player has joined? Is my only option to continuously call the checklist for net players and see which are different? What about when a player leaves?

In my particular game, sending messages to all players works out. But if I did want to send a message to a specific user, how could I even tell them apart?

And I'm not quite sure what the "net sessions" are. I thought maybe I could call this checklist to get a list of currently running servers to connect to, but it appears that I already need to be connected to something. The logic of these multiplayer commands is a little confusing. No wonder I haven't touched them in my 10 years of DB.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Dec 2010 22:26
Apparently, nobody else knows either.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 30th Dec 2010 22:46
I saw recently some tutorials on youtube (Dark Principles I think?) Detailing the creation of a server in one, and a client in the other; using the DBP built in commands.

I dunno if that helps you or not, I didn't watch them as I'm planning on using 3rd party plugins for my project.

And sorry I don't have the links.

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Dec 2010 00:33
I'll definitely take a look at them. Although my design won't have the server and client so separated.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
Lucas Tiridath
AGK Developer
17
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 31st Dec 2010 11:21
Hi. I've done a couple of two player games using dbp's default multiplayer commands.

A net session is just a game I think so you can detect all the net games running on a network with the 'perform checklist for net sessions' command. To find network connections, you need to use the 'perform checklist for net connections' command.

Once you've created a game or session, you can run the 'net player created()' command which returns the id of a new player joining the game or 0 if no new players have joined. Another command, 'net player destroyed()', does the same thing for players leaving a game. It returns the player who left's id or 0 if no players have left.

You can tell players apart with their id numbers. The send net message command takes a player id if you just want to send the message to that player or, as you suggest you've already descovered, takes 0 to mean send the message to all the players. When you run the 'perform checklist for net players' command, the 'checklist value b()' command returns a player's universal id.

Hope this helps. I'm afraid I'm no expert on this but if you have any other questions, I will do my best to answer. Good luck!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 31st Dec 2010 15:37
Depending on the type of game you are making, and how many players you want to support, you might consider at least using Multisync.

The builtin commands aren't going to support more than 8 players. (at least that's what has been mentioned before..) If you're making a 2 to 4 player game it may be fine.

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Dec 2010 19:00
I started looking at multisync earlier. It looks very similar, but slightly easier.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 1st Jan 2011 00:15
..and more powerful since you have options like UDP. But it all depends on what your game is, and the results you are after.

Dr Tank
17
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Southampton, UK
Posted: 1st Jan 2011 01:21
I'm using the standard multiplayer commands. Seem to work OK, although, I am having trouble with "free net game" and subsequently creating a new one. Also have yet to try it out properly online, since the only computers I have access to are on the same router.

I can state that the standard multiplayer commands work fine over LAN, and as long as you don't want to restart games without restarting your program.

Login to post a reply

Server time is: 2026-07-18 05:42:26
Your offset time is: 2026-07-18 05:42:26