This Month in Jikaze (2025-02)
Published
Catch up on the developments and current state of Jikaze up until 2025 Februrary.
This is the first in (hopefully) a series of monthly updates about the state of Jikaze. This first post will be presumably longer than future posts in order to provide context about what Jikaze is and why it was made.
What is Jikaze?
From my the Jikaze README:
Jikaze is a client for people to play Mahjong with each other. It is also a server for people that would like to set up their own instance. The goal of Jikaze is to respect your privacy and to make playing Mahjong accessible.
How do I pronounce "Jikaze"?
"Jikaze" comes from the Japanese Riichi Mahjong terminology meaning seat wind (Kanji: 自風).
Formally, it is pronounced with the following phonetics: /dʑi kaze/.
Informally, it is something like "gee-ka-zay".
Motivation
Jikaze started out because there were no active Free (libre) Software Mahjong games that were 3D and matched the level of quality other proprietary clients out there had. While many of the proprietary options out there provided snippets of how their walls are shuffled, doubts still remained whether or not those games were truly fair. Also, the current clients out there had limited customizability. Lastly, I wanted to give people the ability to create their own mahjong communities and build the clients they want by choosing a license that respects the four essential freedoms for users.
I first learned how to play in the summer of 2022 through one of the proprietary clients out there that supported English. I was hooked and played the game a lot. A few months later, I found another client was released and also supported English. This one stood out to me with its smooth animations and crisp UI, though I found the UX to be less than stellar because of its in-your-face push for people to purchase their in-game currency. I wanted to create my own version with a similar level of quality, without the annoyances and questionable character skins.
Why AGPL?
GNU Affero General Public License text: https://www.gnu.org/licenses/agpl-3.0
I wanted a strong copyleft license to ensure that all derivatives of this project respected those four freedoms I wanted to provide. This means that people are not allowed to forbid their users from obtaining a copy of the source code and having the freedom to do whatever they wished with it.
I have found that a lot of the Mahjong industry is shrouded in a lot of proprietary trade secrets and knowledge. I wanted to open up a door to make Mahjong more accessible for everyone while also providing the tools for people to be able to create their own Mahjong apps.
I understand that there will be people that will disagree with my choice to license the Riichi core library as AGPL instead of the LGPL, MPL, or even a permissive license. My goal here is not for wide developer adoption (though it is not unwelcomed) but to ensure that the protections of the AGPL are extended to those that choose to use my libraries. I feel that it would be a disservice to provide convenient libraries that can then be incorporated into proprietary software, essentially providing free labor without giving back to the community.
First Steps - Building a Library
I wanted to see if I could utilize someone else's hard work so that I can have a playable version of my game more quickly, and started by looking through https://crates.io for any compatible options.
Unfortunately, I saw that many of the crates available at the time were not actively maintained so that eliminated most of the options.
The ones that were available felt limited, held back by a lack of documentation, or made architectural design choices I didn't agree with.
A common design I saw were tiles being represented as struct
s.
I believe this approach is flawed because they typically use integers to store the tile's value, making it error prone when adding checks in the logic.
I set out by writing my own types.
Intially I had created separate enums for the different tile suits, however, I quickly realized that I could not easily combine the different enum types in the same logic.
To address this, I created a TileType
enum to unify them, though this was quickly changed into the unified Tile
enum that is present today.
It was at this point that I chose the GPL-3.0-or-later license. I had the same idea as I mentioned in the Why AGPL? section, however, I was not aware of the section about conveying over a network that was part of the Affero GPL at this time.
I realized that having the core logic bundled together with the server and client code wasn't going to be good to keep the project tidy, so I moved the code into a workspace.
After many additions and changes to the core library, I relicensed the project from GPL-3.0-or-later to AGPL-3.0-only. I had envisioned the client software being accessible via a web browser eventually instead of just a native application, which the AGPL should grant the same freedoms through this medium. This was later relicensed to the current AGPL-3.0-or-later to allow updating the license to later versions of it.
Throughout developing this library, I have put in a lot of effort into making thorough and aesthetically pleasing documenation. This is because I want my library to be approachable and usable by even a novice to Mahjong.
Below are some screenshots of the generated documentation.
I eventually hit a road block when I was trying to figure out how to parse a hand into groups (mentsu; jantou (pair), shuntsu (sequence), koutsu (triplet)). I spent a lot of time agonising over how it can be done with the tile enum I had created and how I might implement a relatively efficient algorithm. Unfortunately, I was unable to find any reference or data to determine if my naïve implementation was similar to others'. This doubt caused me to burn out and take a hiatus from 2023 April to 2023 August.
Once I got over my mental hurdle and was okay with accepting a working, but perhaps inefficient, algorithm, I rapidly refined and improved the function to be more accurate and work for complex shapes. Even though I was feeling pretty satisfied, I was feeling a bit burnt out from the repetitive motions of creating new tests with mostly copied code and adjusting it slightly to have a different hand shape. These different hands were critical for providing confidence to myself that the function can handle complex hand shapes that would favor the more valuable scoring hand. It was tedious and exhausting to write new tests and fix bugs that surfaced from those tests. I knew that having these unit tests in place would allow me to refactor fearlessly but I needed another break, this time from coding altogether.
Creating the Art Assets
I didn't want to group the art assets in the same repository as the one with all of the code, so I created mahjong_assets
with a different license.
I had originally chosen the Creative Commons Attribution-Sharealike 4.0 license (CC BY-SA 4.0), though it is complex to have compability with GPL version 3 or later. Currently, it is only compatible with the GPL version 3 and since the AGPL version 3 is technically a different license, I wasn't sure how to proceed. I did eventually relicense the project as CC BY 4.0 to make it easier for myself, though I am still uncertain about this decision to this day.
I started the project by creating Blender models for the tiles, following a tutorial I had found, though I lacked my own tile faces.
For the tile textures, I initially used FluffyStuff's riichi-mahjong-tiles
.
At this point, I didn't really understand how to use Blender or what UV textures were, hence the uneven appearance. I had just hacked my way to something seemingly acceptable, but the current me now knows that it was not actually good.
I wasn't pleased with FluffyStuff's tile designs, so I set out to make my own in Inkscape. There wasn't anything wrong with FluffyStuff's tiles; it was just a matter of personal preference and pride. Thankfully, I have my own set of AMOS tiles, so I only needed to take a good reference picture and then start tracing in Inkscape. I still wasn't really creating anything by hand at this stage because I used an Inkscape plugin to automatically trace the paths it saw. I eventually retraced the designs because the autotracer plugin I used was flawed and rounded some corners that should have had sharper edges. If you look closely, you may notice some imperfections in the strokes such as a sharp corner in a curve. I think it adds a bit of personality since the design isn't original, though I'm not against someone making a cleaner version and making a PR, as long as it is an original project (made with Free Software) where they hold the copyrights to be able to transfer ownership.
Once I completed the tiles, I worked on other assets I needed such as the tenbou (point sticks). I was relatively satisfied with these and left them mostly alone from 2024 June to 2024 December.
It was somewhere in between this time that I followed a beginner Blender tutorial to properly learn how to use the software. After spending around 3 months learning Blender, I went back and remade the tiles using the knowledge I had gained, such as having UV images to wrap around the models. I also started to create other models such as the tenbou in Blender and the junk mat.
I would really like to create a model of an automatic table and while I started creating it, I realized it is currently beyond my skills and there are bigger priorities in this project. The junk mat will suffice and act as a placeholder for now until I practice Blender more. Once I have a playable version of the game (i.e. the MVP), I can consider revisiting this idea.
Below is what I have currently:
Monetization / Funding
There are many people that misunderstand the term "free and open source software" to mean free in cost, though that is not what "free (libre) software" is about. There must be some funding model in order to sustain active development and being commercial is not against the four software freedoms.
I am not sure if I will add monetization in the game, but I do want to be able to work on this full-time. Ideally, project funding would be done completely through donations and sponsorships so that all of the content can remain free (libre) and free as in "free beer", though I am not expecting it to work out like this.
A more realistic model would be to monetize some aspect(s) of the game to fund the development of the project and upkeep of the server. I am not sure about what approach I want to try, though I do want to avoid things like loot boxes and I want to make an ethical solution.
I have been considering borrowing similar ideas from Tenhou, which provides the following (incomplete list):
- Windows client
- Access to Tenhou events, sometimes with prizes
As I am a Linux user, I do not plan on making or testing Windows or Mac clients If I were to have Windows and Mac builds, having people pay for a native application client for those OSes seems okay given the time it would take to support those platforms. If I decide not to have Windows or Mac builds, they might be community-maintained. I do plan on having a web client, which would make it OS-agnostic.
Networking and Building a Community
I haven't successfully created a community interested in this project yet, though I only began my efforts after attending FOSDEM 2025 in Februrary. I had met many wonderful people and a common piece of advise was to be more active in communicating and sharing this project with others. One suggested method was to blog about development updates and anything technically related, which I can hopefully keep up to monthly updates from now on.
I was originally planning on doing all of this work in a vaccuum and then revealing the "finished" work and then building a community afterward. I realize that this approach can work for others, but now I personally believe that it is very important to gather interest in a project before it is completed. There are many potential benefits to having a community of people you can ask for feedback and maybe a few of them may be willing to lend their skills to contribute to the project. Even something as simple as hearing words like "this project is cool" can be really motivating when there is so much doubt about if I'm heading in the right direction or whether people will actually care to even look at my project.
This effort to create blog posts and engage with people, both virtually and in real life, does take time away from working on things like the code, but I don't think it's necessarily a bad thing. This retrospective really solidifies a sense of accomplishment to reflect on what was accomplished and sharing the summaries makes it easier for people to follow developments. I'm not used to blogging so it may take me more time than it may with others to write these posts. I'm hoping that with enough practice, I will be more efficient and eloquent with my words 😉.
Recently, I had focused my efforts on refining the project's READMEs for Jikaze and Mahjong Assets to make it more appealing and informative for visitors. So far, those efforts appear to be well-received!
Next Steps
I am planning on using Bevy to create the client. When Bevy version 0.16 is released, I plan on learning how to use Bevy and using what I learn to make a proof of concept Jikaze client. I am not planning on achieving a polished client initially, as I am looking to build a community and getting feedback on the project. I believe that getting feedback and adjusting based on that feedback will improve development speed and quality.
If you're interested in this project, please consider starring the Jikaze and Mahjong Assets projects or getting involved! I will be more than happy to answer your questions or reviewing pull requests.
You can also find me on Matrix in the #jikaze:matrix.org room.
I have Liberapay and Open Collective pages where you can help sponsor development of the project.
Thank you for reading this update in Jikaze!