Post

Some advice for devs, if you're ever parsing strings into floats for whatever reason, make sure you take into account that some languages in the world swap the roles of the comma and the decimal. It'll read it without error, but suddenly 2.5 becomes 2,500 for some users, causing problems. #gamedev

11 reposts68 likes

This is especially true for Unity devs, as C#'s "float.parse" will default to the operating system's language's handling for parsing. You have to specify culture settings to make sure it remains consistent. I learned this the hard way 😀

Certainly! Though the issue I discovered was more the inverse. However, I've been sure to use String.Format for implementation of localizing strings. Though now with this in mind I'll be double checking every implementation of conversion with strings.

Assassin's Creed Odyssey using big numbers everywhere like "next level 10000000 XP" and no thousands separator at all, making them hard to read : 👀

The issue I had was that the game was loading and running without errors, but everything was wrong. I had no idea this could be a source of the issue, so it was extremely frustrating, since I couldn't figure out how to test it. Fortunately I had some help to root out the cause.