DEV Community
How I built a "chess-engine" style AI for a 6-dice strategy game natively on my Pixel 9 Pro
I just moved a solo project out of closed testing into production, and the engineering constraints almost broke me. The app is Maxi Yatzy Master, a digital version of the Scandinavian 6-dice variant of Yahtzee. The core game is completely free to play, but building a worthy AI opponent for it required solving a massive compute bottleneck. The Math Problem Standard 5-dice Yahtzee is largely luck-based, but the 6-dice variant allows players to bank unused rolls for later turns. This single mechanic creates incredibly complex diverging paths across different game states. Most mobile dice games use rigid logic trees or simply cheat the dice to simulate difficulty. Calculating the true optimal move required serious compute. To solve this, I built the game logic and probability statistics using a codebase architecture similar to advanced chess simulators. The AI is game-aware; it actively reads the opponent's scorecard and dynamically pivots its risk tolerance to maximize its actual win probability, rather than just chasing a raw high score. The Mobile-First Toolchain To make things harder on myself, I engineered the entire project natively on my phone. Local Environment: Built natively in the Claude Code app on Android. Multiplayer: Bypassed heavy matchmaking servers to build a lightweight, serverless Peer-to-Peer architecture using Firebase rules for online play. Deployment: GitHub, Cloudflare Pages, and Netlify. Feedback Engine: Built an offline analysis tool that flags mathematically suboptimal choices, tracks play themes, and allows players to jump back to replay specific turns. The Result It’s exactly the app I hoped it would be when I set out to build it, and it went through rigorous closed testing with a dozen real players to tune the mechanics. If any of you want to test out the AI's compute performance on your own device, or stress-test the Firebase P2P syncing, the app is live here: https://play.google.com/store/apps/details?id=com.maxiyatzy.trainer I’d love to hear your thoughts on the architecture, and I'm happy to answer any questions about the mobile-native workflow!
Powered by Readybot.io
External Link
Platform
You are about to visit:
https://example.comThis will open in a new tab. Make sure you trust this link.