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
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
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!