Wild8 PRD
A multiplayer UNO-style card game, built on top of the Drop4 base.
Problem & Opportunity
UNO clones online tend to either require accounts and downloads, or bury the game under ads and forced queues. Drop4 already proved that a frictionless room-code experience works — we can extend the same base to a card game without rebuilding the platform.
Opportunity: reuse Drop4's rooms, realtime sync, timer, AI, and chat to ship a polished 2–4 player UNO-style game (Wild8) in a fraction of the time of a from-scratch build.
Core User Stories
Game Rules (Wild8)
Deck
- 108 cards across 4 colors: Red, Yellow, Green, Blue.
- Per color: one 0, two of each 1–9, two each of Skip / Reverse / Draw Two.
- 4 Wild and 4 Wild Draw Four cards.
Turn flow
- Each player starts with 7 cards.
- On your turn, play one card matching the top of the discard pile by color, number, or symbol.
- If you can't play, draw one. If playable, you may play it.
- Wilds let you choose the next color. Wild +4 also forces the next player to draw 4 and skip.
- Skip = next player loses turn. Reverse = direction flips. Draw Two = next player draws 2 and is skipped.
- At one card you must call UNO! within 5 seconds or risk a 2-card penalty.
Server is authoritative for the deck, hands, draw pile, and all play validation. Clients only see their own hand + opponents' hand counts.
AI Opponent
Lives in src/lib/uno-ai.ts and is invoked from the server function whenever it's a bot's turn — same pattern as Drop4's aiMoveResult.
Turn Timer & Penalties
- 30 seconds per turn, surfaced via the same TimerClock component used in Drop4.
- First timeout: server auto-draws one card for the offender and passes the turn. Counter increments.
- Second timeout: forfeit. In 2-player games this ends the match. In 3–4 player games the offender is folded and remaining players continue (their cards are removed from play).
- When a bot is the offender, the server resolves their move immediately — bots never "time out".
Chat & Reactions
- Global lobby chat — shared across all rooms, same as Drop4.
- Room reactions — quick emoji tray that floats across the table for everyone in the room.
- AI chat bot — replies in the lobby and inside vs-AI rooms. Strict family-friendly system prompt; never reveals hands or discusses card counts of other players.
- Spam guard — 500-char cap, rate limit per token, same RLS shape as Drop4's chat_messages table.
Technical Architecture
- React + TanStack Start (SSR)
- Tailwind v4 + same design tokens
- Reuse TimerClock, ChatPanel, floating reactions overlay, sound utils
- New routes: /wild8, /wild8/play/$code
- Lovable Cloud (Postgres + Realtime)
- New table uno_games: code, seats[], deck, discard, hands (jsonb), turn, direction, status, active_color, draw_stack, called_uno[], timeouts
- New server functions: createUnoGame, joinUnoGame, playCard, drawCard, callUno, enforceUnoTimeout
- Reuses existing AI Gateway integration for chat replies
Hands live in a single jsonb column keyed by player token. The client only ever fetches its own hand via a server function; realtime broadcasts publish only public state (top of discard, hand sizes, turn, direction, active color). Other players' hands are never sent to the wire.
Reuse Map (Drop4 → Wild8)
| Drop4 piece | Reused as-is | Notes |
|---|---|---|
| Player token (anonymous) | Yes | Same cookie/localStorage primitive |
| Room codes (4–12 alnum) | Yes | Same generator + RLS shape |
| Realtime via Supabase channels | Yes | New channel name uno-{code} |
| TimerClock component | Yes | Same 30s + danger + tick |
| Floating reaction overlay | Yes | Same emojis |
| ChatPanel + AI bot | Yes | New persona prompts ("Wild8 Bot") |
| Sound utils (drop, pop, win) | Partial | Add shuffle/draw/wild SFX |
| Server fn / RLS pattern | Yes | Mirror games.functions.ts file layout |
| Game rules + AI | No | New: uno-logic.ts, uno-ai.ts |
Milestones
- M1 · Foundation (week 1): uno_games table, deck + shuffle, create/join, render hand, play/draw with full server validation. 2-player only.
- M2 · Full ruleset (week 2): Skip, Reverse, +2, Wild, Wild +4 with color pick, UNO! call + penalty, win/draw.
- M3 · Polish (week 3): 3–4 player seats, AI difficulties, 30s timer, chat + reactions, AI bot persona, sounds & animations, rematch, leave room.
Success Metrics
- ≥ 70% of created rooms reach turn 5 (validates onboarding + stability).
- ≥ 40% of finished rooms request a rematch (validates fun).
- Median move latency < 250 ms end-to-end on a normal connection.
- Zero invalid moves accepted by the server (validated by automated tests over the rule engine).
Out of Scope (MVP)
- Tournaments, brackets, ranked ladders, ELO
- House rules toggles (stacking +2 / +4, jump-in, 7-0)
- Custom decks or skins
- Spectator mode and replays
- Native mobile apps and offline play