Intro

Sometime in June 2023, my son Leon brought from Köln a mid-90s laptop with Windows 95 installed. The only game it had was a version of the famous Chinese solitaire Mahjong called “Shanghai II”.

Shanghai II - Dragon

Shanghai II - Dragon

Leon didn’t know the game, and he got really excited about it. When I saw the game, I told him: “But that version is terrible, it looks horrible. There was an older version, on the Commodore Amiga, that I used to play with my dad that was much better.” Seeing the connection I had with that game, he said: “Why don’t you program it? So it’s available on modern computers?”

And that’s how the idea of making a new version of the famous solitaire based on pixel art came about.

Unity

I was taking two game development diplomas at two universities in Argentina. In one of them we were learning Unity, so I decided it might be a good option to try this development in Unity, thinking it would be a simple thing. Well, it’s not always like that!

Around August 2023 I had already started development. And luckily I had also started a dev-log that persists to this day. The first post in that dev-log is from 13.8.2023, and states that the project began around June 2023.

Timeline with Highlights

September 2023

The main game logic was already working by this date.

And apparently by September I had already managed to export a CSV with the board design, which was very practical for creating additional levels.

December 2023

During these months there was a kind of blackout, probably due to the demand of finishing coursework, and all that.

In December I started organizing the project a bit more, making a UI mockup, and all that:

January 2024

After some tests that didn’t convince me, I decided that the UI for the entire intro would use the color palette of the Amiga Workbench 2.0 (just 4 colors).

Audio

Looking for music for the game I came across a song I loved called Andante, I tried to contact the author Bjorn Lynne, but got no response.

I also saw that in the university Discord, there was a classmate who offered to help with sounds, but when I wrote to him I also got no response.

The audio issue would remain somewhat stuck until March. None of my approaches, neither for music nor for sounds, convinced me. I had to wait…

February 2024

Leon decides that the game shouldn’t have time, or timers, or anything that causes rush, the idea of the game is to relax… so all the implementation of the time screens is discarded. And I had the feeling that it’s fine that way… for some reason the time calculation issue wasn’t working.

March 2024

It seems that in February there were no significant advances.

The good thing is that in March I realized that an email from Bjorn Lynne (The musician) had gotten lost somewhere in the emails, so I contacted him and licensed Andante for the game!!!

I also managed to contact the sound designer Nacho via Instagram. And I also hired him to make the game sounds.

Andrés, a university classmate, suggested that the boards should have at least one solution. The truth is that the idea seemed good to me, but I found the implementation super complicated. So I put this feature on pause. And also seeing that in the original game it specified in the rules that the boards were randomly generated, I almost decided to discard it.

Remarkably, with some features, I felt something metaphysical. Something like if the implementation gets stuck, it’s because it wasn’t meant to be. I don’t know… but I wrote this:

“As has been happening, the idea that Andrés suggested didn’t work. It seems that when something doesn’t flow with this software, it’s because it’s not destined to be there. After trying and struggling a lot looking for ways to determine if games could have solutions, and even building a small wooden and paper model to explore possibilities, I decided to read the instructions and it turned out that the placement of pieces is 100% random. So I’m going to leave it as it was originally and make it 100% random, without any kind of verification. Every time something like this happens, I feel great relief and great happiness. The process or mechanism is like this: idea -> implementation block or creativity block or dissatisfaction with the result - block, block, block -> realizing that it doesn’t fit, it’s not adequate or simply no -> discard -> happiness.”

April 2024

Nacho managed to finish the sounds and they turned out great!

Fun fact (or sound fact…), it turns out that in one of the sounds I sent him as reference a secondary song from Exodus Ultima 3, and he generated sounds that were super similar. He’s an audio genius!

Song 10: Shrine

This month I also managed to add the final game screen.

May 2024

There was a problem with loading CSV files (Boards are created using CSV files!), in the iOS version, but it was easily solved.

I also spent a lot of time understanding Window vs Full screen mode in the desktop version. So the full screen version remained.

This month the name was also decided: Leon’s Mahjong. And I decided to redraw all the pieces, which took a little time.

It’s not connected, but by the end of May, my YouTube channel was closed, and that affected me emotionally.

June 2024

On the 1st I had hopes of being able to launch the game by the end of the month. But no…

When testing the game on different phone resolutions, iPads and desktop I had to adjust the UI significantly so it would look good on all screens.

Definitely, this is an element of complexity of our times. It didn’t happen before, or maybe barely, if it was ported from one computer to another. But now, with phones that have different resolutions and aspects, plus tablets, plus desktop computers, well, it’s complex.

Apparently by June 15 everything was ready.

By the 16th I had already managed to get the developer account on Apple! The idea was to launch it on the App Store for iPhone, iPad and macOS.

But on the 17th the plans were obscured because something broke in Test Flight (the software used to test apps)

After contacting Apple, on June 22 the Test Flight issue was solved, so several people could start testing the software on their phones and computers!!

On June 25 Leon found a bug, quite complex to reproduce, and luckily easy to solve.

By the 29th the bug was already solved, but the Test Flight error appeared again so I had to contact Apple again. It’s curious that in the dev-log entry I feel there’s a supernatural force trying to prevent the release of this! Because there was also an issue with hosting when registering the domain for the game (which was previously a subdomain of lucasdima.com)

July 2024 (the month of zoom, pinch and pan)

Many things this month!

My friend and colleague Andrey Smelov told me he bought an iPhone, so I incorporated him into the testers (he’s the only tester outside the family!).

I also discovered that the intro didn’t look 100% good on certain iPads, so I had to rearrange the entire intro.

Last-minute changes:

  • Change in the functions that detect touch in Unity.

  • Based on feedback from my son Lautaro and my friend Andrey, I decided to make a video tutorial. It seems the text wasn’t liked!

Zoom and pan

This was tremendous. Leon came up with the idea that it would be good to be able to zoom, and well, I went to investigate a bit.

It turned out to be very complex to achieve a zoom and pan that convinced me, that looked the same as the zoom and pan of Apple’s photo app. It’s incredible how many things you have to take into account for a functionality that seems simple to look and feel natural. This involves smoothing movements, specifying the zoom center, setting limits for panning, and a large number of other things.

Leon helped me with some mathematical functions to calculate the camera position, it was super gratifying to see him do mathematical things with real applications in software!

Leons Mahjong Zoom math calculations

After several days, almost weeks of dealing with this, I finally reached a solution that seemed very good to me.

Something to highlight, on desktop I decided not to add zoom, basically because I couldn’t capture the pinch of the Mac’s Touchpad in Unity. And I refused to use the “wheel”, which with touch is another gesture.

For some reason on iOS I still saw the movement as somewhat rough, and I couldn’t detect what it was, until after reimplementing everything in an ultra simple way (I even looked for my notes from Art and Coding classes to implement smooth movement), I realized that the problem was the FPS on iPhone, so a single line of code managed to smooth the movement:

Application.targetFrameRate = 60;

August 2024

With zoom and pan solved, I only added a button in the settings to disable zoom. And some details like adding a semi-transparent black box to the text that after zooming is under the pieces.

An additional detail I incorporated were some random hints that appear in the intro. With game tips, and some funny things I can communicate.

Then came all the preparations for the App Store, this includes some videos, and screenshots. And the complexity of the number of different resolutions… 3 for iPhone, 3 for iPad and 1 for desktop. There was also a color issue here, for some reason, the videos captured with the phone and processed with the Mac’s photo app all looked washed out in the DaVinci Resolve render. Luckily when exporting them directly, without modifying them in the photo app they looked perfect.

Now yes, everything ready for launch.

The launch!

On the morning of August 7, after reviewing all the videos, texts and images, I sent the game to be approved by Apple. On the evening of the 7th, and on the 8th at 3am Berlin time, the iOS and macOS versions were approved by Apple without problems.

Leon Mahjong on Apple’s App Store

Absolute happiness!

Having a published game is wonderful. It took a year, and the feeling is really gratifying! I would do it again!!

Some reflections

Remarkably, the game logic took no time compared to all the preparations for publishing, UI, zoom details, sounds, music, etc. It’s a general pattern of the great interdisciplinary effort that making a game is. And that even if you have a moderately functioning gameplay, all the surrounding details that make the whole demand a large amount of time and effort.

Next steps

Going back to the topic of games having at least one possible solution, also suggested by another friend (Andrés and now Cristof), I’m going to investigate this more thoroughly.

Add more boards! This should be very simple, because as I already told you the boards are defined in a CSV file. I would just have to modify the start screen to show more boards.

Launch a version for Steam (Windows and Linux).

Launch a version for Android.

For these things, I think I would need a PC and an Android phone. I’ll see how to solve this.

Some images

Leon Mahjong Intro Screen

Tile guide in Leon’s Mahjong

Leon’s Mahjong original board

Download Leon’s Mahjong

Download on the App Store
Get it on Google Play

Leon’s Mahjong official website