ScribblaZ
Draw a secret word, race to guess it, and let the authoritative match decide the score.
| Field | Value |
|---|---|
| Game id | scribblaz |
| Runtime | scribblaz_ts_match authoritative Nakama TypeScript match |
| Client entry | games/scribblaz/src/ScribblaZGame.svelte |
| Players | 2–12 |
| Server tick | 5 Hz (200 ms per tick) |
| Default match | 4 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
- In
waiting, the host can start only when at least two connected players are all ready. - The server rotates the drawer, sends that drawer three opaque word IDs plus drawer-only plaintext labels, and gives the pick 10 seconds.
- In
drawing, only the drawer’s draw operations enter authoritative stroke history; other players submit guesses. - 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.
- 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
| Event | Current server rule |
|---|---|
| Correct guess | floor(1000 × msRemaining/drawTimeMs) clamped to 100–1000, then 100 × hintsRevealed subtracted with a 100-point floor |
| Drawer bonus | floor(guesserScore × 0.1) per correct guess |
| Hint reveal | One character at 25% and one at 50% of drawing time |
The complete protocol, payloads, directions, and handling locations are in Opcodes.
File map
| Path | Role |
|---|---|
funday-plugin.json | Plugin identity, entry point, player limits, Nakama runtime and tick rate |
src/ScribblaZGame.svelte | Platform bridge, root UI and client send path |
src/lib/ScribblaZController.svelte.ts | Rune-backed client match, tool, timer and free-draw state |
src/lib/gameState.ts | Shared phases, opcode table and gameplay defaults |
server/match_handler.ts | Authoritative match lifecycle, scoring, hints and synchronization |
server/rpc.ts | Drawing 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
SETTINGS_OPCODEis50, deliberately outsideOP:DRAW_UNDOalready occupies5.- The word option IDs are opaque hashes. Only the drawer receives the corresponding plaintext list.
- A player joining after
waitingis a spectator; the server limits spectators to 20. server/holds only the TypeScript handler, its tests and the RPCs; the shipped Nakama module is built fromserver/match_handler.ts.