Kajongg: True Mahjong at last

Off the Beat: Bruce Byfield's Blog
For as long as I've owned a computer, I've been looking for Mahjong game. Not a decent Mahjong game, but any at all. Years ago, I found a monochrome shareware game for DOS, and later I found a Windows game, but both were soon rendered unusable by developments in hardware and software. Nor did I ever find a Mahjong game that ran natively in GNU/Linux -- not, that is, until KDE released Kajongg a couple of versions ago.
I am not talking, you understand, about the matching game that masquerades as Mahjong. That is a game sometimes called Shanghai that uses Mahjong tiles, but has more in common with solitaire or patience than true Mahjong.
You can find versions of the tile-matching game in GNOME as mahjongg and in KDE as kmahjongg. However, the Mahjong that Kajongg offers is a game for four players that resembles gin rummy, with tiles in place of cards. The goal is to collect sets of tiles, usually three or four of a kind, but also rarer, more complicated sets. When all a player's tiles are in a set, the player wins. The result is a game that involves luck but also a strategic awareness of which tiles have been played, a combination that makes the game ideal for gambling.
Played for centuries around the world, Mahjong has a number of variations, most of them involving the exact number of tiles and the sets that players can make. Currently, Kajongg offers only Classical Chinese scoring rules, although it will also allow different rule sets to be added if anybody ever writes them. Similarly, in theory you could play Kajongg on a game server, but for now the only option is for a local game in which the computer plays three players.
Aside from an incongruous default Egyptian-themed wallpaper (which I quickly changed to a Chinese painting), Kajongg closely reproduces a real life game of Mahjong, with players' tiles arranged in a square and discards placed randomly in the middle. The possible moves that you can make at any time are displayed on buttons down the right side of the screen. There is even an option for exchanging comments with other players, although obviously that has no purpose in a local game against the computer.
Since KDE has long had a tile-matching game, four designs are available. However, no matter which one you choose, probably you will want to play Kajongg full-screen, since some of the tiles can be hard to read in a smaller window.
Smoothing Game Play
In general, Kajongg's game-play is reasonable, but Mahjong does have several disadvantages that neither Kajongg or any other implementation can do much to overcome. Now that I think of them, these disadvantages may explain why true Mahjong has never really caught on as a computer game.
To start with, a single hand of Mahjong is not a quick diversion while you're waiting for a friend on IRC to return to the keyboard. You need to keep alert in case you can pick up a discard, and to guess what sets other players might be trying to compete. Although you can pause the game indefinitely when your turn comes around, in general Kajongg is not a game that you can easily leave and come back to. Nor will you want to as you get into the strategy. Consequently, a complete game may take 40-80 minutes to play, depending on the luck of the tiles and how carefully you think before acting.
Not much can be done about the time Mahjong takes, but Kajongg is generally effective in speeding things up. For example, while Kajongg's artificial intelligence seems to be reasonably speedy, although each computer player can take as long as twenty seconds to make a choice, especially later in the game when the tactical options increase. The time will be even longer due to the time you have after a discard to think about picking it up -- at least, until you notice that clicking the No Claim button ends this waiting period.
Even more importantly, although some sets are easy to see, others are more obscure. As a result, you need to know the rule book unless you want to spend several minutes mulling over each move. At least for the first few games, you may want to have the online help open -- or, better yet, printed so that you can view it quickly while keeping one eye on the screen.
You might also want to heavy use of the various dialogs that explain scoring in the View menu, both during play and at the end of each hand. This information will not only help you to make your moves, but also help you to learn the sets you can build during play.
A long-awaited game
If this description sounds like Kajongg is not for everyone -- then you're right. Mahjong has an involved set of rules, and takes far longer to learn that games like Gweled or KBreakout.
However, like all of the games in the KDE 4 series, Kajongg features gorgeous visuals. Even more importantly, it does everything possible to speed game play and to help you to learn the rules.
Kajongg may not be as enjoyable as having friends over for Mahjong and drinks. Personally, too, I would enjoy it more with Hong Kong scoring, partly because those are the rules I prefer and partly because Hong Kong scoring includes more complex tile sets. Still, I confess that Kajongg has wasted more hours for me than I care to admit, and for that I am as grateful as I am guilty.
Comments
comments powered by DisqusSubscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
News
-
The GNU Project Celebrates Its 40th Birthday
September 27 marks the 40th anniversary of the GNU Project, and it was celebrated with a hacker meeting in Biel/Bienne, Switzerland.
-
Linux Kernel Reducing Long-Term Support
LTS support for the Linux kernel is about to undergo some serious changes that will have a considerable impact on the future.
-
Fedora 39 Beta Now Available for Testing
For fans and users of Fedora Linux, the first beta of release 39 is now available, which is a minor upgrade but does include GNOME 45.
-
Fedora Linux 40 to Drop X11 for KDE Plasma
When Fedora 40 arrives in 2024, there will be a few big changes coming, especially for the KDE Plasma option.
-
Real-Time Ubuntu Available in AWS Marketplace
Anyone looking for a Linux distribution for real-time processing could do a whole lot worse than Real-Time Ubuntu.
-
KSMBD Finally Reaches a Stable State
For those who've been looking forward to the first release of KSMBD, after two years it's no longer considered experimental.
-
Nitrux 3.0.0 Has Been Released
The latest version of Nitrux brings plenty of innovation and fresh apps to the table.
-
Linux From Scratch 12.0 Now Available
If you're looking to roll your own Linux distribution, the latest version of Linux From Scratch is now available with plenty of updates.
-
Linux Kernel 6.5 Has Been Released
The newest Linux kernel, version 6.5, now includes initial support for two very exciting features.
-
UbuntuDDE 23.04 Now Available
A new version of the UbuntuDDE remix has finally arrived with all the updates from the Deepin desktop and everything that comes with the Ubuntu 23.04 base.
Thank you
I'd wish to have know about your article sooner... (I am the author of Kajongg)
Just a few remarks:
the server option is fully implemented, this is not only theory. The only thing needed is that somebody starts the server (kajonggserver) on his computer and makes its port accessible from outside. So if you want to play against a combination of 2 robot players and myself - just tell me!
there is no option to exchange comments with other players, it is not even planned, There are so many excellent chat programs. However if you record voice files as described in the manual, the other players will hear your claims and your discards just like in a real game. This also makes it nicer to play against the computer. Preinstalling voices is planned but I would need at least 3 english speaking people to record them (hint...) (a mix of male/female would be optimal). I am native german but if needed I would speak the 4th voice.
the delay of 20 seconds for thinking is configurable - not in the general options but in the ruleset (options) because each player should use the same value within one game for fairness.
I am not sure which version you tested - I changed the default background from egyptian to light wood in September 2010
xmj (mentioned by David) has one advantage: its robot players are much more intelligent. xmj is written in C or C++ (don't remember), but Kajongg is fully written in Python - and it is not that easy to implement good AI in a slow scripting language.
Regards
Wolfgang
KDE KMahjong
How do you install Kajongg?
Where you find it?
its not in the repos.
if its part of the KDE games, why isnt it available to download?
If you build it, they will come... BUT ONLY if you give them directions on how to find it.
Interesting article but totally useless for a semi-newbie. (I can do the kpackagekit thing and copy-paste sudo commands)
Re: typo?
Mahjongg in Gnome Games
Mahjonng is included in the Gnome Games package....
No, that's the tile-matching game that goes by the same name, not the four-person game I'm talking about. Thanks, though.
Gnome
kajongg
Hope that helps
Regards
Dave Le Huray
Guernsey
typo?
cheers!