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.

Program Announcements / Multisync v1.0 - Multiplayer plugin

Author
Message
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 4th Mar 2008 20:02
Some programs I make do crash, yet others don't its pretty much a gambling game over here

Anyway, Back to me cave...
markoal
15
Years of Service
User Offline
Joined: 1st Mar 2008
Location:
Posted: 5th Mar 2008 21:59
Benjamin. How can I fix waiting for join in FPS creator? Thanks
Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 6th Mar 2008 19:58
great plugin, i'm using it in my multiplayer 3rd person shooter and i have a question: I'm using the message commands to send player position data to the other players but i want to add a chat system, how could i make The client know the difference between chat messages and position messages?


thanks to deathead for the sig! please Click on it!
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 6th Mar 2008 20:15
Did you look at his great examples?
define some constants:



and put them as first byte in a message:



and then select for that byte if you recive the messages:

Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 7th Mar 2008 07:41
ah, i get it now. thanks. i had looked at his examples but obviously not closely enough.


thanks to deathead for the sig! please Click on it!
Ben Johnson
16
Years of Service
User Offline
Joined: 6th Jul 2007
Location:
Posted: 8th Mar 2008 00:13 Edited at: 9th Mar 2008 00:27
Ah, other people are experiencing this random crashing, although I have solved the remainders problem by using bytes as packet id's. I still experience problems of occasional crashing for now reason. I reckon this could be something to do with Bluegui since both client and server side my game uses this.

Edit: After running the server for roughly 15 mins and having it crash with BlueGui, I removed the bluegui module of my code and its been going for almost an hour and running fine.
jasonhtml
19
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 11th Mar 2008 17:29
Quote: "Ah, other people are experiencing this random crashing, although I have solved the remainders problem by using bytes as packet id's. I still experience problems of occasional crashing for now reason. I reckon this could be something to do with Bluegui since both client and server side my game uses this.

Edit: After running the server for roughly 15 mins and having it crash with BlueGui, I removed the bluegui module of my code and its been going for almost an hour and running fine."


i dont think this has anything to do with bluegui, even though you got good results by running without it. i dont have bluegui at all, and i get random crashes anywhere from 5 to 30 minutes after someone joins the server(regardless of the number of users that join)

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Mar 2008 19:48
I've just tested some code (specifically one of the examples) for a couple of hours with various clients, and I unfortunately can't produce a crash. Likewise, some code that jasonhtml posted on another thread works for me but eventually crashes for him. This is a mystery.

jasonhtml
19
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 13th Mar 2008 01:03
hm... is it possible that a certain router setting would disconnect the server because of too much packet-flow? seems unlikely, but im just wondering...

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 13th Mar 2008 13:45
Alright, Since I portforwarded my router Mutlisync does not crash my app's anymore... Funny.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 13th Mar 2008 17:00
Quote: "hm... is it possible that a certain router setting would disconnect the server because of too much packet-flow?"

I don't think so.

Quote: "Alright, Since I portforwarded my router Mutlisync does not crash my app's anymore... Funny."

Care to post some code that demonstrates the crash?

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 13th Mar 2008 21:10
The examples crashed for me, and most other things I did too... Which was strange.

I already checked if I did the code right, I've been using MultiSync since it was released
Tv Xxx
16
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 14th Mar 2008 21:20
Hi, I've Been Making An MMOFPS Some people may or may not of seen, but im having problems with connecting over the internet i can get it to connect over lan but over the internet i've had no luck

so i went and had a luck at the Zombies game, and i cant even get that to connect so hees what ive got...



Cheers for any help.

Yours Tv.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 14th Mar 2008 21:30
I think the best way to solve this will be to give a few points, so that you may figure out the solution yourself:

1. The default port for Multisync is 3999.

2. If you want to use a different port, make sure you use net set port in both the server and the client, and make sure it is called before hosting/connecting.

3. When you specify address in net host or net connect you can't specify a port as part of the address. I'm just mentioning this in case you are trying to do this.

4. One computer cannot connect to another computer on the same LAN using an internet IP.

Hope this helps.

Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 29th Mar 2008 22:15 Edited at: 29th Mar 2008 22:25
Hi,
I'm trying to use Multisync from C++.
I copied the dll, header and lib to my project folder (there are actually two: server + client).

I tried to test it with a very-simple console application.

Server:


The server should just run all the time doing nothing but letting players join.

Client:

The client tries to join. But the last message I get if a server's running is the "Hello World!". If not, it reports the TIMED OUT error.

What's wrong? I don't see it.

EDIT:
By the way, I'm using:
- Code::Blocks IDE
- Microsoft Visual C++ Toolkit 2003 COMPILER
- MultiSync v 1.3.2

EDIT:
I also can't connect to the server from a DarkBASIC client.
If I close the server while the client was trying to connect I get the error: "(recv) UNKNOWN 10054"
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 29th Mar 2008 23:01 Edited at: 29th Mar 2008 23:01
EDIT:
In the "Other languages" folder of the "multisync_1.3.2.rar", there are three files:

multisync.h
Multisync.lib
MultisyncDLL.dll

If I copy those files to a project folder and include the header and compile the program, it says "Multisync.dll" wasn't found. It only works if I rename the "MultisyncDLL.dll" to Multisync.dll".

edit: sry, made a new post instead of editing the old one
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2008 05:11
You're not processing window messages, which means no networking activity will be reported. See the code I posted later on in this thread.

Quote: "If I copy those files to a project folder and include the header and compile the program, it says "Multisync.dll" wasn't found. It only works if I rename the "MultisyncDLL.dll" to Multisync.dll"."

Thanks for pointing this out, I've fixed this.

DrReaper
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location: United States
Posted: 2nd Apr 2008 03:27
I downloaded 1.3.2 but it seems all the examples are blank. Am I doing something wrong?
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 2nd Apr 2008 03:36
They work fine here, if you are using the default IDE make sure you have the latest version.

DrReaper
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location: United States
Posted: 2nd Apr 2008 03:52
Thanks Benjamin

I updated the IDE and the help files now have text. How do I know what verison of the IDE I have. Dark Basic Pro still says version 1.063
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 2nd Apr 2008 03:57
I think the only way to check the version of the editor is to locate the editor executable (usually under C:\Program Files\Dark Basic Software\Dark Basic Professional\Editor) and check its version info by right clicking it, selecting 'properties', and then the 'version' tab.

Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 3rd Apr 2008 10:56
Quote: "C:\Program Files\Dark Basic Software\Dark Basic Professional\Editor"

dark basic software? that's where DBC installs, DBP installs in to C:\Program Files\The Game Creators\Dark Basic Professional.
anyway, this is a great plugin, i've finally figured out how to use it!


EotP! Click on it.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 10th Apr 2008 06:50
Update 1.4.1 - 10th April, 2008

A few bugs have been fixed, the most important one being the one that was causing random crashes for some people. Added new net put memblock and net get memblock commands, as well as functions NetPutData and NetGetData for DBC/DarkGDK users. Added new option to define the size of the write buffer.

jasonhtml
19
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 15th Apr 2008 18:30
Thanks benjamin! I'm glad you finally found out what the problem was, because after a few months of having the crashes, i was beginning to look at alternatives such as Barnski's Winsock plugin. but now, it all works flawlessly

SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 17th Apr 2008 02:17
I want to also say thank you Benjamin! Multisync is a fantastic multiplayer solution for DBC/DBPro and I really appreciate your dedicated support to continually improve it.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Apr 2008 04:56
Question:

I've noticed something that I am guessing is part of the multisync library. I've set up my game so that when the player is moving his position is being sent to the server. However, when he isn't moving there's nothing being sent.

It seems the server will disconnect a client after a small (10-15 seconds) amount of time if it doesn't hear something from them.

Aside from setting up a regular packet that gets sent no matter what (such as a ping) is there a way to lengthen this timeout?

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 17th Apr 2008 07:44
Quote: "I'm glad you finally found out what the problem was, because after a few months of having the crashes, i was beginning to look at alternatives such as Barnski's Winsock plugin. but now, it all works flawlessly"

Cool, good to hear it's all working fine now.

Quote: "Multisync is a fantastic multiplayer solution for DBC/DBPro and I really appreciate your dedicated support to continually improve it."

Thanks, I appreciate the feedback.

Quote: "It seems the server will disconnect a client after a small (10-15 seconds) amount of time if it doesn't hear something from them."

As long as the client is calling get message all the time, the server will get responses to pings it sends to check that the clients are still connected. If this isn't the case, does it happen with any of the examples?

Quote: "Aside from setting up a regular packet that gets sent no matter what (such as a ping) is there a way to lengthen this timeout?"

I'll add an option for it in the next update.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Apr 2008 20:02
Quote: "As long as the client is calling get message all the time, the server will get responses to pings it sends to check that the clients are still connected."


So the server does a periodic "round robin" saying "Hey, you still there?". That makes sense.

I just recently hit the coding part for the main loop in the client, so I hadn't got to the part about receiving packets back from the server except in response to specific client querries. I'll drop that in today, and if you don't hear anything back by this evening then that did the trick.

Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 18th Apr 2008 11:35
May I suggest renaming the command "Net Get Player Amount()" to "Net Get Player Count()"? Amount feels a little ambiguous.

http://3dfolio.com
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 18th Apr 2008 13:07
Quote: "So the server does a periodic "round robin" saying "Hey, you still there?". That makes sense. "

Indeed, after a certain period of no activity it sends these messages.

Quote: "Amount feels a little ambiguous."

How so? What other interpretations can you think of?

Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 18th Apr 2008 20:28
Amount just sounds to me like a vague way to refer to the total number of players. I just thought I would make the suggestion.

http://3dfolio.com
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 19th Apr 2008 00:10
I appreciate the suggestion. You're right, it does seem to imply the total amount of players rather than just those connected. I'm not sure if I will change it yet (as renaming commands is something I'm not keen on), but I'll bear it in mind for the future. Thanks.

Darktech
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location:
Posted: 19th Apr 2008 14:10
Request: Make it please possible to "capture" these popups,
the NET CONNECT should give a string back so that you can output it
normally. (Empty when no error)

These popups are sooo annoying.

Thanks in advance.

"I didn`t saw many 13 year old girls that fancy
double barrled shotguns." ~Anonymus~
Tv Xxx
16
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 21st Apr 2008 21:15
Well Benjamin, I Finally Got A Network To Work Over Lan.... and The Interent WOOOOOP. I Could Kiss You For This DLL. But Im Not Into That Kind Of Thing Lol. Cheers Again

Yours Tv.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 21st Apr 2008 21:49
Quote: "Request: Make it please possible to "capture" these popups,
the NET CONNECT should give a string back so that you can output it
normally. (Empty when no error)"

You only get a popup if you don't try to return a value from it. It's there to inform you if the connection fails when you don't check the return value.

Quote: "Well Benjamin, I Finally Got A Network To Work Over Lan.... and The Interent WOOOOOP."

Glad to hear you've got it working.

Darktech
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location:
Posted: 22nd Apr 2008 09:49
But I want to know the error, the string. Because when there is just no connection then I dont want to close the program.

If he has no functional winsocket then I want to close the program.
But why is he using a program with networking anyway?^^

"I didn`t saw many 13 year old girls that fancy
double barrled shotguns." ~Anonymus~
Tv Xxx
16
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 22nd Apr 2008 23:35
One Question ... Ping.

Do You Know Like In Halo, The Score Board Shows Player Ping, (So We Can Work Out Who Is Lagging Out The Game ;p) well Is There Anyway Of Doing That With Mulitsync?

Cheers

Tv.


p.s. if You Were Wondering About The Project Im Using Multisync In, Here It Is...
[href=http://forum.thegamecreators.com/?m=forum_view&t=122252&b=8]
Fighting For Freedom[/href]

SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 23rd Apr 2008 06:42
Quote: "But I want to know the error, the string."


Why not recover it then? It does provide you with the error string (use NetGetError, either through a function or the direct DLL call):



Darktech
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location:
Posted: 23rd Apr 2008 17:15
Oh... I was thinking that it only catches the errors AFTER the connect. So sorry for requesting a built-in feature

(The ping option mentioned above would be nice)

"I didn`t saw many 13 year old girls that fancy
double barrled shotguns." ~Anonymus~
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 23rd Apr 2008 18:51
The Ping thing is very easy to do:
Save time (timer()).
Send a message to the server.
Check for incomming messages.
If the response on the message you sent to server comes in, timer()-*lasttime* will give you the ping.

I'll show some code to extend the example with the moving boxes to do this.
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 23rd Apr 2008 19:21
Here the server:


and here the client:



I've started a server to test this @ hceentserv.no-ip.biz

(I'd actually have a dynamic ip, but this doesn't matter because of noip)
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 27th Apr 2008 14:46
Hmm, now gives some new error

"Unknown 10035"

With the following pieces of code:

Client :


Server :


the client gives the error.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 27th Apr 2008 14:55
You're not actually checking if the connection succeeds. How does this error display, in a message box?

I've recently been doing more work on Multisync, and I may have fixed whatever problem this is already. Try the attached version.

Attachments

Login to view attachments
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 27th Apr 2008 15:00 Edited at: 27th Apr 2008 15:17
The server said player joined, so I assumed it connected.

Anyhow, that did not fix it. I added a check at the start of my loop and until, but still no results. the same error keeps popping up.

Does it matter I am using Vista?

EDIT : That newer dll gave the same result.

EDIT2 : Updated my client and server code a little, still gives the same error, but I fixed some mistakes in values.



Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 28th Apr 2008 20:56 Edited at: 28th Apr 2008 21:02
Glad to say after about an hour of messing about I managed to get 12 people logged onto your example server on my pc , router forwarding was probably most of the work.

GREAT WORK

<edited>

Quote: ""Unknown 10035""


btw I got this while trying it all out. if you don't input a valid IP (as in its not an IP,regardless of if you can connect or not) it returns this.

If it is a valid IP you just seem to get a *time out*

'Ooh 'eck chief'...'crumbs'
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 28th Apr 2008 23:18
Quote: "btw I got this while trying it all out. if you don't input a valid IP (as in its not an IP,regardless of if you can connect or not) it returns this.

If it is a valid IP you just seem to get a *time out*
"


"127.0.0.1" is a valid IP...

Anyhow, I got it to work somehow, but now the server lags like hell. There is a 3 minute wait before the server sends new positions to players...
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 29th Apr 2008 02:27 Edited at: 29th Apr 2008 02:31
A mistake you've made is that you're only checking for messages once a loop. If you're running slower than the sender then the messages will build up, creating a large backlog which will appear as lag. Also, I'd suggest combining all of those messages into one, rather than wastefully sending a message per player. Right now you appear to be sending a large amount of messages per loop, whereas you're only reading a single message per loop. This would explain the huge lag you're experiencing.

Another thing you shouldn't do is check the result of net get error if an error hasn't occurred, as it won't mean anything.

Although you've got it to work for now, it'd be helpful to know where the error occurs. Just in net connect I assume?

Quote: "GREAT WORK"

Thanks.

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 29th Apr 2008 09:30
Quote: "Although you've got it to work for now, it'd be helpful to know where the error occurs. Just in net connect I assume?
"


No idea really, It just worked all of a sudden...

Quote: "Another thing you shouldn't do is check the result of net get error if an error hasn't occurred, as it won't mean anything."


Hmm... OK.

Quote: "A mistake you've made is that you're only checking for messages once a loop. If you're running slower than the sender then the messages will build up, creating a large backlog which will appear as lag. Also, I'd suggest combining all of those messages into one, rather than wastefully sending a message per player. Right now you appear to be sending a large amount of messages per loop, whereas you're only reading a single message per loop. This would explain the huge lag you're experiencing."


If I put up 32 players in one message, it will crash because the data is too large.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 29th Apr 2008 12:49
Quote: "If I put up 32 players in one message, it will crash because the data is too large."

In that case, set the buffer size (before hosting/joining) like this:



Although I'd make such data transfers as small as possible, so I'd only send data of whose players' state has changed, rather than sending the state of all 32 players every message. I'd also suggest you use a byte for the message ID.

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 30th Apr 2008 11:00
I fixed some things in it, and it works like a charm. Atleast, on a local network

But what is the default server port? Since Net Set Port does not appear to work over here.

Login to post a reply

Server time is: 2024-02-27 03:43:07
Your offset time is: 2024-02-27 03:43:07