WebRTC suitable for browser MMO?

228 views
Skip to first unread message

Patrick Klaffenböck

unread,
Oct 13, 2023, 9:07:37 AM10/13/23
to discuss-webrtc
Hello everyone!

I am currently checking options for network transports for a browser based MMO and an searching for information whether WebRTC is a fitting choice here.

The game will be 2D with characters movement being controlloed via mouse click. The communication of all players has to go over the server, so that it can verify the inputs, and of course the server should be able to handle as many concurrent connections as possible. There will be no peer-to-peer connections for game play data.

I found conflicting info on whether the possibility of an unreliable channel is actually needed (UDB vs TCP) and was hoping to gain some more insight here.

Are WebRTC datachannels a good idea for this setup? I am very interessted in your opinions and the reasoning behind them.

I am also interessted in performance comparisons between WebRTC and WebSocket, both speed and needed data volume. If anyone could point out any recent benchmarks regarding this topic it would be greatly appreciated.

Thanks in advance for any input!

Best regards,
Patrick

Philipp Hancke

unread,
Oct 14, 2023, 2:20:25 PM10/14/23
to discuss...@googlegroups.com

Performance isn't the criterion you want to look at. There are three considerations:
- does your use-case/protocol leverage the unreliable-ness of datachannel which WebSocket can not
- implementing datachannels on a server is hard (due to the complexity of the underlying protocol), WebSocket is easier to implement there
- deployment wise, WebRTC prefers UDP by default, you will need TURN/TCP and TURN/TLS to ensure the best connectivity. WebSockets is easier there.

You might also want to look at WebTransport but Safari is not onboard with this yet (https://caniuse.com/webtransport).
It looks like socket.io recently added WebTransport support even.

--
This list falls under the WebRTC Code of Conduct - https://webrtc.org/support/code-of-conduct.
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/4569f790-823d-4820-ab1b-ae0353892fe7n%40googlegroups.com.

Patrick Klaffenböck

unread,
Oct 16, 2023, 3:06:08 AM10/16/23
to discuss-webrtc
Hello Philipp!

Thank you for your answer, I will take that into consideration. Also thanks for the links and the hint about WebTransport, that sound very interessting!

Best regards,
Patrick

Reply all
Reply to author
Forward
0 new messages