🕹️ Agent Arcade — Mini-Games & Leaderboards Guide
V2 is a complete rebuild around a single promise: agents have downtime, they want to play a quick game, they want to see their name on the board. We stripped out V1's polls / rewards / redemptions / tournaments — none of it had data flowing through it — and replaced it with five real browser-canvas games and clean leaderboards.
Overview
Agent Arcade is a between-call entertainment module. Each game is a self-contained HTML file that runs in a sandboxed iframe inside the CRM. Sessions are 30-90 seconds. Scores post to the leaderboard automatically on session end. Personal stats track total points, daily streak, today rank, and per-game personal bests.
Three sub-tabs: Arcade (game grid), Leaderboards (per-game + combined ranking with day/week/month/all-time toggles), and My Stats (personal totals + per-game best score history). Hero region surfaces the week's top combined player.
What's new in V2
Five fully-built games
Reflex Pop, Tile Stack, Word Rush, Color Sort, and Rapid Trivia — playable from day one. An idempotent seeder populates the catalog per tenant in one click. No external dependencies; every game runs in the browser canvas.
Iframe sandbox per game
Each game is a standalone HTML file. The CRM module embeds it in an iframe with a postMessage SDK bridge. Clean isolation: no CSS bleed, no JS conflicts, easy to test standalone (open the game URL directly to play with a mock SDK), easy to add a sixth game.
Combined cross-game leaderboard
Per-game leaderboards are obvious. The combined leaderboard normalizes each player's best in each game to a percentile-of-best (100 = top, 0 = bottom), then averages across games played. Generalists rise; one-game specialists capped at one-game percentile. Algorithm rewards breadth.
Daily streak tracking
Play any game on consecutive days, your streak ticks. Miss a day, it resets. No reward attached — pure flavor. Surfaces in My Stats next to total points and high score.
Lean, focused API
7 actions: list_games, start_session, end_session, leaderboard, combined_leaderboard, weekly_highlight, personal_stats. The full surface for tracking game sessions and showing leaderboards — nothing more, nothing to maintain that nobody uses.
Backward-compat schema
The 12 V1 arcade tables stay. V2 only writes to 3 (arcade_games, arcade_game_sessions, arcade_player_stats). Polls / challenges / rewards / tournaments tables sit dormant with whatever V1 wrote — no destructive migration, no data loss for tenants who used those features.
The five games
🎯 Reflex Pop
Tap targets before they vanish. Each round speeds up — targets get smaller and life-shorter. Golden targets worth 3× points. Combo system: every 5 in a row earns +5 bonus. Three lives — miss a target and you lose one.
🧩 Tile Stack
Classic 2048-style merge. Slide tiles on a 4×4 grid; matching tiles combine and double in value. Push for the highest stack. Arrow keys, WASD, HJKL, and touch swipe all work. localStorage tracks your best.
🔤 Word Rush
Twelve-letter pool with 1-2 red bonus tiles (2× score). Type letters, Enter submits, Backspace removes. Score = length² × 5 × bonus multiplier. Time extends on each word found (capped at +30s). 5,000-word dictionary, all work-safe.
🧪 Color Sort
Sort balls into matching tubes. Difficulty curves: 3 colors at level 1 climbing to 12 by level 50, with fewer spare tubes. Tap-to-pick, tap-to-pour. Undo button costs 5 points. Time bonus + level bonus on completion.
❓ Rapid Trivia
Fast-fire pop trivia across 5 categories: general knowledge, geography, movies, science, history. Single best answer per question. 100 base points + speed bonus (up to +50 for fast answers) + streak bonus (+25 every 3 in a row). Wrong answer scores 0 and breaks the streak, but doesn't end the round — keep going. 200-question pool (40 per category) keeps it fresh.
Leaderboards
Two leaderboard types, four time windows.
Per-game leaderboards
For each game, every player's best score in the period is the entry. Each player appears once per leaderboard. Top 10 by default (engine supports up to 50). Ties break by earliest-first-play in the period.
Combined cross-game leaderboard
For each game, your best score is normalized to a percentile of the top score in that game (100 = you're the top scorer, 50 = you're at half the top score, 0 = no plays). Your combined score is the average percentile across games you've played in the period.
Why percentile-of-best instead of raw score? Different games have wildly different score scales — Tile Stack hits 4-digit cumulative scores, Reflex Pop tops out around 1000. A raw-score combined would be dominated by whichever game scores highest. Percentile-of-best normalizes the playing field.
Why average instead of sum? Sum penalizes new players who haven't played all five games. Average means "of the games you played, how good are you compared to the field?" New players still see themselves on the board after their first game.
Time windows
- Today — sessions where DATE(start_time) = CURDATE()
- This Week — YEARWEEK(start_time, 1) = YEARWEEK(CURDATE(), 1) (ISO week, Monday start)
- This Month — DATE_FORMAT(start_time, '%Y-%m') = CURDATE() month
- All Time — every completed session, no date filter
Personal stats
The My Stats tab shows everything tracked on arcade_player_stats for the current user, plus computed fields:
- Total points — cumulative score across every completed session, all-time
- Games played — total completed sessions, all-time
- High score — best single-session score across any game
- Daily streak — consecutive days with at least one play
- Today rank — your position on the combined leaderboard for today
- This week rank — your position on the combined leaderboard for this week
- Per-game best — your top score for each of the five games (all-time)
What's not included (by design)
Arcade stays focused. Here's what's deliberately out of scope, and why each call keeps the module simple to run:
No XP from work events
Score comes from one place: how well you played the game. No call-count or sentiment hooks — gameplay rank stays clean of work-side incentives, and there's nothing to game for off-task points.
No rewards / redemption store
No prize pool to fund or manage. Rank itself is the reward — see your name climb the leaderboard, beat your own personal best, win the weekly cross-game highlight.
No tournaments / brackets
Day, week, month, and all-time leaderboards are the competition surface — they capture the same competitive energy as brackets without scheduling overhead or admin curation.
No polls / daily challenges
The hero region surfaces the week's top combined player as the only "highlight" — auto-generated from gameplay, no admin curation needed. Agents always see a name (theirs or someone else's) when they open Arcade.
Individual-only leaderboards
Leaderboards show individual players — agents see their own name and rank against the team. No team-aggregate plumbing required.
One achievement that matters
The per-session "new personal best" badge is the achievement system. Immediate, meaningful feedback when an agent beats their own record — no dormant achievement wall to scroll through.
Quick start ≈ 5 minutes
- Activate the module at RubiMine. $49.99 / mo, flat — no per-seat fees.
- Sysadmin verifies schema at
/admin/run-arcade-v2-migration.php. All 3 tables (arcade_games, arcade_game_sessions, arcade_player_stats) should show ✅. - Seed the V2 catalog from the same page (or view-arcade-state.php). Picks tenant, clicks Seed catalog. Five games inserted. Idempotent.
- Open the Arcade tab in the CRM as any agent. Five game cards appear with category-colored art.
- Play a game. Click any card. Game launches in a modal iframe. Play your 30-90 seconds. Score posts on session end.
- Check the leaderboard. Switch to Leaderboards. Toggle per-game vs combined. Pick a period.
API endpoints
All on /crm/api/arcade.php. Session-authenticated, tenant-scoped. JSON request + response.
POST action=list_games
POST action=start_session (game_code) → { session_code }
POST action=end_session (session_code, score, meta?) → { ok, score, rank_today, is_new_highscore, previous_best }
POST action=leaderboard (game_code, period?, limit?) → top players for one game
POST action=combined_leaderboard (period?, limit?) → cross-game percentile ranking
POST action=weekly_highlight → top combined player this week
POST action=personal_stats → caller's full stats bundle
Period values: day, week, month, all. meta on end_session accepts level / accuracy / combo / duration_seconds for replay analysis (stored on the session row).
Building custom games
Each game is a standalone HTML file in /crm/modules/arcade/games/. The Arcade SDK gives you a postMessage bridge to the parent CRM.
Minimal game template
<!DOCTYPE html>
<html><head>
<link rel="stylesheet" href="/crm/modules/arcade/games/_shared/arcade.css">
<script src="/crm/modules/arcade/games/_shared/arcade-sdk.js"></script>
</head><body>
<script>
async function start() {
const { sessionCode } = await ArcadeSDK.start('my-game-code');
// ... game runs ...
let finalScore = 1234;
ArcadeSDK.live(finalScore); // updates parent ticker mid-round
const result = await ArcadeSDK.end(finalScore, { level: 5, duration_seconds: 60 });
// result = { ok, score, rank_today, is_new_highscore, previous_best }
}
start();
</script>
</body></html>
Registering the game
Insert a row in arcade_games for the tenant:
INSERT INTO arcade_games
(tenant_id, game_name, game_code, description, category, icon,
scoring_type, time_limit_seconds, display_order, is_active, is_new)
VALUES
(?, 'My Game', 'my-game-code', '...', 'arcade', 'fa-star',
'points', 60, 99, 1, 1);
The module's game grid will pick up the new row on next load. V2.1 will add a tenant-admin custom-game registration UI — for now, raw SQL or a one-off engine call from a sysadmin script.
Known limitations (V2)
- No anti-cheat — the score on end_session is whatever the client sends. A motivated agent could DevTools-edit their submission. Acceptable trade-off for a break-room module; not appropriate for high-stakes competition.
- No multiplayer — every game is single-player. Leaderboards are the social layer. Real-time multiplayer is not on the V2.1 roadmap.
- No mobile-app integration — games are browser-only, designed for desktop work. They render on mobile but small touch targets in Reflex Pop and the on-screen keyboard for Word Rush are not optimized.
- No sound effects — by-design for a work environment. Adding optional in-game audio is V2.1.
- Custom games via SQL — no UI to add a custom game without raw INSERT. V2.1 ships a tenant-admin form.
- No replay system — meta fields on session row store level / accuracy / combo / duration but there's no UI to scrub past sessions.
Frequently asked questions
What was wrong with V1?
What are the five games?
How does the combined leaderboard work?
What's the daily streak?
Are these games work-safe?
Are scores tied to call performance?
How is tenant isolation enforced?
Can I add my own games?
What happens to V1 polls / rewards data?
How does scoring work in each game?
How much does this cost?
Ready to give your agents a five-minute reset between calls?
Activate, seed, play. Your team's leaderboard fills up the same day.