Hi everyone!
I’m excited to share Birdtown, an online multiplayer game I built using Babylon.js. It’s a physics-based, platform shooter with procedurally generated levels and a decent amount of customization (6 game modes, 15 weapon loadouts, 5 playable birds). Since it’s built to run in a web browser, starting a game takes seconds and you can have your friends join just by sending them a link.
Play now at either link:
Note: you can play the game solo, but you’ll need at least 2 players to experience most of the content.
Screenshots
Tech Details
I initially intended this to be a much smaller project, but I ended up really enjoying working with Babylon.js .
Most of the code is written in Typescript, and the core libraries include Babylon.js, Peer.js (for establishing P2P connections), Matter.js (for lightweight 2D physics), MessagePack (for compressing data over the network), and Webpack (for compiling code). I wrote a lot of custom code for the networking, which at a high level uses a client-server architecture where one player doubles as the authoritative host. Each client establishes two WebRTC data connections to the host, which essentially act as a “TCP” and “UDP” channel. Game state diffs are broadcasted over “UDP” at ~60Hz with the “TCP” channel being reserved for less frequent, but critical updates. Clients are responsible for sending their inputs to the host and performing client-side prediction & reconciliation.
Anyway, thanks for reading & hope you enjoy!