asobi Multiplayer game backend on Erlang/OTP. Hot-reloadable, Apache-2. Docs • Live demo • Discord • Issues Edit a Lua file. Save. Live match updates. No restart. Try it. Who it's for Solo devs and small teams building indie 2D multiplayer. If you're on Godot, Defold, LÖVE, Phaser, or Flame+Flutter, asobi ships the backend pieces you'd otherwise rebuild from scratch: matches, matchmaker, chat, leaderboards, economy,…
Edit a Lua file. Save. Live match updates. No restart. Try it.
Who it’s for
Solo devs and small teams building indie 2D multiplayer. If you’re on
Godot, Defold, LÖVE, Phaser, or Flame+Flutter, asobi ships the backend
pieces you’d otherwise rebuild from scratch: matches, matchmaker, chat,
leaderboards, economy, voting, phases, worlds, presence, inventory.
Not the right fit for twitch-latency AAA shooters - WebSocket/TCP has a
floor around 4ms. Great for turn-based, casual, MMO zone, roguelike,
co-op, party, and social games.
Try it in 60 seconds
git clone https://github.com/widgrensit/asobi
cd asobi/examples/hotreload-demo && docker compose up
Open http://localhost:3000, then edit lua/match.lua and save. The
running match picks the new code up on its next tick. No restart, no
reconnect, no kicked players.
One product, two front doors
asobi is a single Erlang/OTP node holding the game backend, the Lua
runtime, and the operator console. Pick the surface you want to write
against; it is the same node either way.
Write your game in Lua. Run ghcr.io/widgrensit/asobi and mount a
directory of Lua scripts over /app/game. This is the default path and
what most people want.
Write your game in Erlang. Depend on the Hex package and implement
the asobi_match behaviour. Same match supervisor, matchmaker,
leaderboards, economy, world server, and voting primitives, composed into
your own release.
asobi_phase, asobi_timer - phase engine, plus countdown / conditional / cycle / scheduled timer primitives. Seasons moved out to asobi_seasons, an extension.
Auth - email/password, Google / Apple / Steam sign-in, and guest (anonymous) play with device-based create-or-resume and upgrade-to-account (game-declared, operator-peppered).
Rate limiting via seki (sliding window, per route group), sessions cached in ETS, presence via pg, chat / social / economy / inventory / storage / tournaments / notifications as Nova controllers.
Extensions - game-specific methods, callable as an rpc.call WebSocket frame and over /api/v1/ops/ext/:extension/:action. See Extensions.
Client SDKs for Godot, Defold, Unity, Unreal, JS/TS, Dart, Flame - see below.
Operator console - a browser UI over the ops plane: players, matches, matchmaker queue, leaderboards, economy, chat, tournaments, notifications. Reads, plus erasing and exporting one player. Served by the node itself at /console, off until you turn it on.
Benchmarks
Single node, 8 cores, same-machine client. See guides/benchmarks.md for full numbers.
Peak
WebSocket throughput
83,000 msg/sec @ 3,500 concurrent connections
RTT p50 / p99
4.4 ms / 6.5 ms
REST reads (matches / friends / wallets)
7-14 ms p50
Memory per connection
~15 KB
Not a twitch-FPS backend. WebSocket over TCP has a latency floor, and under
packet loss retransmission adds a tail that no tuning removes. Excellent for
turn-based, casual, MMO zone, roguelike, co-op, and party games. For hitscan
shooters and fighting games, run the simulation yourself and use asobi for
everything around it.
asobi is pre-1.0. The API is stabilising; expect minor breaking changes
until 1.0. We will never relicense - see guides/exit.md
for the “if asobi disappears tomorrow” runbook.
Run it yourself, or use the cloud
asobi is Apache-2 and self-hostable. One Docker container runs the full
stack; see docker-compose.example.yml for
a production-shaped setup with Postgres.
Don’t want to operate it? asobi.dev/cloud
is the managed version, EU-sovereign, same open-source core. If we ever
pivot, you still have the code - see guides/exit.md.
FAQ
Does asobi replace Nakama / Colyseus / PlayFab?
For the indie-2D multiplayer slot, yes. For AAA shooters needing per-match
dedicated servers with their own UDP netcode, no. Worth knowing that Nakama and
Colyseus are WebSocket-over-TCP too, so that is a property of this category
rather than a gap unique to asobi; PlayFab is the one with Azure dedicated
servers behind it.
Can I write my game logic in something other than Lua?
Yes. Depend on asobi as an Erlang library and write match code in Erlang,
or call the REST/WebSocket API from any language. Lua is the easy mode.
Does it scale across machines?
asobi is single-node by design, and several subsystems are node-local:
the matchmaker queue and its tickets, rate-limit buckets, and console
sessions all live in the node that served the request, so players queuing
against different nodes never match each other. Matches and worlds do not
migrate. Shard at the app level (game-per-node, region-per-node) rather
than clustering a single match across hosts. The full list of what is
per-node is in Clustering.
What happens if asobi disappears?
Apache-2, single-binary deploy, Postgres backing store. Nothing in your
stack is load-bearing on us. See guides/exit.md.
Contributing
See CONTRIBUTING.md for the build setup, pre-push
checklist, and test matrix. Security issues: see SECURITY.md.
评论