Polishing


It was hard to achieve, but nonetheless - the game now is translated into two languages: English and Russian! As I feel that English is not my strength, some help with editing and correcting would be appreciated. 


Also, some polishing and bug fixing. Text in the game is multicolored now. You may say: "Hey, it's easy in any game engine!". I say: "Hey, I make my own!". 

Jeez. This is my first published game. Wow. It still doesn't have sounds, but this is the next step.

---

What was hard and what I've got so far:

- Supporting several languages is not easy. Especially when porting a game to other platforms. UTF-8, wide strings and such. The boost library is very helpful:

#include <boost/locale/encoding_utf.hpp>
using boost::locale::conv::utf_to_utf;
std::string wstring_to_utf8(const std::wstring& str) {
    return utf_to_utf<char>(str.c_str(), str.c_str() + str.size());
}
std::wstring utf8_to_wstring(const std::string& str) {
    return utf_to_utf<wchar_t>(str.c_str(), str.c_str() + str.size());
}

- Multicolored text may be very tricky. Now the strings in the localization table look like this: 

There was only one component to be mount - <name='comp'>%1</>. 
It lay somewhere on the <name='shelf'>shelf</>.

See these tags? The engine uses them to find where to place styles (only colors now, but who knows what will be added):

std::string random_comp_name = // get the component name
std::wstring first_hint =
  GenerateLocalizedStyledString("first_hint",
  {
    {"comp",  {hintColor1}},
    {"shelf", {hintColor2}}
  }, {utf8_to_wstring(random_comp_name)});

It searches string with key "first_hint" in the localization table (which is .csv file originally), finds substrings with names comp and shelf and replaces %1 with the name of the component. The string first_hint now is:

Dr.Hawkes almost finished his work on the time machine. 
There was only one component to be mount - <name='comp' color="0.2 0.6 0.9 1.0">vacuum triangulator</>.  
It lay somewhere on the <name='shelf' color="0.1 0.6 0.4 1.0">shelf</>

I know, it's like HTML. But it's not. 

After some very complicated things are done, the string is rendered as:


Files

DrHawkes_1.3.zip 1 MB
May 10, 2018
DrHawkes_1.3.app.zip 3 MB
May 10, 2018

Get Dr.Hawkes & His Faults

Leave a comment

Log in with itch.io to leave a comment.