Skip to content

What Tickflare is ​

Tickflare is a multiplayer game framework for Cloudflare Workers and Durable Objects.

A Durable Object is a single-threaded JavaScript object with its own storage. Cloudflare creates it on first use, near whoever asked for it, and routes every request for the same name to the same instance. That is exactly what an authoritative game server needs: one place that holds the truth about a match and that every player talks to.

Tickflare gives that object a game-shaped API. You write a Room class with the state and the rules. Tickflare handles the rest:

  • player WebSockets
  • seats and reconnects
  • saving every change before anyone hears about it
  • rolling back moves you refuse
  • timers that survive restarts
  • sending each player only what they are allowed to see
browser ── WebSocket ──▶ Worker (gateway) ──▶ Room (Durable Object, one per room id)
                         authenticates          runs your hooks, saves state,
                         and routes             sends each player their view

Which games it suits ​

Tickflare is aimed at games where an authoritative server and a few tens of milliseconds of latency are fine:

  • turn-based and asynchronous games: board games, card games, word games, anything played over days
  • co-op and party games
  • .io-style real-time games
  • strategy games, including real-time strategy with many units

Games that need UDP and rollback netcode are out of scope: shooters, fighting games and sim racing. Durable Objects speak TCP (WebSockets), and Tickflare doesn't try to hide that.

Three ways to keep players in sync ​

A room synchronises its players in one of three ways. All three share the same room kernel, so seats, timers, persistence and identity work the same way in each.

ModeThe room...Suits
Event modewakes when something happens, runs your hook and goes back to sleepturn-based, cards, async
State syncruns onTick at a fixed rate and sends each player what changed in their viewaction, co-op, .io
Locksteporders everyone's inputs into turns; clients run the simulationRTS, many units

Choosing a mode goes into the trade-offs.

What else is in the box ​

Around the room kernel there are the services a game usually needs, built on Cloudflare products:

Status ​

Tickflare is at version 0.1, its first public release, on npm as tickflare. Expect the API to change before 1.0: the changelog says how versions work until then, and lists every change with what to do about it.

Limits and known gaps lists what is not there yet.

MIT licence. Tickflare is an independent project and is not affiliated with Cloudflare.