Agari Game — Riichi Mahjong

Work in progress — actively in development.

A standalone Riichi Mahjong game built from the ground up in Rust with the Bevy game engine. The goal is a clean, gameplay-focused mahjong client that runs everywhere — macOS, Linux, Windows, iOS, Android, and the browser — with no compromises, no in-app purchases, and everything included out of the box.

Play Your Way

Offline by default. No account. No login. No internet required. Open the game and play — that's it.

Online when you want. Private game rooms let you play with friends over a seamless peer-to-peer host/client connection. One player hosts, others join with a room code. No matchmaking server, no third-party account, no data collection.

Vertical Integration

The game is built on agari, a Riichi Mahjong scoring library I wrote from scratch and validated via cross-validation against other established Riichi Mahjong scoring engines across millions of simulated games. That library handles tile decomposition, yaku detection, shanten and ukeire calculation, and scoring — the entire rule engine. The game client consumes it directly. There's no third-party game logic dependency anywhere in the stack.

This means bugs get fixed at the source, features like the tenpai helper are powered by the same proven shanten/ukeire calculations used in validation, and the whole system evolves as one unit.

What's In the Box

The current build is a fully playable East-round hanchan against three AI opponents, with:

AI Opponents

The current AI uses shanten minimization and ukeire maximization to make discard, call, and riichi decisions. It accounts for all visible tiles (discard ponds, open melds, dora indicators) when evaluating hand efficiency.

A custom ML model is in training — bootstrapped on clean-room synthetic game logs generated by our own rigorously tested heuristic rules-based agent, then improved via reinforcement learning. The intent is to use it both as AI opponents with richer play styles and as an optional informed decision aid for the player during live games.

Platform Targets

The game compiles natively for desktop (macOS, Linux, Windows) and iOS, and runs in the browser via WASM and WebGL 2. Android is a target. The WASM build uses batched entity spawning to prevent the browser from locking up during loading, and all audio is OGG for cross-platform compatibility.

No platform left behind.

Design Philosophy

Tech