[WIP] UDP plugin for C2

Show us your completed creations made in Construct 2

Post » Tue Mar 26, 2013 11:34 pm

UDP is a connectionless protocol for datagram-oriented applications. Plugin works only with node-webkit export.

I spent some free time working on this plugin and finally got some decent results. Here are some screenshots of the UDP plugin in action.




::Current functionality::

Conditions:

"On listening","Emitted when a socket starts listening for datagrams.
"On Message","Emitted when a new datagram is available on a
"On Close","Emitted when a socket is closed with close().","OnClose");
"On Error","Emitted when an error occurs.","OnError");

Actions:

"Bind","For UDP sockets, listen for datagrams on a named port and optional address. If address is not specified, the OS will try to listen on all addresses."
"Send", "Send UDP packet"
"Close", "Close the underlying socket and stop listening for data on it."

Exppressions:

"Address", "Returns socket address"
"Port", "Returns socket port"
"Family", "Returns socket family"
"Message", "Returns recieved message"
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Wed Mar 27, 2013 10:42 am

Interesing! i heard UDP is designed for real-time multiplayer, isn't it??
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

Post » Wed Mar 27, 2013 11:20 am

Bunch of internet applications use UDP; DNS, real-time video and audio streaming protocols, accounting, database systems, etc.

It's used for multiplayer also, but because of it's possible data loss, sometimes UDP is not suitable for all multiplayer cases.
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Wed Mar 27, 2013 1:39 pm

This looks cool, but unfortunately the main problem with UDP is a lot of home and business router setups, or crappy middleware at ISPs, simply drop UDP packets, and sometimes only one way. This can make it pretty tough to get full duplex between any two systems on the internet. NAT punch-through is pretty much an essential feature for this type of thing, and can require middle-man servers.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Mar 27, 2013 2:02 pm

Great info, @Ashley, i'll look into NAT punch-through.

This is just an experiment, and a fun way for me to play with Node API and C2 SDK.

Nevertheless, it's a fun playing with C2 and UDP, and I think it's great that C2 is such a well written piece of software that allows experiments like this.

Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Wed Mar 27, 2013 10:05 pm

This is great. I've just read a bunch of articles on UDP, NAP punch-through, etc... Never had a single problem with UDP in multiplayer games.

And then this:



:D

Great!

On the side note; has anybody had experience with this library:

github.com/pereckerdal/eminet
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652


Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 4 guests