|
Hello, Part 3 in my series of game dev improvement questionaire so my question is what did you have to change and did you use crossplatform solutions and if not, how would you go about handling stdstrings and utf-8 for string handling and file management? assuming you use stl of course... thats what i do. |
Submitted by SolidBenny
Fri, 05/22/2009 - 21:58
|

i know hobbe pretty recently converted twtpb to unicode. i was thinking of doing the same before going too far with ansi again. i found this cheat sheet 
I went for a quick and dirty
I went for a quick and dirty solution, and only translated strings that actually where actually needed. That is the strings visible in the UI. I used std::wstring for this. Since my game have full control over the files read/written there was no need for me to do some full conversion.
I smell... some over engineering here
What we did on Ground Control 2...
Similar to what hObbE is suggesting, on Ground Control 2 (www.massive.se) we only used UTF-8 for the strings that were visible, i.e. we used multibyte for the rest of the codebase.
We probably even had a custom string class that used unsigned short instead of char too...
/johno
"you can't stop the change"
heh i didnt know how deep to
heh i didnt know how deep to go so its good i asked then. so to sum up i can continue with the codebase i have but for UI strings i can load the strings from a utf-8 file and load them into wstrings and use them when i display the text with a font class that can use wstrings. that way i dont have to convert the rest of the project.
---------------
Solid Core Entertainment
Developer of Roadclub
this looks promising. i'm
this looks promising. i'm noting it here for future reference. http://utfcpp.sourceforge.net/
---------------
Solid Core Entertainment
Developer of Roadclub
In T.W.T.P.B. I also made
In T.W.T.P.B. I also made another simplification; all strings are just present in a language specific header file, that is not read from a file. Building for different languages then only became the simple matter of including the right header.
that would mean different
that would mean different exes for different languages and no ingame language setting. i guess thats ok though.
---------------
Solid Core Entertainment
Developer of Roadclub
exactly, and that was the
exactly, and that was the case of T.W.T.P.B. with a separate polish version.
Also I guess it would be no problem making a simple interface and have dynamic languages. The obvius advantage above havng stuff in a file is that you can get the compiler to tell you if you missed something.
Imho getting a compiler error for stuff is a huge advantage.
i totally agree. i'd rather
i totally agree. i'd rather have a list of errors instead of hidden bugs. i've spent way too much time debugging things in the past. i'm using exceptions in the next game instead of if(X == NULL) checks everywhere
I always thought exceptions was a pain cluttering up the code but if you use it in the right places and place a catcher on top instead of everywhere you get more solid debug information without too much hassle.
---------------
Solid Core Entertainment
Developer of Roadclub
cool! The only problem I
cool! The only problem I have with exceptions are that they are not mandatory so I tend to forget them
Automatic Unit testing is another path to try out that can prove very beneficial in finding errors.
it does work better in
it does work better in certain industrial applications and the like than in games though. you need to have clear and simple tasks with an expected value as a result.
---------------
Solid Core Entertainment
Developer of Roadclub
Post new comment