Shift + £ causes crash

Issue: Pressing shift + £ in save game text field crashes game
Crash (y/n): y
Platform (Windows/Mac/Linux): windows
Description: When saving the game if you try and enter shift + £ (shift + 3) the game crashes with the error pictured.

¬ also crashes the game

I’ve received a crash log from you, which looks like it was for this crash. In it, the callstack shows that you’ve tried to save a save game with an empty filename, which the save game dialog apparently doesn’t currently check for. (I do check for it when you’re setting the name of a new MMORPG, but apparently I forgot to do so here). The “shift+3” thing is just entering an invalid filename character, which results in erasing the default filename, leaving you with an empty file name.

I believe that this bug is likely the same as this one; a single fix should fix both issues.

the crash log you received was my error as I accidentally saved without a name. these shift+3 doest create a crashlog

Whoah, interesting. It crashes without leaving a crash log? Definitely going to investigate this. Thanks for the report! :smiley:

Edit: Confirmed, it really does crash, and it really doesn’t leave a crash log! I didn’t even know that was possible! I’ve got some fun debugging in front of me! And it’s not just in the save box; anywhere where you can type, typing either of those two characters causes a crash. I presume it’s somewhere in the text drawing code…

haha opps sorry :stuck_out_tongue:

Im sure you’ll have fun tracking that one down

Figured it out, and have a fix which will be coming in the next build!

Also, I’ve gotten really good at switching my keyboard layout really quickly! :smiley:

The “crash without a crash log” turns out to be that the ‘crash’ was actually an exception being thrown by the Unicode library I’m using. Apparently my crash log generator doesn’t consider an uncaught exception to be a “crash”, so isn’t generating a crash log. I’ll fix that tomorrow.

The core issue that the Unicode library was complaining about is that when I rewrote bits of VectorStorm’s text handling systems during the Text Edit Widget rewrite, I broke our handling of Unicode text. I was accidentally putting raw Unicode code points onto the end of the string during text editing operations, instead of UTF-8-encoded text (MMORPG Tycoon 2 uses a UTF-8 text encoding internally). Now, for basic, standard ASCII text, the two are identical. But as you start moving into more complicated glyphs (such as £, or ¬), they begin to differ And my Unicode library was quite rightly pointing out that such strings weren’t legal UTF-8.

This fix was entirely inside the VectorStorm library, so anybody who’s interested in the gory technical details can look at the patch, linked below. (But honestly, it’s probably not of much interest to most folks; string encoding isn’t a particularly sexy topic at the best of times!)

…and this is why I don’t push changes out immediately. Today, I’ve discovered that ‘backspace’ handling was also breaking, if there was a non-ASCII character in the string. So that’s fixed as well.

And since I was in that code again today, I’ve also put in shift+left/right arrow key support to make selections, and have also added copy/cut/paste support. (control-c/x/v on Windows/Linux, ⌘-c/x/v on OSX)

And then, because I apparently don’t know when to stop, I added a simple ‘undo’ system. So… if your cool new idea for an MMORPG name doesn’t look as cool after you’ve typed it in, you can control-z your way back to undo your edits (⌘-z on OSX)

…this probably wasn’t the best use of my time, in retrospect. :cold_sweat: (still cool, though!)

1 Like