5 ms·
I'm half-way porting another turn of the century game engine to emscripten but I'm a little stuck on the networking so it's pretty cool being able to have pract
by jamesu 2y ago
I'm half-way porting another turn of the century game engine to emscripten but I'm a little stuck on the networking so it's pretty cool being able to have practical examples to reference.
- modeless 2y agoCool, which one? I've also done Cave Story https://thelongestyard.link/cave-story/ https://thelongestyard.link/cave-story/ and I'd like to do a bunch of the old shareware classics as well. Multiplayer on the web is tricky. For non-action games you can get away with WebSockets but for arena shooters or other action games I think UDP is important, and you can only get that with WebRTC and all the baggage that comes with it. I'm using a library called HumbleNet to handle WebRTC, but I had to make a lot of changes for it to be usable. https://github.com/jdarpinian/HumbleNet https://github.com/jdarpinian/HumbleNet
- lytedev 2y agoHas there been any progress with using browsers' support for QUIC for latency-sensitive game networking?
- modeless 2y agoThere is WebTransport which is based on HTTP/3 (formerly QUIC), however it is not available in Safari (no surprise there) and also it does not support peer-to-peer connections. WebRTC is available today in all browsers and supports peer-to-peer unreliable UDP.
- thot_experiment 2y agoIs there a reasonable networking library for just throwing data packets somewhere using WebRTC in browser, specifically with a client-server rather than P2P? I've probably started work on such a thing like 4 times now but I've never gotten very far because I always found that whole stack incredibly convoluted and onerous to work with if you're not using it for it's intended usecase, but I really would like to have a go-to library to make little multiplayer webgames that use UDP under the hood.
- modeless 2y agoYeah WebRTC is not a well-factored API. It's basically almost an entire end-to-end implementation of a video calling app Google acquired and bolted on the side of Chrome. If what you're making is not a straight video calling app then it's a very strange API to use. But it does work! The problem with WebRTC for this kind of application is the need for a whole separate "signaling server" just for connection establishment, plus STUN/TURN, plus your actual application server makes three required servers. It puts a really high minimum on the complexity of any WebRTC app. For a client-server only application you might be able to combine all three servers into the same binary. I haven't seen a library that does that, but maybe it exists, I haven't looked extensively. The HumbleNet library that I use provides an implementation of the signaling server for connection establishment, and for the client app it hides all the WebRTC complexity behind the BSD sockets API. So all you need to do is host the server.
- jamesu 2y agoIn my case I'm porting an earlier variant of the Torque Game Engine, so making it work with WebRTC would really come in handy!
- modeless 2y agoNice! I thought about trying to port Tribes 2 but I never played it myself so it wasn't high on my list. My HumbleNet repo would be a good starting point but some changes may be required for it to work. It's not at the point where it can drop in and work on any game, although I think it would be possible to get there.
- klaussilveira 2y agoOh, that is nice! Been a while since I saw anyone working with TGE. I miss the GG forums and the community around it.
- sho_hn 2y agoI did Tomb Raider a while back: https://eikehein.com/stuff/sabatu/ https://eikehein.com/stuff/sabatu/ I'll upstream the work to tr1x (which I contribute to) at some point.
- modeless 2y agoWow, this is awesome! Is your fork public? I'd love to try adding some stuff like touch controls and save file syncing like I've done for Cave Story https://thelongestyard.link/cave-story/ https://thelongestyard.link/cave-story/