Show HN: Making a cross-platform game in Go using WebRTC Datachannels

https://news.ycombinator.com/rss Hits: 3
Summary

(The following was adapted from a talk I gave at DWeb Weekend 2025 at the Internet Archive in San Francisco on August 17, 2025)Simplifying WebRTC Datachannels for GamesFirst of all, to get some stuff out of the way, instead of using the “super complicated” WebRTC datachannels, why don’t we use something simpler?Why Not Use Websockets?Too slow: Most games use UDP with a reliability layer on top.Suitable for turn-based games: Fine for games that are turn-based/slow-paced, like Runescape.For more details, see:The Case for Web TransportReplacement for Websockets, uses QUIC instead of TCP.However, it has been in development for a long time, and I want to get started on making games now.Current issues:Potential: Will probably solve most problems once finished and would be the best choice for making a multiplayer game on the web.Datachannels: A Hidden Gem of WebRTCFeature: Lets us send unreliable packets over the web using SCTP.Advantage: We don’t need WebTransport; we can use this today.They were created in part for exactly this use caseBenefits and Drawbacks of WebRTCBenefitsHost flexibility: Do not need to host servers - players can make their own.No more need for port forwarding or Hamachi!Minimal server requirements: Only need one server for signaling.Community-supported specification: There are many options for making your own WebRTC-based app.DrawbacksComplex setup: Setting up WebRTC is challenging.Server dependence: You need to host or use two different servers (Signaling + STUN/TURN).Can use Google’s STUN, but combining signaling and STUN into one server would be nice.WebRTC ImplementationsExisting Game Networking Libraries Using WebRTCGeckos.ioA client-server abstraction for WebRTC Datachannels written in Node.js.Past experience: Really nice but a bit inefficient. See GitHub Issue.Netlib - Peer-to-peer WebRTC datachannel library for TypeScript.Matchbox - WebRTC datachannel library for Rust, compiles to both native and WASM.PeerJS - Great for browser-only apps/gam...

First seen: 2025-09-11 19:17

Last seen: 2025-09-11 21:18