Re:QuakeJS – A Quake Port to JavaScript with Emscripten
by lxtx on Monday April 06, 2020 @04:35PM
(#22797545)
Quake's source code is very hackable. I forked ioquake3 for a personal project and it was surprisingly easy to add WebRTC support to the C codebase, so you could play it in your browser over WebRTC :)
[ Parent
| on HN ]
Re:QuakeJS – A Quake Port to JavaScript with Emscripten
by Sean-Der on Monday April 06, 2020 @08:15PM
(#22799207)
That is really impressive! Are you still doing stuff with WebRTC? It is quite a niche area, but lets you do lots of interesting things.
If you are ever interested in getting back into the space you should come join us working on Pion (A Pure Go implementation of WebRTC). I would love to hear about what else you did! [0] I am just really trying to build a intellectually curious/supportive community of RTC. Right now everything is so anemic community wise.
Re:QuakeJS – A Quake Port to JavaScript with Emscripten
by k__ on Monday April 06, 2020 @04:50PM
(#22797720)
What was your experience with WebRTC?
I read some people tried to use it for multiplayer, but the performance suffered with more than 10 players.
Re:QuakeJS – A Quake Port to JavaScript with Emscripten
by lxtx on Monday April 06, 2020 @04:53PM
(#22797747)
Only played it with my friends, don't think a map ever exceeded 10 players. So I can't say much about scaling - although it was a client-server model over UDP and not peer to peer networking.
Re:QuakeJS – A Quake Port to JavaScript with Emscripten
by k__ on Monday April 06, 2020 @04:58PM
(#22797798)
Ah, so you had a WebRTC datachannel between the clients and the server?
Re:QuakeJS – A Quake Port to JavaScript with Emscripten
by lxtx on Monday April 06, 2020 @05:04PM
(#22797853)
Basically yes, a custom datachannel implementation. Haven't updated it lately, but it's up at https://github.com/seemk/WebUDP
Re:QuakeJS – A Quake Port to JavaScript with Emscripten
by k__ on Monday April 06, 2020 @05:29PM
(#22798079)
Pretty cool.
You don't happen to have some ping comparisons betwen WebRTC and WebSockets?
Re:QuakeJS – A Quake Port to JavaScript with Emscripten
by lxtx on Monday April 06, 2020 @11:59PM
(#22800240)
Sadly no, but I don't think there's much of a ping difference on a good network. With WebRTC (datachannels in UDP mode) you just get the benefits of UDP (or lack thereof :)).
Re:QuakeJS – A Quake Port to JavaScript with Emscripten
by k__ on Tuesday April 07, 2020 @08:21AM
(#22802504)
I see.
I had the impression UDP would lower the average ping, because you wouldn't have to wait on lost packages like with TCP.