Engine V0 — built for Robinhood Chain

The game engine where every match settles on-chain

Write one deterministic TypeScript module. FORGE runs it authoritatively, matches wallets against it, escrows the stakes on Robinhood Chain and pays the pot to whatever your rules decide. Rendering is yours — fairness, netcode and money are the engine's.

relay@rh-chain — live
Deterministic simulation
30 Hz
Wallets per match
2–8
Escrow checks green
32/32
Hard cap on rake
≤10%
$npm i forgeQuickstart

01 — The contract

One module. Everything else is engine.

A game is a pure object: rules in, winner table out. No sockets, no wallets, no rendering assumptions. The engine supplies matchmaking, invite lobbies, scripted opponents, per-player state redaction and the entire money layer.

Fixed steps, seeded randomness and ordered inputs make rooms deterministic — so the identical module runs on the hosted relay and in a browser tab. The playground on this site is that exact property, live.

SAME SEED + SAME INPUTS = SAME RESULT, EVERYWHERE

src/templates/my-game.tsTS · MODULE
1export const myGame: GameModule<State, Input> = {
2 id: "my-game", minPlayers: 2, maxPlayers: 4,
3 tickRate: 20, // fixed sim steps — determinism
4 setup(ctx) { /* seeded ctx.random */ },
5 onInput(s, player, input, ctx) {
6 // validate + apply — cheating is impossible here
7 },
8 tick(s, ctx) { /* advance ctx.dt */ },
9 result(s) { /* winners + splitBps → paid on-chain */ },
10};

02 — Shipped modules

Three genres. One API.

Browse the gallery
30 HZ
Real-time reaction

src/templates/tap-duel.ts

Tap Duel

The arena flashes after a hidden seeded delay — first tap takes the round, early taps hand it away. The hello-world of FORGE, and the module the playground runs in your browser.

2 playersFirst to 5

Play it now
10 HZ
Turn-based tactics

src/templates/grid-battle.ts

Grid Battle

7×7 board, point-symmetric procedural cover, 3 HP. Step to an adjacent cell or fire along a clear lane; slow players auto-pass the turn. Chess-clock pressure without a chess engine.

2 players3 HP each

on the relay
20 HZ
N-player scramble

src/templates/score-rush.ts

Score Rush

45 seconds, one shared board of weighted cells, up to four wallets. First claim scores it; stale cells decay and respawn. Ties split the pot by the on-chain split table.

2–4 players45 seconds

on the relay

03 — Money protocol

Stakes in, proof out.

  1. 01

    Match opens

    The relay referee binds 2–8 wallets and one stake to a bytes32 id on ForgeEscrow.

  2. 02

    Stakes lock

    Each player sends exactly one deposit() transaction. All in → Funded → the room goes live.

  3. 03

    Module decides

    Your result() returns a winner table — splits summing 10,000 bps. The engine never invents outcomes.

  4. 04

    Pot settles

    settle() pays pot − rake by the table, dust-exact. Draws refund. Dead relay? Players reclaim() trustlessly.

Ready when you are

Ship your first module today.

Copy the closest template, keep your renderer, and let the engine handle the room, the lobby and the money.