Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

And finally, I believe I've found the culprit: a text file that represented the tire slip curve had commas as the decimal separator. English systems wouldn't recognize this and simply removed that comma, multiplying the values by 100. I removed the comma altogether and divided the value in the code itself. Problem solved!

(1 edit)

I think you're using C#. Look into System.Globalization. Try using CultureInfo.InvariantCulture. Then try using TryParse on the data type you are reading into. I believe it should parse any global / culture format.

However, if you just changed all of your floats into integers (x100) then that also works, but you should then read them into integers -- this is so it fails when someone later adds a float to that text file by accident.

In other words, your code should fail at the location of the bug. Not in the middle of gameplay where anything may have caused the error. Fail fast. Then my report to you would be "here's the exception", which can be solved in seconds.

Nonetheless, good debugging!