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.

Vertical Integration

The game is built on agari, a Riichi Mahjong scoring library I wrote from scratch and validated against roughly one million Tenhou game logs. 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 planned — trained on a decade-plus archive of competitive mahjong game logs. The intent is to use it both as AI opponents with realistic 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