Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: FormosaFalanster on Wed 05/05/2021 10:05:50

Title: Are Chinese characters supported?
Post by: FormosaFalanster on Wed 05/05/2021 10:05:50
The next game I do, I want to translate it in several languages, including Chinese (traditionnal characters). How would that work though? Is that supported? Anyone has experience with writings that are not in latin alphabet?
Title: Re: Are Chinese characters supported?
Post by: heltenjon on Wed 05/05/2021 11:14:23
Falcon City (https://www.adventuregamestudio.co.uk/site/games/game/2452-falcon-city/) has Hakka-Chinese listed as one of the available languages.

Perhaps this thread (https://www.adventuregamestudio.co.uk/forums/index.php?topic=52207.msg636621960#msg636621960) may be of interest?
Title: Re: Are Chinese characters supported?
Post by: FormosaFalanster on Wed 05/05/2021 11:43:29
Quote from: heltenjon on Wed 05/05/2021 11:14:23
Falcon City (https://www.adventuregamestudio.co.uk/site/games/game/2452-falcon-city/) has Hakka-Chinese listed as one of the available languages.

Hakka uses Chinese characters like Mandarin so that could work. It's just a matter of, how does the fonts work, maybe?
Title: Re: Are Chinese characters supported?
Post by: Gilbert on Wed 05/05/2021 12:57:53
Unless it's changed recently, short answer is: No.

AFAIK the current engine doesn't have support for multibyte character codes, so it can display at most 256 different symbols from a font set, you cannot just type Chinese text directly and expect it to work, even though the font itself may contain Chinese characters.

Unless the game uses at most 256 characters (in that case you have to cramp all the required symbols into the basic slots of the font file), which is very unlikely, so you need to use workarounds, like prerender all the required text into sprites, or use a module to display the symbols from a bitmap, or use a plugin like the one heltenjon linked to.
Title: Re: Are Chinese characters supported?
Post by: eri0o on Wed 05/05/2021 13:09:07
The latest use of Chinese with AGS I remember was this: https://www.adventuregamestudio.co.uk/forums/index.php?topic=52207.msg636621960#msg636621960
Title: Re: Are Chinese characters supported?
Post by: Crimson Wizard on Wed 05/05/2021 15:10:44
AGS still does not, that is in plans to change, but still not at the moment.

There's a plugin that allows you to display UTF8 texts, linked above by heltenjon - that is the only known working solution.
It has certain limitations, because some algorithms still rely on the AGS engine. One noteable case is text wrapping: because the engine does not know about UTF-8 it may screw up the text when breaking it into lines. This is resolved by adding extra spaces between words to give it some anchors where splitting is safe (I was told that normally Chinese does not have spaces).
There's more about it in the plugin's thread.
It's probably also may be improved by writing custom speech system and/or expanding the plugin with more functions.
Title: Re: Are Chinese characters supported?
Post by: FormosaFalanster on Wed 05/05/2021 23:45:14
Okay, so if I understand well, it's possible but it's not straightforward!

Thanks guys, this is all I needed to know for the moment. The game is near completion so I was anticipating if it is even feasible at all. It seems it's worth translating it and then with a bit of work it can be put into the game.

So I may dedicate some time after the game is out to look into this other thread and the module, and as you said maybe work to improve it (which translates as: brace yourself for questions in the discord, but I promise I'll do my best alone).

I thought about pre-rendering the text in graphics and putting it in the game after. It's difficult especially with traditional Chinese because the characters are very intricate and that does not look good. In my previous game I tried to put an element of background with chinese writing on it and damn that was a headache.

But luckily, in this game I use custom GUIs all the time so it should help.

Anyway thanks, I'll keep you posted about the progress!