Vector Ball - International Re-Colored Edition!

Not a bug in MG though. Have a look at this link, you’ll want to pass a culture to Parse.

I see… The parser is by default culture sensitive… But there are ways to account for that. Got it!
Corrected my post above.

-What if you click your settings over real quick, does that magically fix things…? Because then all I have to do is re-write the parsing bits, behind the scenes…

It’s now a comma. I just changed it to a dot and started vector ball, but the game doesn’t start up anymore… It doesn’t throw an error or anything, just a silent crash. Changing it back makes the game launch again.

haha, the issues… Always the issues… Ok, so I will remake the loading system… And re post… Thanks for all your awesome help. I’m glad to find these little bugs…

Yeah, that tends to happen :stuck_out_tongue: Glad I can help!

you wont believe this …

So, I changed my code to use Single.Parse…

Turns out not to fix the issue, its still culture dependent to some degree…

However, you CAN actually fix it with a windows-culture tweak…

You just have to BOTH set the decimal system to period, AND set the digit grouping symbol to comma… Then you wont get the silent crash.

Let me know if you try this, I really think it might solve the issue… :slight_smile:

You should pass a culture to make it culture invariant.

float.Parse(floatString, CultureInfo.InvariantCulture);

Setting the grouping symbol to comma as well did the trick though :slight_smile:

I tried to confirm the problem with OpenAL, so I uninstalled it, rebooted and launched the game and it didn’t work as expected. I then reinstalled it, rebooted my laptop and launched the game, but it’s now crashing again when I hover over the menu buttons :frowning:

The first issue I had is not with OpenAL but with the culture as well it seems. The installer changed the settings to use a comma instead of a dot as a seperator, maybe it looks at local culture? So changing the volume in game writes the value with the correct separator in the settings file and fixed the issue.

With the right parsing the game feels and looks a lot better! Visibility is still a bit annoying in some levels, but very nicely done overall :slight_smile:

I might be on the wrong track how you are doing things, but perhaps you could store the volume in the .txt file as 0-100 representing percent.

Then in code divide by 100 to get a float 0.0-1.0

Avoiding the issue is not the correct way to go about it.

Always use CultureInfo.InvariantCulture when writing and reading configuration or data files as text.

would it be a good idea to avoid punctuation/culturally stuff in config files anyway?

Normally you see in game configs they are flags 0/1 or enums/ints 0/1/2/3 etc.

So ultimately whats happening? He is saving as plain text a float value and some computers store/read that as 0,5 or 0.5 etc?


ok! Its fixed! I passed invariantculure on all my streamreaders, and will proceed to re-upload my game ASAP.
Very good to learn about the whole CultureInfo overload.

Thanks for every ones efforts, this has been a great bug-hunt. I certainly learned things!

-And yes, I tested it to work no matter if I set to Euro or US standards… GREAT!

Just to be clear: When you play the game now, it resembles the pictures I posted, but you still have some critique of the balls visibility?

It’s not some computers, but a locale. InvariantCulture uses a period for a decimal separator, no thousands separators, no matter where in the world you are and what regional settings you have chosen. The default behaviour of text readers and writers is to use CurrentCulture which reflects your chosen regional settings. These vary around the world, e.g. many European countries use a comma as a decimal separator and some use a period as a thousands separator. If a text file is written in one locale and read in another using CurrentCulture, you may get exceptions thrown because it cannot understand the floating point format. Using InvariantCulture ensures that text written in one locale and read in another will always work.

OK understood.

I guess he is writing the float directly to txt so something like ToString() happens and it is written with cultural separators.

Is that a way of looking at it?

yeah, so for example the text file would store
volume = 0,7
but the streamreader would disregard the comma, and read it as 7…

-That caused glitches for things like scales and alpha-values, but it caused outright crashes with sound effects volumes, which cannot exceed 1.

It would cause a FormatException because parsing a float in a US, UK, AU or other cultures expects a single period as the decimal separator, but it finds a comma.

Your installer link is dead :grin:

When I played it with the correct separator settings, I still thought it was sometimes hard to see, yes. I think I would prefer the paddle a little bit higher too, it is really close to the bottom of the screen.

holy sh*t snacks, all the trouble all the time, its funny… So my share-service took a dump, re-uploading… Done…

Bigger paddle, too near bottom, ball hard to see… Visibility issues, on it!

How about this draft? Each ball would get a halo, that is drawn on top of everything… This halo fades in and out of existence as things become cluttered… The paddle would also get a brighter finish and an eye catching halo…

See the difference?
----------------------------------------- BEFORE and AFTER…

I got results a lot better than this pic, but I didn’t want to make another montage.

Ball and paddle are more visible, and look better than before, so following up on this critique has been pretty good…!

Updated game upload is on the way now, will update main post within minutes.

1 Like