News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Why do games have multiple text encodings?  (Read 1455 times)

filler

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 779
  • "WINNERS DON'T SELL REPROS"
    • View Profile
    • Filler's Translation Projects
Why do games have multiple text encodings?
« on: July 27, 2018, 05:34:57 am »
So I've been dumping more scripts recently and I started to wonder why some games have multiple text encodings. I assume for some reason it's easier, maybe some of the values used in the text encoding in one area are used for game logic in another or something, but I'm curious to know what others think. It seems kind of redundant to me.

Psyklax

  • Hero Member
  • *****
  • Posts: 716
    • View Profile
    • Psyklax Translations
Re: Why do games have multiple text encodings?
« Reply #1 on: July 27, 2018, 07:10:11 am »
If the game uses different fonts for example, I can see why they might do that. One could be only uppercase, one could be both. They could be in different parts of the memory space. There's a bunch of reasons, really. It's fiddly for a hacker but I imagine it makes little difference to the programmers.

Jorpho

  • Hero Member
  • *****
  • Posts: 3858
  • The cat screams with the voice of a man.
    • View Profile
Re: Why do games have multiple text encodings?
« Reply #2 on: July 27, 2018, 09:43:31 am »
Maybe different programmers worked on different parts of the code?

I suppose it could also conceivably serve as an easy means of deliberate obfuscation.
This depresses me. I feel like a goldfish right now...

FAST6191

  • Hero Member
  • *****
  • Posts: 2367
    • View Profile
Re: Why do games have multiple text encodings?
« Reply #3 on: July 27, 2018, 02:43:16 pm »
Different fonts (don't know why multiple characters would not be encoded for within the same one but hey), different concepts (menus, cutscenes, minigames...) made at different times or maybe even effectively being a minigame collection, different programmers doing different areas, code reuse from older games coming up short after a lot of other work was done and working, if an abstract approach (first character in script is first in encoding, most common first, most common in earlier version... you all know the drill there) was used by people responsible for putting together a different section, for memory/resources/compression reasons (more common I would imagine in systems with vastly limited tile memory that can't readily afford to stick hundreds of kanji, or even the full set of kana + punctuation, in memory), said memory reasons might also extend to characters dropped from an overall area as they were not needed then but brought back later, and possibly to frustrate hackers (though in most cases I would doubt it).

filler

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 779
  • "WINNERS DON'T SELL REPROS"
    • View Profile
    • Filler's Translation Projects
Re: Why do games have multiple text encodings?
« Reply #4 on: August 02, 2018, 07:40:51 am »
Thanks for these replies. I'm starting to get a clearer picture of why this kind of thing happens. The major ones pointed out here being memory space, and different parts worked on by different folks. Supper inadvertently added a piece of the puzzle when stating this in the recent readme for MKR, "So, short game? That means the programmers were probably lazy. That's bad, bad news if you're a hacker."

This was the main thing that had me confused. Every decent game that seems fun and had some effort put in is pretty easy to dump a script for, while every short, throwaway, licensed oddity is nail-bitingly difficult to make progress on. If you come around to the idea that the "better" games also had more time, money, and talent put into them the picture starts to become clearer. These multiple text encodings and such tend to show up on projects that were thrown together lazily, with tight budgets, and not a lot of organization. No wonder they're a pain. ::)

julayla

  • Full Member
  • ***
  • Posts: 143
    • View Profile
Re: Why do games have multiple text encodings?
« Reply #5 on: August 02, 2018, 11:05:50 am »
I know how that feels. It's hard to work on these.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6517
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Why do games have multiple text encodings?
« Reply #6 on: August 30, 2018, 11:00:42 pm »
There could be a number of reasons depending on the game code or design.
Different fonts, different graphics sets (especially like for example NES games which used CHR-ROM because it can do graphical effects that would be too slow with CHR-RAM: changing one register is a whole let less work than needing to load data into VRAM over the very limited vblank time :) ). Different areas might have different amounts of free space left.)

RPG Maker 2 has a lot more kanji in the large ("VWF") font than it does in the 8x8 font, which is probably why it only allows the full kanji set to be used for dialogue events. (though in that game's case, the good is that I found the bit that controls if the string printing routine allows the VWF to use the actual size or is forced to be padded to a fixed size, either 12 or 16 I forget at the moment. The bad being that by default it is set to fixed width. I'm feeling it could create a mess to make such a significant change to swap it to VWF by default. Not sure yet if it's better to do that or have to create additional bytecode patch routines to switch the VWF bit on for different strings.)

One example is when I did Akuma-kun. I recall I left the spell names in all caps due to the game using midframe CHR-ROM bankswaps to display different banks on different parts of the screen, which left only one of the font banks mapped in when it draws the menu part of the screen, and I was concerned about running out of tiles or something).

That reminds in this Galaxy Odyssey translation exactly why: I used compression on the dialogue text (where it was fine if it was slow since the game was only printing one character at a time anyways) but it was far too slow to be usable on the menu screen where the game expected to be able to draw all the text at once, and the graphics turned to a corrupt mess as a result.
"My watch says 30 chickens" Google, 2018