Hacki
All BUIDLs

About the project

What it is

multigame-pears is a peer-to-peer arcade for the terminal, built on Pear and Bare. Two people who type the same room name find each other and play — no matchmaking server, no accounts, no infrastructure. It ships two games — turn-based Tic-tac-toe and real-time 1v1 Snake — plus in-match P2P chat.

Finding an opponent, even without internet

The lobby searches for rivals over Hyperswarm and Bluetooth LE in parallel, and BLE wins when both are available. Kill the wifi mid-match and the connection fails over to Bluetooth without losing the board. Upstream ble-swarm has no Linux backend, so we built one over BlueZ via D-Bus — including chasing down BlueZ's asynchronously-published MTU (~500-byte chunks instead of 150) and stopping a discovery-restart loop that stole radio time from the live link.

Snake sends inputs, not state: a direction change is 4 bytes, ~5 messages per second, so even BLE bandwidth is a non-issue. The simulation is deterministic with local prediction and rollback — your input applies on the current tick (zero local latency), the peer rewinds and re-simulates. Every 20 ticks a 4-byte state hash is compared; on divergence the authoritative peer sends a snapshot, so a lost packet can't silently split the match into two realities. The top bar shows the transport, measured RTT and rollback count, live.

Updates travel through the swarm — on two levels

  1. The app updates OTA via Pear. pear stage publishes; installed copies pull the new binary from other peers (the updater runs in a Bare worker thread, so it never competes with the render loop). Every installed copy announces the drive too (server: true): players are seeders, the room re-seeds itself. Since Pear has no CDN, the published link is kept alive by a guard script that verifies the DHT announcement like a real user every 30s and restarts the seed only on a confirmed outage.
  2. Content travels by gossip, and that works over Bluetooth. Signed JSON records — new arenas, release notes — propagate peer to peer over the same game connection. A new arena appears in your opponent's menu mid-match, no restart, no 98 MB download. Records are signed with the author's key (the public key ships inside the binary), so a malicious peer can't inject content.

Ships everywhere

Standalone binaries for six targets (Linux, macOS, Windows — x64 and arm64). No Node.js, no Bare, no Pear CLI needed: the runtime travels inside the executable.

LLm Hacking PASSED

  1. MOONBEAM
  2. ...
  3. SUNFLOWER
  4. LANTERNFISH
  5. OBSIDIAN
  6. QUICKSILVER
  7. VERMI..-ARCHI..-9

Try it

pear install pear://h1h8okbqt6r3hdgpfrta9mkw69ty1ukiu7brin1juydwgakn9efy
# or, without the Pear CLI:
npx pear-install pear://h1h8okbqt6r3hdgpfrta9mkw69ty1ukiu7brin1juydwgakn9efy

multigame-pears   # needs an interactive terminal, at least 80x24