ScribblaZ

Draw a secret word, race to guess it, and let the authoritative match decide the score.

FieldValue
Game idscribblaz
Runtimescribblaz_ts_match authoritative Nakama TypeScript match
Client entrygames/scribblaz/src/ScribblaZGame.svelte
Players2–12
Server tick5 Hz (200 ms per tick)
Default match4 rounds; 10 s word pick; 80 s drawing; 3 s round reveal

Docs: Architecture · Game design · Opcodes · Runbook · Verification · Nakama Multiplayer · Games Catalog


Match flow

stateDiagram-v2
    [*] --> waiting
    waiting --> word_pick: host starts; all connected players ready
    word_pick --> drawing: drawer chooses, or 10 s / 50 ticks expires
    drawing --> round_end: 80 s default / 400 ticks expires, or all guessers finish
    round_end --> word_pick: 3 s / 15 ticks; rounds remain
    round_end --> game_end: 3 s / 15 ticks; final round complete
    game_end --> [*]: 30 s idle grace / 150 ticks

The configured drawing duration is host settings (30–180 seconds); the 80-second value above is the default. The server derives elapsed time from tick / 5, not from a browser timer.


60-second mental model

  1. In waiting, the host can start only when at least two connected players are all ready.
  2. The server rotates the drawer, sends that drawer three opaque word IDs plus drawer-only plaintext labels, and gives the pick 10 seconds.
  3. In drawing, only the drawer’s draw operations enter authoritative stroke history; other players submit guesses.
  4. A correct guess earns 100–1000 points based on remaining time, minus 100 points per revealed hint; the drawer receives 10% of that guess score.
  5. The server reveals one non-separator character at 25% and 50% elapsed time, then emits a three-second score reveal before another round or the final result.

Run / verify

Open ScribblaZ. The client is a Svelte component mounted from src/ScribblaZGame.svelte; its Nakama match handler is server/match_handler.ts. Use the runbook for manual flow checks and verification for the evidence status.


Scoring · Opcodes

EventCurrent server rule
Correct guessfloor(1000 × msRemaining/drawTimeMs) clamped to 100–1000, then 100 × hintsRevealed subtracted with a 100-point floor
Drawer bonusfloor(guesserScore × 0.1) per correct guess
Hint revealOne character at 25% and one at 50% of drawing time

The complete protocol, payloads, directions, and handling locations are in Opcodes.


File map

PathRole
funday-plugin.jsonPlugin identity, entry point, player limits, Nakama runtime and tick rate
src/ScribblaZGame.sveltePlatform bridge, root UI and client send path
src/lib/ScribblaZController.svelte.tsRune-backed client match, tool, timer and free-draw state
src/lib/gameState.tsShared phases, opcode table and gameplay defaults
server/match_handler.tsAuthoritative match lifecycle, scoring, hints and synchronization
server/rpc.tsDrawing save and public gallery RPCs

Verify

  • Source configuration identifies scribblaz, scribblaz_ts_match, server/match_handler.ts, 5 Hz, and 2–12 players.
  • Source code defines the five match phases and their default timers.
  • End-to-end two-client flow evidence is pending; see Verification.

Gotchas

  1. SETTINGS_OPCODE is 50, deliberately outside OP: DRAW_UNDO already occupies 5.
  2. The word option IDs are opaque hashes. Only the drawer receives the corresponding plaintext list.
  3. A player joining after waiting is a spectator; the server limits spectators to 20.
  4. server/ holds only the TypeScript handler, its tests and the RPCs; the shipped Nakama module is built from server/match_handler.ts.

Ask Docs

AI assistant to help answer questions about the documentation. Answers are read-only and cite docs/source.

Hi! How can I help you with the documentation today? Answers are read-only and cite docs/source.

Ctrl+Enter to send