Viability of Real-Time Multiplayer in HTML5

Discussion and feedback on Construct 2

Post » Tue Feb 05, 2013 6:57 am

@Joannesalfa

Smartfox support with HTML5 (okay it's with websockets too)

I know the difference with java/javacript...
Cubeia's client is javascript, so even if the server is java, at least the client part should work with C2 right?lemo2013-02-05 07:00:46
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Tue Feb 05, 2013 7:42 am

@lemo oh my bad, about Smartfox, i doubt it comes UDP for HTML5; i don't think everyone uses server as Java.


B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Tue Feb 05, 2013 1:24 pm

My two cents:

If TCP is good enough for World of Warcraft, should be good enough for HTML5 games.


Socket.io is a good solution, but it has its own limitations. Current socket.io plugin for Construct isn't greatest but if you tweak it for your own needs, and respect the limitations of socket.io, it'll be good enough for most projects.

If you really want UDP, currently your only hope is Node-webkit export and UDP / Datagram Sockets module from Node.js. But that's .exe, not HTML5.

Without central server for game logic, there is no talk about some serious multiplayer game. I don't think we'll see some good solution for C2 multiplayer games with the "No programming required" premise any time soon.


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

Post » Tue Feb 05, 2013 1:45 pm

Funny this thread resurfaced today.
Funny because there's been some news about webRTC : FF and Chrome are calling each others, interoperability is on the way.
It's still experimental but progress are made.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Tue Feb 05, 2013 2:28 pm

I'd love to see multi-player (online) play a part in HTML5 gaming - it's also intriguing to me and very interesting indeed for how it will work around its current nature of flow in its problems, we can only wait now to see.
B
17
S
4
G
5
Posts: 226
Reputation: 4,042

Post » Thu Feb 07, 2013 12:35 pm

Guys, be aware I'm talking about REAL TIME multiplayer.
It's perfectly possible to make multiplayer games right now, as long as they aren't REAL TIME (as in, dependent on fast reaction times or twitch skills). MMOs are also perfectly doable.

Adding multiplayer to the ghost shooter demo, as an example, is not viable. It gets very laggy very fast.

Let me give you an example (which is not scientific at all): a sustained 2% packet loss over a 50ms connection gigabit ethernet (latency and packetloss simulated) desyncs the game by more than 1 second per 5 minutes.

In the same conditions, under UDP, there is no loss or desync, the game runs perfectly.

Game was tested using raw tcp/udp and multimedia fusion 2. Server powered by node.js in both modes as well. I would imagine construct would fare even worse, due to websocket's overhead.Fimbul2013-02-07 12:37:03
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Wed Feb 13, 2013 8:09 pm

Just ran across this thread via a Google search and hoped this could be useful.

I'm currently developing an Arduino based robotics platform that needed to be controlled via Web Browser/USB Joysticks. I too found websockets unsatisfactory for any sort of real time control mechanism. Even socket.io provided poor performance, as it is all based upon the TCP protocol which is inherently "reliable". Usually it would function decently, but every second or two a few packets went missing and the entire link slowed to a crawl (similar to the 500ms delay as you mentioned).

In my case I only needed to make this work in Chrome, so I was able to get away with using the chrome.socket API:

http://developer.chrome.com/apps/app_network.html

Although you'd have to develop your game as a Chrome app, it would allow the creation of a game in the browser that uses UDP to communicate. I can confirm this works excellently for controlling remote control robots, so it should definitely work for gaming. Also for anyone else interested, the HTML5 Gamepad API is quite excellent as well:

http://www.html5rocks.com/en/tutorials/doodles/gamepad/

The best part is that both the Gamepad API and UDP sockets are now supported out of the box for Chrome stable!

Hope this helps!
B
2
Posts: 1
Reputation: 252

Post » Thu Feb 14, 2013 1:32 am

@ericbarch

Good stuff, thanks for the contribution!
B
28
S
6
G
5
Posts: 248
Reputation: 5,463

Post » Thu Feb 14, 2013 10:52 am

I have seen a few good real-time multiplayer HTML5 games so far. Not shooters, of course, but still quite fast-paced. They performed well.
B
32
S
6
G
3
Posts: 121
Reputation: 6,066

Post » Thu Feb 14, 2013 2:24 pm

The problem with UDP is much of the crappy routers and middleware across the internet end up blocking it, or just not routing it because they're broken or badly designed. You need hacks like NAT Punchthrough just before any packets start arriving, and that requires intermediate servers. WebRTC has NAT punchthrough built in though, so is definitely a better candidate for that.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: 99Instances2Go, BackendFreak, newt, TGeorgeMihai, TheRealDannyyy and 7 guests