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 / Multiplayer commands

Author
Message
Hybrid1973
14
Years of Service
User Offline
Joined: 29th Oct 2011
Location:
Posted: 30th Oct 2011 18:49
Hi there and have a nice sunday everyone:
although my DB version supports and execute commands like MULTIPLAYER GET IP ADDRESS(), I can't read nothing about statements that begin with MULTIPLAYER in the help/index session and in the line that reads suggestion for the statement you're typing in.

I think there's a lot of interesting statements to work with..
Can anybody tell me why please?

TY in advance
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 31st Oct 2011 05:30
You went under commands and tried to look at the Multiplayer commands? Did it just not link to it? If so you might need to reinstall DBPro.
Hybrid1973
14
Years of Service
User Offline
Joined: 29th Oct 2011
Location:
Posted: 31st Oct 2011 09:01
Hi Da_Rhyno, & thanx for reply;
in DB help menu, I can see no statements that begin with "MULTIPLAYER" but if I write one of them in my code (i.e. MULTIPLAYER GET IP ADDRESS()) they work properly.

I have 3 PCs in a LAN network (2-WinXP32; 1-Win7); everyone of them with DB installed and everyone of them with the same "problem";
I really don't think I can solve reinstalling DB...
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 31st Oct 2011 13:54
Something doesn't seem right, the section in the Multiplayer part of the help files has been attached; but I can't think of why you are unable to find it, perhaps you simply didn't search with the NET keyword. The link should be third from the bottom of the commands page.

Although you are new and it does help to develop an understanding of all the commands in the standard set; note that this multiplayer command set is not the best. When you are ready, you will need to look into using plugins such as DarkNet or MultiSync or Matrix1 instead, as these provide more up-to-date and convenient multiplayer solutions; the same way you'd use MS Office Word instead of Wordpad, these plugins are better than the basic multiplayer functions supplied. Plugins can be obtained through the forum or official webpage.

The standard multiplayer commands:
Quote: "This command set makes the creation of multiplayer applications simple by keeping the connection, disconnection and exchange of network data simple. Values, strings and even memblocks can be shared across a multiplayer session.


DEFAULT NET GAME : Return Integer=DEFAULT NET GAME(Gamename, Playername, Number Of Players, Game Type)
CREATE NET GAME : CREATE NET GAME Gamename, Playername, Number Of Players
JOIN NET GAME : JOIN NET GAME Session Number, Playername
FREE NET GAME : FREE NET GAME
CREATE NET PLAYER : CREATE NET PLAYER Playername
FREE NET PLAYER : FREE NET PLAYER Player Number
SET NET CONNECTION : SET NET CONNECTION Connection Number

PERFORM CHECKLIST FOR NET CONNECTIONS : PERFORM CHECKLIST FOR NET CONNECTIONS
PERFORM CHECKLIST FOR NET SESSIONS : PERFORM CHECKLIST FOR NET SESSIONS
PERFORM CHECKLIST FOR NET PLAYERS : PERFORM CHECKLIST FOR NET PLAYERS

SEND NET MESSAGE INTEGER : SEND NET MESSAGE INTEGER Player Number, Integer Value
SEND NET MESSAGE FLOAT : SEND NET MESSAGE FLOAT Player Number, Float Value
SEND NET MESSAGE STRING : SEND NET MESSAGE STRING Player Number, String
SEND NET MESSAGE MEMBLOCK : SEND NET MESSAGE MEMBLOCK Player Number, Memblock Number
SEND NET MESSAGE BITMAP : SEND NET MESSAGE BITMAP Player Number, Bitmap Number, Guarentee Packet
SEND NET MESSAGE IMAGE : SEND NET MESSAGE IMAGE Player Number, Image Number, Guarentee Packet
SEND NET MESSAGE SOUND : SEND NET MESSAGE SOUND Player Number, Sound Number, Guarentee Packet
SEND NET MESSAGE MESH : SEND NET MESSAGE MESH Player Number, Mesh Number, Guarentee Packet
GET NET MESSAGE : GET NET MESSAGE
NET MESSAGE INTEGER : Return Integer=NET MESSAGE INTEGER()
NET MESSAGE FLOAT : Return Float=NET MESSAGE FLOAT()
NET MESSAGE STRING$ : Return String=NET MESSAGE STRING$()
NET MESSAGE MEMBLOCK : NET MESSAGE MEMBLOCK Memblock Number
NET MESSAGE IMAGE : NET MESSAGE IMAGE Image Number
NET MESSAGE BITMAP : NET MESSAGE BITMAP Bitmap Number
NET MESSAGE SOUND : NET MESSAGE SOUND Sound Number
NET MESSAGE MESH : NET MESSAGE MESH Mesh Number

NET GAME EXISTS : Return Integer=NET GAME EXISTS()
NET MESSAGE EXISTS : Return Integer=NET MESSAGE EXISTS()
NET MESSAGE PLAYER FROM : Return Integer=NET MESSAGE PLAYER FROM()
NET MESSAGE PLAYER TO : Return Integer=NET MESSAGE PLAYER TO()
NET MESSAGE TYPE : Return Integer=NET MESSAGE TYPE()
NET GAME LOST : Return Integer=NET GAME LOST()
NET GAME NOW HOSTING : Return Integer=NET GAME NOW HOSTING()
NET BUFFER SIZE : Return Integer=NET BUFFER SIZE()
NET PLAYER DESTROYED : Return Integer=NET PLAYER DESTROYED()
NET PLAYER CREATED : Return Integer=NET PLAYER CREATED()


"


Hybrid1973
14
Years of Service
User Offline
Joined: 29th Oct 2011
Location:
Posted: 31st Oct 2011 16:42
Hi Chris, I can see all NET statements you quoted;
I cannot see statements that begin with the reserved word MULTIPLAYER.

Maybe you don't know about: I didn't know nothing about until some days ago. I was searching for a function capable of retrieve local IP address of a lan PC and I discovered - not without surprise - that a function called MULTIPLAYER GET IP ADDRESS() and much more beginning with "MULTIPLAYER" exist and they're not mentioned in the editor's help;

search "MULTIPLAYER GET IP ADDRESS()" in TGC forums to have an idea of what I'm referring to. Bye.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 31st Oct 2011 18:06
I see.

Unfortunately some of the commands that exist are indeed undocumented.

Hybrid1973
14
Years of Service
User Offline
Joined: 29th Oct 2011
Location:
Posted: 31st Oct 2011 19:52
Ok;

I've tryed to find documentation somewhere else (in the forum);

http://forum.thegamecreators.com/?m=forum_view&t=62819&b=1

anyway it seems impossible that official documentation does not exist...
Hybrid1973
14
Years of Service
User Offline
Joined: 29th Oct 2011
Location:
Posted: 2nd Nov 2011 16:24
I think I can post in this thread without going off topic;
I have a question about multiple net games:

making a game 1 versus 1, is possible to create istances of a net game on a single server for allow multiple parallel and indipendent matches?

And anyway, is it possible in P2P mode (with a player as host and the other one as client)?

Thanx
Agent
21
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 6th Nov 2011 02:06
Solve all of your problems in one hit by ignoring the built in communication commands in DBPro (they're horrible and buggy and horrible and horrible!).

Run a search on the forums for a plugin called MultiSync. I promise, your life just got much easier.

You're welcome

basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 6th Nov 2011 09:13
multisync is good. the problem is it only uses TCP.

TCP means that delivery of data packets is guaranteed every time a packet is sent. this is unnecessary in if the player position keeps changing because the app has to send 10's of messages over a short time which will cause the system to slowdown.

UDP is a better option and more efficient if we have to send multiple message over a short time.

use Dark dark net or matrix1util-28
Hybrid1973
14
Years of Service
User Offline
Joined: 29th Oct 2011
Location:
Posted: 6th Nov 2011 12:49
Thank you very much for your precious support;

@basjak & @Agent
maybe you won't believe me but I downloaded both plug-ins before reading your reply.
That's cause they seem nice where the native commands fail.

Maybe standard multiplayer commands are "uncomplete" but they work fine in a LAN.
But the question is:
why 256 players can play togheter if commands work only in LAN?
Is there someone that owns 256 computers or can hold 256 friends with al their computers in his home or can play a videogame in his office with his 256 colleagues?

Ok ok, maybe someone in the world can match this lucky one, but I think is a very very very (and much more very) low percentage of world population.

I think ther must be a way to make native multiplayer commands work through the WWW or I really didn't understand their purpose.

@basjak & @Agent (and obviously @everyone else can help)
after a so annoying explanaition of my deepest thoughts, the final question is:
I'm making a (or some) videogame(s) just like you all are doing too;
I need that (i.e.)Agent that lives in Australia could play it (them) against some other players in the most remote and far away countries in the world.
How can I do to realize the goal? I think this is a question whose answer could help many DB programmers.
Maybe the question is already somewhere in the forums but I apologize; I didn't find it. Bye.
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 6th Nov 2011 17:50
Quote: "why 256 players can play togheter if commands work only in LAN?"


maybe someday, you would make a software for a company that have 256 staff.

Quote: "I need that (i.e.)Agent that lives in Australia could play it (them) against some other players in the most remote and far away countries in the world.
How can I do to realize the goal? I think this is a question whose answer could help many DB programmers."


http://forum.thegamecreators.com/?m=forum_view&t=188829&b=1&p=0

http://forum.thegamecreators.com/?m=forum_view&t=186814&b=1
Agent
21
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 6th Nov 2011 22:26 Edited at: 6th Nov 2011 22:33
Quote: "TCP means that delivery of data packets is guaranteed every time a packet is sent. this is unnecessary in if the player position keeps changing because the app has to send 10's of messages over a short time which will cause the system to slowdown. "


I don't mean to be rude, but confirmation is essential in almost all types of games. Do you remember the days of modem-to-modem games such as DOOM and the original Command & Conquer, where Out Of Sync errors were the rule, not the exception? These were caused by absent error correction (confirmation). They used rapid fire position updating that worked most of the time, allowing the game to go on for a while. However, if there were a short string of missed packets, just once, you'd desync and the connection was lost, terminating the session. This is impossible with the TCPIP protocol, and stability is paramount.

In games where certain statistics (like, as you say, player position) are updating rapidly, you are right in that you don't want to have to confirm hundreds of updates per second - but there are far more efficient ways of handling player position instead of merely sending an update every time it changes, and these methods don't require nearly as much throughput. My MMORPG, Solodor, is capable of maintaining accurate positioning for tens of thousands of entities across hundreds of clients simultaneously with a minimum of bandwidth using such techniques (finite-state entity syncing combined with entity interpolation and predictive input handling). Desyncs are outright impossible unless the connection itself is broken. An entity's position can update anywhere up to forty times per second, and yet I only send positioning updates at absolute most only two or three times per second, and with each update being only nine bits long I'll never saturate any server-like bandwidth.

If you don't use some kind of error correction or delivery confirmation (ie, the TCPIP protocol) then you have no alternative but to flood the network with rapid-fire updates to ensure that a missed packet has no discernible effect. I can't think of any type of game where this is preferable to modern-day low-volume high-accuracy communication techniques.

That kind of went on longer than I'd intended it to, but I didn't want the new guy operating on incomplete advice I wholeheartedly recommend TCPIP for just about all conceivable requirements of netcode, and actively discourage the use of UDP. If you write your netcode properly, you'll have failsafe packet delivery and low volume bandwidth requirements.

Login to post a reply

Server time is: 2026-07-11 12:00:47
Your offset time is: 2026-07-11 12:00:47