Jump to content


Photo

Japanese Text Support


  • Please log in to reply
29 replies to this topic

#21 GearGOD

GearGOD

    Deus Verus

  • GMC Member
  • 2153 posts

Posted 09 October 2010 - 02:18 AM

Performance reasons, maybe, or the ability to ensure the font travels with the game.

Yes, mainly perf reasons. First and foremost, rendering anything in software and then putting it in a 3d scene requires constant VRAM access which in turn causes constant pipeline stalls. Secondly things get weird when you use native windows font rendering because of antialiasing and sub-pixel smoothing, accessibility, DPI scaling, etc.
  • 0

#22 Grouchy

Grouchy

    GMC Member

  • New Member
  • 3 posts

Posted 17 October 2010 - 11:55 PM

I don't think a lack of built-in Kanji support would be a show-stopper for Japanese game authors. Having the whole GM UI support unicode so GM is translated into Japanese and the user can put Japanese names for their objects and rooms and sprites and making the GML editor support Unicode again would probably do the trick. If all that was done, people would be able to jury-rig kanji solutions such as the .net program mentioned above that can generate GML for displaying kanji.

As far as current Japanese support: Many games don't really need full kanji support. Only super text-intensive games like RPGs would need more than a few screenfuls of text. For the rest, saving those few screens full of text and onscreen bits of text like "Score", "Lives", "Hospital", etc as images will probably work just fine. A high scores list might be tougher, but a Kana solution would be OK since thats what most current games do. So, before you try to implement full kanji support make sure you really really do need it. Unfortunately I will need it for my game.

~~~ KANJI SPRITES ~~~

I made a quick test program in game maker that can randomly diplay any of 2048 kanji. It displays a whole screen full of them and each one randomly changes to another kanji every step at 712 frames per second. The whole thing took me about 20 minutes to write.

First I got a Heisig kanji list off the internet and pasted it into Babel Pad (substitute whatever unicode editor you prefer). I broke the list into lines of 16 characters each. Then I opened up the GIMP graphics editor, made a new image that is 56*16 wide by 56*128 tall (56 is the dimensions in pixels of a single square kanji sprite). I made my GIMP grid have 56x56 dimensions and turned on snap to grid. I drew 8 adjacent text boxes that filled the whole image in 16x16 sections. For the font I picked a square monospaced font that had all the kanji (MS PMincho). I changed the font size to 56 pixels and turned off hinting and antialiasing. I pasted 16-row sections of the kanji list from Babel Pad into each of the 8 text boxes. At that point I had the entire kanji list in 56x56 pixel squares in an image. I saved it as a PNG.

I opened up Game Maker and created a sprite. I clicked edit sprite, picked create from strip, found my PNG image, said 2048 (the number of kanji I had) for the number of images, 16 for images per row, 56 for image width and image height, and clicked OK. It thought for a minute and succeeded in making a kanji sprite with 2048 sub-images. Then I made an object for the kanji sprite. On create I set image_speed to 0. On step I set image_index to random(2048). I made a room with n by n grid, filled the room with kanji objects, set room speed to 712, showed FPS in the title bar, and clicked run.

The bottom line is, at least for my purposes on my machine, so far displaying Kanji is working fine.

Edited by Grouchy, 18 October 2010 - 12:01 AM.

  • 0

#23 Smarty

Smarty

    GMC Member

  • Retired Staff
  • 7262 posts
  • Version:GM:Studio

Posted 19 October 2010 - 11:59 AM

The bottom line is, at least for my purposes on my machine, so far displaying Kanji is working fine.

Yes, you're fine if you stick to the trivial part. But you're not displaying Japanese yet, you're just displaying random subimages of a sprite. This isn't the challenge.

Now take a Japanese text and properly display that text in Game Maker using your custom bitmap font implementation, and then you'll find out where the problem is: Game Maker can't handle Unicode texts. If you want to create a solution in GML only, the best option you have is reading a Unicode text-file byte by byte and map the Unicode characters you get from there to the sub-images in your bitmap font. That is, if you know how they should be mapped at all.

I should also note that you have already spent anywhere between 24 to 32 MB of texture data, depending on how Game Maker stores its subimages. Using bitmapped fonts is fine for character sets that fit in the ASCII range, but is rather heavy on your memory resources for a fair few of the Eastern languages.

Edited by Smarty, 19 October 2010 - 12:02 PM.

  • 0

#24 Grouchy

Grouchy

    GMC Member

  • New Member
  • 3 posts

Posted 20 October 2010 - 08:16 PM

Yes, you're fine if you stick to the trivial part. But you're not displaying Japanese yet, you're just displaying random subimages of a sprite. This isn't the challenge.

Now take a Japanese text and properly display that text in Game Maker using your custom bitmap font implementation, and then you'll find out where the problem is: Game Maker can't handle Unicode texts. If you want to create a solution in GML only, the best option you have is reading a Unicode text-file byte by byte and map the Unicode characters you get from there to the sub-images in your bitmap font. That is, if you know how they should be mapped at all.

I should also note that you have already spent anywhere between 24 to 32 MB of texture data, depending on how Game Maker stores its subimages. Using bitmapped fonts is fine for character sets that fit in the ASCII range, but is rather heavy on your memory resources for a fair few of the Eastern languages.


In other programming languages at least parsing unicode and mapping it to image indexes isn't very hard. I should mention that someone in this thread has already posted a link to a program that does that. I don't need to read unicode for my game or I would write you an app.

I'm a bit concerned that a 500kb image showing 2048 kanji would turn into 24-32 MB worth of texture data. Is there a way I can verify what you are telling me?

~~~~~~~~~~~~~~~~~

Edit:

OK I did some research into this texture data thing. Game maker says exactly what Smarty did right there at the bottom of the edit sprite window, 24MB. :( Game maker compresses the image when you save the program, but it must uncompress it when it runs. A 56x56 pixel font size is EXTREMELY huge though so you can easily make your kanji sprites take up 1/12 as much space by going with a normal 16x16 pixel screen font instead of 56x56. :)

I ran some more tests too. I ran EVGA Precision on a blank game and the blank game used the same amount of video memory as the kanji test. Then I looked at regular RAM (not video ram) usage. The blank took up 11MB, the kanji test took up 71MB. Just for fun I added another 36MB sprite data and ram usage went up to 170MB. Does this mean sprites are constantly swapping from ram into the video card, and if so maybe those pipeline stalls GearGOD was talking about are happening anyway?

I still don't know what I'm talking about and I doubt this all would help anybody besides clueless old me know what's going on in there but I figured I'd try to answer my own question since nobody else wanted to.

Edited by Grouchy, 23 October 2010 - 03:35 AM.

  • 0

#25 Agamer

Agamer

    GMC Member

  • GMC Member
  • 152 posts

Posted 12 January 2012 - 09:01 PM

OK, so, has anyone here heard of the Dzongkha language, or Bhutanian? It consists of special unicode characters that can actually stack on top of each other. THAT cannot be duplicated in Game Maker with any ease at all, especially since the stacking is more complex and actually linked in a unique manner for certain characters. I have Game Maker 8.1 and was wondering, if it says it has "basic multi-language support", does it support this kind of language? And what is a character set anyway? I looked through the different ones, and they only show normal letters. I even used Microsoft Himalaya, a font which I am very sure contains the actual Dzongkhan alphabet. Then I tried copying the unicode alphabet as text, but when I drew it, it drew as question marks, the generic translation of unknown unicode characters into standard ASCII. And for the "SYMBOL" option in the font's character set, this just appeared as the question mark character would appear in that font.
Again, is there any possible way of getting these characters into Game Maker 8.1?

ཉ ཊ ཋ ཌ ཌྷ ཎ ཏ ཐ ད དྷ ན པ ཕ བ བྷ མ ཙ ཚ ཛ ཛྷ ཝ ཞ ཟ འ ཡ ར ལ ཤ ཥ ས ཧ ཨ ཀྵ ཪ
ྐ ྑ ྒ ྒྷ ྔ ྕ ྖ ྗ ྙ ྚ ྛ ྜ ྜྷ ྞ ྟ ྠ ྡ ྡྷ ྣ ྤ ྥ ྦ ྦྷ ྨ ྩ ྪ ྫ ྫྷ ྭ ྮ ྯ ྰ ྱ ྲ ླ ྴ ྵ ྶ ྷ ྸ ྐྵ ྺ ྻ ྼ


Note this second set; the loops on top of each one is where another symbol can fit. Even three or more of these characters can be stacked beneath one of the characters in the previous set.

Edited by Agamer, 12 January 2012 - 09:01 PM.

  • 0

#26 scurvycapn

scurvycapn

    GMC Member

  • GMC Member
  • 172 posts
  • Version:GM:Studio

Posted 13 January 2012 - 07:35 PM

One of Mike's blog posts from about a year ago mentions looking to add unicode support. So maybe in 9.0...

Unicode is a long term goal for Game Maker, but I think it may well be too painful for 8.x.


http://dailly.blogspot.com/2011/01/reading-gm-suggestions.html
  • 0

#27 PhiL Blunt

PhiL Blunt

    GMC Member

  • New Member
  • 112 posts
  • Version:GM:Studio

Posted 15 January 2012 - 06:40 PM

I have had Japanese characters working in 8.1 & HTML5 (haven't tried GM8), I even made an extension: S.L.U.T (simple localised universal text), this was mainly for GUI.
You need to have the languages installed on your machine other wise you will get the unknown character square.
  • 1

#28 daman123125

daman123125

    AZN Game Programmer

  • GMC Member
  • 1956 posts
  • Version:GM8

Posted 15 January 2012 - 08:13 PM

I have had Japanese characters working in 8.1 & HTML5 (haven't tried GM8), I even made an extension: S.L.U.T (simple localised universal text), this was mainly for GUI.
You need to have the languages installed on your machine other wise you will get the unknown character square.

I checked out the extension in your blog; it's a pretty interesting concept. I suppose having the full vocabulary of language able to translate between just all 7 of those languages would be a feat, though.
And there's still the problem of Japanese having several thousand kanji characters that are commonly used, aside from the basic hiragana and katakana. Adding Japanese support to the extension would no doubt increase the memory of a game quite a bit.
  • 0

#29 masterofhisowndomain

masterofhisowndomain

    The Designer

  • GMC Member
  • 3649 posts
  • Version:GM8.1

Posted 15 January 2012 - 09:10 PM


This doesn't seem like something that helps many users. I'm not saying its a bad thing, just that it doesn't seem that useful to lots of users.

Not useful to a lot of users? There are 127 million people living in video game country Japan!

It's not just support for Japanese we need, but support for Unicode. This would open the door to character sets in any language. You're basically ruling out pretty much all of Asia by saying it shouldn't be a priority.

But most Chinese and Japanese, especially given those that GM is aimed at are young and ambitious, already know English (unlike vice versa) - it's probably not as prohibitive for them to not be able to write in their native language as it may appear. I'm all for other languages being supported, but while there are still performance issues with GM, whose improvement benefits everyone, I think that should be the priority.

EDIT: Realise Chinese not actually mentioned, but retained for argument's sake... :P

Edited by masterofhisowndomain, 15 January 2012 - 09:12 PM.

  • 0

#30 daman123125

daman123125

    AZN Game Programmer

  • GMC Member
  • 1956 posts
  • Version:GM8

Posted 15 January 2012 - 10:30 PM



This doesn't seem like something that helps many users. I'm not saying its a bad thing, just that it doesn't seem that useful to lots of users.

Not useful to a lot of users? There are 127 million people living in video game country Japan!

It's not just support for Japanese we need, but support for Unicode. This would open the door to character sets in any language. You're basically ruling out pretty much all of Asia by saying it shouldn't be a priority.

But most Chinese and Japanese, especially given those that GM is aimed at are young and ambitious, already know English (unlike vice versa) - it's probably not as prohibitive for them to not be able to write in their native language as it may appear. I'm all for other languages being supported, but while there are still performance issues with GM, whose improvement benefits everyone, I think that should be the priority.

EDIT: Realise Chinese not actually mentioned, but retained for argument's sake... :P

Japanese culture(and probably other Asian cultures) doesn't necessarily translate well to English. For example, if you want to translate Onii-chan and Onii-san, both mean "Big brother", but the -chan honorific makes it a cute way of addressing your big brother, -san being more general. I doubt "Big brother" would make much of an impact on Japanese players.
Also, considering how Japan is pretty xenophobic, they generally wouldn't be compelled to make English games(big companies probably do, though not so much doujin devs AKA indie devs, which GM aims for).

Edited by daman123125, 15 January 2012 - 10:32 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users