finds.dev← search

// the find

rameshvarun/netplayjs

★ 567 · TypeScript · ISC · updated Oct 2024

Make P2P multiplayer browser games, no server hosting or synchronization code required. Powered by rollback netcode + WebRTC.

NetplayJS is a TypeScript framework for building P2P browser games using WebRTC and rollback or lockstep netcode. You structure your game as a class with tick/draw/serialize methods, and the framework handles matchmaking, connection establishment, and state synchronization. Aimed at indie game developers who want networked multiplayer without spinning up dedicated game servers.

The rollback netcode implementation is the real draw — it's the same technique used in fighting games like Street Fighter, and having it as a drop-in wrapper for browser games is genuinely rare. The LocalWrapper for testing both players in one browser tab is a smart DX decision that makes iteration fast. Not requiring determinism (the host broadcasts authoritative state) is pragmatic for JavaScript where float determinism is a mess. The autoserializer handles simple game states without any boilerplate, which lowers the barrier to trying it.

Last commit was October 2024 and several core modules are still marked WIP — netplayjs-netcode and netplayjs-connection aren't finished, meaning you're depending on code the author hasn't committed to stabilizing. The public matchmaking server is a single point of failure you don't control; if it goes down, your game's matchmaking breaks entirely, and the docs don't explain how to run your own with any detail. Serialization is JSON-based, which means deeply nested or typed state (class instances, Sets, Maps) won't round-trip correctly through the autoserializer — you'll discover this the hard way mid-project. The framework constrains you to a fixed canvas and timestep model, which makes integrating with engines like Phaser or Pixi non-trivial.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →