R Mahjong, a riichi mahjong app for four players currently available only on the Android platform, has been released. So what does the release include?

R Mahjong has two main modes of operation: local game mode and network game mode. Each of these two modes has its own settings and records played games in separate directories. Essentially, these are two separate applications combined into one.

In local play mode, players can compete against three AI bots. The artificial intelligence available in the app collects hands pretty quickly. At the same time, he knows absolutely nothing about the value of the hand and does not take the value into account when assembling the hand. In addition, the AI only knows a few yakus. Finally, when one of the opponents declares “Riichi”, the AI immediately goes on the defensive. In the future, we plan to create more powerful AI to give players the opportunity to practice playing against stronger opponents. We hope this approach will help players improve their mahjong skills.

There is also a function to record the games played. Players can see the games they’ve played and see them from any player’s perspective. After each game, the player’s rating is recalculated.

The network game mode is a multiplayer mode. In multiplayer mode, the player can play mahjong with his friends and the game can be started with just a few taps. You can play mahjong anywhere1. The player doesn’t need internet to start playing mahjong with friends. All he needs is an Android device at a distance, allowing a Wi-Fi connection to be established between them.

network game mode

In “network game” mode, one of the players (here called the “host”) starts the server on his device (by choosing to start the server). At the same time, the server starts sending announcements to the local network (via mdns), informing client devices of the server’s presence on the network.

The remaining players (called “guests”) start the “network game” in client mode (by selecting “Join Game”). In this case, the “guest” receives a list of available servers on the local network on the screen and can join one of them by touching its name. The “host” will see all the joined players on the screen of his device, and as soon as everyone has joined, he will press the “Start” button. When the “host” presses the “start” button, the server checks the number of participating players and, if there are less than four, launches the required number of AI bots. So the game can be played by 4 players, 3 players and 1 bot, 2 players and 2 bots, 1 player and 3 bots. In the latter case, the only difference from the “local game” mode is the time limit for making moves. This limit is adjustable within wide limits (up to 5 minutes per move). Such a large time limit may be needed, for example, when training beginners. If a move has a time limit, resetting the timer simply prevents the player from thinking about the move for longer than the set time. In this case, the player must be in the game.

But what does “player participate in the game” mean? This means that the player did not close the application or turn off the phone. And that he didn’t click on the link in the interstitial ad. In fact, the network protocol implemented in R Mahjong does not provide periodic transmission of heartbeat signals. The server simply waits for a response from the client, and if there is no response beyond the set limit, the server simply disconnects the client and the Tsumogiri bot starts playing instead. In this case, the name of the disabled player will be displayed in red.

There is currently no way for players to reconnect, so if they get disconnected, they will be disconnected for at least the rest of the game. Please note that the network traffic in the application is encrypted, so no one can commit fraud by turning on the network sniffer and reading network messages. The R Mahjong app has a bilingual interface in English and Japanese. There are no plans to support other languages at this time.

It is important to note that the R Mahjong app is completely free and we plan to keep it free in the future.

1 There are apps in the Google Play Store that promise “mahjong anywhere”. However, in fact, these are single-user applications that implement offline mahjong. On the other hand, R Mahjong allows you to play mahjong anywhere against other players. Feel the difference!