Japanese indie developer shares insight on common programming “trap” that can occur when localizing games

Japanese solo developer sekiyadn, who was involved in porting the Japanese adventure game Enjoy the Diner to Unity, recently revealed the cause of a unique bug that only occurs when users attempt to play the game on an OS set to specific languages. This problem is one that has troubled other developers in the past and is considered a “trap” relating to language environments and numbers.  

Enjoy the Diner is an adventure game where you spend time with the patrons at the Moon Palace, an “eternal” diner where time flows endlessly. One night, the protagonist wanders into the Moon Palace and becomes trapped there, spending endless hours in the mysterious space while conversing with the other patrons. 

The title was created by oississui and their game development group Gekkan Shicchitai. It was first released in January as a PC browser game via itch.io and other platforms, and steadily gained popularity. A Steam version of the game including additional content was released on August 1, and there are also plans for a Nintendo Switch version. In bringing the game to Steam, the game engine was ported from Godot to Unity. This porting was carried out by Studio Dragonet, a single-member game development studio headed by sekiyadn

After release, a bug was found in the Steam version of the game which prevented it from starting if your PC’s OS was set to certain languages. This bug was fixed in an update on August 10, and the patch notes cited French as one of the languages that caused this bug to occur. sekiyadn shared some insight via their X/Twitter account as to the source of the bug, the nature of which caught the attention of many users. The problem was related to the fact that different countries use different decimal separators for numbers, and it seems that many other developers have previously fallen into this “trap.” 

sekiyadn noted that the cause of the bug was the way that commas and periods are handled differently within the game’s code. They ported the game to Unity using the C# programming language, which has a function called “float.Parse”. sekiyadn said that the way this function handles numbers is what gave birth to the bug.  

In programming, data is classified into a variety of different data types which affect how they are interpreted. For example, if you have the value “3.5” it will be handled differently within the program depending on whether its data type is a numerical value, a text string, or something else. The aforementioned float.Parse function takes a text string and attempts to convert it into a numerical value including the fractional part after the decimal place. So sekiyadn used this function to change numbers stored as text into numerical values. 

Now, in many countries, including the US and Japan, a period ( . ) is the symbol used as the decimal separator in numbers. This means that when converting the text string “3.5”, you will get the numerical value 3.5 without any issues. However, this is where sekiyadn got tripped up. The problem of Enjoy the Diner’s Steam version not starting if the OS language was set to French occurred because the decimal separator used in France is a comma ( , ). So, while “3,5” would correctly be converted to a numerical value, the string “3.5” cannot be parsed as a valid number and causes the function to return an error. This bug ultimately prevented the game from launching at all. 

We asked sekiyadn about the bug, who noted that they first learned of it from user feedback on Steam. This user couldn’t get the game to launch and through communicating with them, sekiyadn discovered that the game would not launch if the OS language was set to French. sekiyadn then replicated the problem themselves, which led to them identifying both the cause and a way to fix it. They decided to share their experience so that other developers would not repeat the same mistake.  

This problem of “commas versus periods” has been a frequent issue for many developers, and there are many examples in game programming. Although the cause was never revealed to the public, there was a bug in Pokémon Brilliant Diamond and Shining Pearl which is thought to have been brought about by a similar issue. When the Switch’s system language was set to languages like French or German, the in-game calculator would behave strangely and produce incorrect results. Both languages use a comma as the decimal separator and a period as the thousands separator, which is the opposite of how it is done in the US and Japan (Related article). 

Another example is mobile rhythm game TAKUMI³, which had unexpected bugs occurring when launched in Vietnamese. The way that Vietnam uses commas and periods in numbers is also the opposite to Japan, so a number like “1.234” was being interpreted as “1234”, and the massive errors in calculations were causing the game to exhibit some bizarre behavior. The bug was fixed by the developer of the game, THIQXIS, who also detailed the cause of the problem (Related article). 

So it seems that problems relating to system locale have often caused trouble for developers. Another aspect that further exacerbates this issue is that there are likely fewer debuggers to test language environments outside of the languages that a game is being localized into. Even though there have been cases of this in the past, it’s still a pitfall that many developers fail to be aware of. Hopefully, sekiyadn’s message will get through to more people and help reduce the number of developers who go through it. 

Enjoy the Diner is currently available on PC (Steam). Further announcements regarding a Nintendo Switch are expected this summer.  





Written by. Marco Farinaccia based on the original Japanese article (original article’s publication date: 2023-08-12 18:15 JST)

Sayoko Narita
Sayoko Narita

JP AUTOMATON writer

Articles: 273

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA