Docs / Erlang / API

Erlang API reference

These docs are Lua-first, because that is how most games are built on Asobi. But Asobi is a plain Erlang/OTP library underneath, and you can use it directly from Erlang (or any BEAM language) without touching Lua.

When to use Erlang over Lua: you want behaviour-level control (supervision trees, custom match state machines, direct gen_statem handling), or you are embedding Asobi in an existing Erlang application. Writing a game? Stay on the Lua API.

The full Erlang API reference is published on HexDocs: every public module carries -moduledoc/-doc attributes, rendered at hexdocs.pm/asobi. The source lives on the asobi repository.

The modules you will use

  • asobi_match - the game behaviour every mode implements (init/join/leave/handle_input/tick/get_state) - the Lua adapter implements it on your behalf
  • asobi_match_server - the gen_statem that drives a match's lifecycle and broadcasts state
  • asobi_matchmaker - queues and pairing strategies
  • asobi_world_server - persistent, zoned worlds
  • asobi_zone - spatial partitions within a world
  • asobi_spatial - in-memory spatial queries

Where next?