🎯 What it does Royal Tactics is an interactive chess puzzle game built as a Reddit Devvit app that challenges players to checkmate the black king on a compact 4×3 board with only 3 white pieces. Players can:

Solve tactical chess puzzles with limited pieces and moves Earn tokens for completing levels (30 tokens per win + bonuses) Complete daily puzzles for extra rewards (50 tokens + 20 perfect bonus) Compete on the leaderboard - exclusive access for players with 100+ tokens Track progress - all data saved to Reddit's Redis backend Start with 30 free tokens - new players get a welcome bonus automatically Join the community - Level 1 completion prompts users to join the subreddit The game features a beautiful parchment-themed UI with smooth animations, real-time feedback, and an intelligent AI opponent that plays optimally against the player.

Royal Tactics combines chess strategy with gamification, creating an engaging puzzle experience that keeps Reddit users coming back daily. The freemium model encourages community growth while the token economy drives engagement and competition! 👑♟️

🛠️ How we built it Tech Stack Frontend: React 19, Tailwind CSS 4, Vite Backend: Node.js v22 serverless (Devvit), Hono, tRPC v11 Database: Reddit Redis (for user progress, leaderboard, daily puzzles) Communication: tRPC for end-to-end type safety Deployment: Reddit Devvit platform Architecture Dual Entry Points

splash.html - Inline view (feed preview) with centered title & king icon game.html - Expanded view (full game experience) Backend Integration

Server runs in secure Devvit serverless environment Access to redis, reddit, and context via @devvit/web/server tRPC endpoints for progress, leaderboard, daily puzzles Game Logic

Vanilla JavaScript chess engine with optimal AI solver Generates verified puzzles using Monte Carlo position testing Tracks hints, move history, and material counts Real-time validation and feedback Reddit Integration

Uses context.username for user identification Posts level completion comments to subreddit Weekly leaderboard comment generation Join prompts after Level 1 completion Key Features Implemented ✅ Chess Engine - Custom 4×3 board with full chess rules ✅ Puzzle Solver - AI that finds forced checkmates ✅ Token Economy - 30 free tokens on first join, rewards for wins ✅ Leaderboard - Locked until 100+ tokens (shows progress bar) ✅ Daily Puzzles - New puzzle every day with bonus rewards ✅ Freemium Model - Level 1 free, join prompt after completion ✅ Progress Persistence - Redis storage with auto-save ✅ Responsive UI - Works on mobile and desktop

🚀 What's next for Royal Tactics

  1. User-Created Puzzles 🎨 Allow players to design their own puzzles:

Custom piece selection (choose 3 from Pawn, Knight, Bishop, Rook, Queen) Position randomization with verification Submit puzzles to community for voting Featured puzzle of the week Earn bonus tokens for approved submissions Implementation: Already has preset arsenals - extend to user submissions with moderation queue

  1. More Puzzle Content 📚 Expand puzzle variety and difficulty:

200+ verified puzzles across 10 difficulty tiers Themed puzzle packs: Endgame tactics, sacrifice puzzles, zugzwang positions Tournament mode: Series of 5 puzzles with cumulative scoring Time trials: Speed bonus for fast completions Perfect mode: Solve without hints for 3× tokens

  1. Streak Bonus System 🔥 Reward consistent daily play:

Streak Rewards:

🔥 3-day streak: +10 bonus tokens 🔥 7-day streak: +30 bonus tokens + "Weekly Warrior" badge 🔥 30-day streak: +100 bonus tokens + "Monthly Master" badge 🔥 100-day streak: +500 tokens + "Century Champion" flair Streak Features:

Visual streak counter in header (🔥 7 days) Streak freeze tokens (skip a day without losing streak) Push notifications for streak reminders Leaderboard category for longest current streaks

Bonus Features (Future) 🏆 Achievements & Badges

"First Blood" - Complete first puzzle "No Mercy" - 10 perfect completions "Speed Demon" - Complete puzzle in under 30 seconds "Token Tycoon" - Reach 1000 tokens 👥 Social Features

Challenge friends to specific puzzles Compare completion times Share puzzle victories as Reddit posts Weekly community tournaments ⚙️ Customization

Unlock alternative piece skins Board themes (classic, neon, minimal) Sound effects and music toggle Accessibility options (colorblind mode, larger pieces) 📊 Analytics Dashboard

Personal stats (win rate, average moves, time per puzzle) Completion heatmap Difficulty progress graph Token earning history 🎮 Current Game Stats Puzzles: 7 verified positions Token Economy: 30 free start → 30 per win → 50 daily puzzle Leaderboard: Top 10 players with 100+ tokens Features: Hints, auto-play, replay, daily puzzles, progress tracking Integration: Full Reddit backend with comments, username display, join prompts

Built With

Share this project:

Updates

Submission history