News: 11 March 2016 - Forum Rules

Author Topic: Help needed with font hacking!  (Read 10196 times)

Hikarun

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Help needed with font hacking!
« on: January 12, 2017, 06:22:20 pm »
Edit: I realize now that it's probably possible to unscramble these fonts aided by a debugging emulator. However, I can't erase my topic apparently...   :-[ Sorry for disturbing and I'll try it so please nvm. :thumbsup:



Hello, I'm a newbie so please forgive if my question sounds stupid... :)
I opened a rom and the font is scrambled:



I erased a few tiles and checked and it's indeed the font (and now the rom has a bad checksum obviously and freezes), so is it maybe compressed?

Thanks in advance.
« Last Edit: January 12, 2017, 06:47:47 pm by Hikarun »

yugisokubodai

  • Full Member
  • ***
  • Posts: 156
    • View Profile
    • Assembly
Re: Help needed with font hacking!
« Reply #1 on: January 12, 2017, 07:07:17 pm »
In my experience,this font is no compressed. But you did not choose the proper setting of the font viewer for it.
You can try changing the setting as: bpp, block size...

USC

  • Submission Reviewer
  • Sr. Member
  • *****
  • Posts: 347
  • Obviously Outdated
    • View Profile
Re: Help needed with font hacking!
« Reply #2 on: January 12, 2017, 07:32:54 pm »
Hmm. I opened it in Tile Molestor, set the rows to interleaved and the codec to 2BPP Planer. That's the clearest I could get (although it was tilted 90s - easiest to see with the large numbers:


There's probably a configuration that could do even better, but this might be helpful to you. I saw standard 4BPP images later in the ROM, so it's probably a space saving measure for the font since it includes Kanji as well.

Hikarun

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Help needed with font hacking!
« Reply #3 on: January 12, 2017, 09:16:42 pm »
In my experience,this font is no compressed. But you did not choose the proper setting of the font viewer for it.
You can try changing the setting as: bpp, block size...

I see thanks!  :woot!: I tried all settings on TLP and it didn't display properly, but I'll try to learn how to try it on Tile Molester since it rotates etc.

Hmm. I opened it in Tile Molestor, set the rows to interleaved and the codec to 2BPP Planer. That's the clearest I could get (although it was tilted 90s - easiest to see with the large numbers:


There's probably a configuration that could do even better, but this might be helpful to you. I saw standard 4BPP images later in the ROM, so it's probably a space saving measure for the font since it includes Kanji as well.

Woo, thanks!  ;D Probably since the rom has a lot of big character images. I can't figure how to edit it yet but maybe fiddling w the configs. Thanks! :)

SunGodPortal

  • Hero Member
  • *****
  • Posts: 2931
  • 2 + 2 = 5
    • View Profile
Re: Help needed with font hacking!
« Reply #4 on: January 13, 2017, 12:29:50 am »
Man, the font in this game is weird as hell. It appears to be in the ROM sideways or something. I didn't have any luck with YY-CHR (the program I normally use) so I busted out CrystalTile2. I kept fiddling with different settings and this was the best I could do. I included the settings in the screenshot to give you an idea of what might be close.



It still doesn't look right but it looks better than the screenshots above. I don't know about the other settings but I am fairly certain that this font is 1BPP. Based on in game screenshots I first assumed that the font was 16x16 but as weird as it still looks I almost wonder if different parts are different dimensions.
Cigarettes, ice-cream, figurines of the Virgin Mary...

Hikarun

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Help needed with font hacking!
« Reply #5 on: January 13, 2017, 11:12:03 am »
Man, the font in this game is weird as hell. It appears to be in the ROM sideways or something. I didn't have any luck with YY-CHR (the program I normally use) so I busted out CrystalTile2. I kept fiddling with different settings and this was the best I could do. I included the settings in the screenshot to give you an idea of what might be close.



It still doesn't look right but it looks better than the screenshots above. I don't know about the other settings but I am fairly certain that this font is 1BPP. Based on in game screenshots I first assumed that the font was 16x16 but as weird as it still looks I almost wonder if different parts are different dimensions.

Wow, thanks a lot bro all my gratitude. Editing is finally possible under these settings :crazy:
It's looking like a checkered board, the letters are ordered according to the tbl but the one in the middle is always split in two. Def a space saving measure if I had to guess since the rom is heavy on graphics. Never seen fonts ordered in a similar way so I was at a loss. I still can't figure the exact pattern but will try drawing it to illustrate later. Thanks again!  :woot!:

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Help needed with font hacking!
« Reply #6 on: January 13, 2017, 02:19:46 pm »
not sure it works but have you tried non-square tiles?
(Marmalade Boy, huh? is that any good?)

Hikarun

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Help needed with font hacking!
« Reply #7 on: January 13, 2017, 09:16:36 pm »
not sure it works but have you tried non-square tiles?
(Marmalade Boy, huh? is that any good?)

No I never heard of it and didn't find anything searching, fiddling with square patterns is not working either so can you give me a few pointers on what it is? Sorry, I really am a newbie :-\

Lol I didn't play more than a few minutes (started fiddling because it looked easy, go figure...) but it's based on a popular manga and is aesthetically pleasing, if nothing else.  :)

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Help needed with font hacking!
« Reply #8 on: January 13, 2017, 11:51:50 pm »
No I never heard of it and didn't find anything searching, fiddling with square patterns is not working either so can you give me a few pointers on what it is?
If you use TiledGGD, there's a "Linear" mode or a "Tiled" mode. ("Linear" means pixels are read from the file, and then put in full-image-width lines, like you usually do on a screen; as opposed to "Tiled", where pixels are put to fill one small rectangle on a grid, then another one, then another one.) Use "Tiled" and then Ctrl-T to change the tile width & height. They don't have to be equal, so you could use, say, 8*12 or whatever. (Sorry for pointing you to yet-another tool. It's the one I know best.)

SunGodPortal

  • Hero Member
  • *****
  • Posts: 2931
  • 2 + 2 = 5
    • View Profile
Re: Help needed with font hacking!
« Reply #9 on: January 14, 2017, 12:33:48 am »
If you use TiledGGD, there's a "Linear" mode or a "Tiled" mode. ("Linear" means pixels are read from the file, and then put in full-image-width lines, like you usually do on a screen; as opposed to "Tiled", where pixels are put to fill one small rectangle on a grid, then another one, then another one.) Use "Tiled" and then Ctrl-T to change the tile width & height. They don't have to be equal, so you could use, say, 8*12 or whatever. (Sorry for pointing you to yet-another tool. It's the one I know best.)

I don't know if it is equivalent but I tried many different widths in CrystalTile2. The closest fit I could find was 16x16 (from the screenshot above).

I'm gonna post another screenshot with most of the options turned off in case someone out there can make sense of this. I think the only thing selected was 1BPP mode with 16x16 tiles (otherwise nothing is recognizable).



The font looks like it's in the ROM sideways. And some of the characters aren't even the same size. This is a mess.
Cigarettes, ice-cream, figurines of the Virgin Mary...

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Help needed with font hacking!
« Reply #10 on: January 14, 2017, 04:45:58 am »
It looks marginally better starting at 2add6 (thus starting with comma, quote, ellipsis), but that doesn't really solve the whole thing... I don't get it either.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7183
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Help needed with font hacking!
« Reply #11 on: January 14, 2017, 11:50:18 am »
The only time I have ever seen a "sideways" font was in the two RPG Maker games, which had a VWF.
Even then, it is common for SNES games to use 12x12 fonts, which you can try all you like but you will never get to show up in a tile editor, because those aren't an even tile size (8x8 pixels).

You can try to edit the font as is, by carefully looking at each letter and finding matching parts.

But otherwise, you'd need to know ASM to use a debugger to find out how the font is stored exactly (as well as how width is determined if it is VWF) and then probably program something to rip and insert the font.
Not a beginner thing, to say. :(
"My watch says 30 chickens" Google, 2018

mrrichard999

  • Hero Member
  • *****
  • Posts: 686
  • So Goooood! :D
    • View Profile
    • GameFAQS Profile
Re: Help needed with font hacking!
« Reply #12 on: January 14, 2017, 11:51:13 am »
That looks horrifying...

SunGodPortal

  • Hero Member
  • *****
  • Posts: 2931
  • 2 + 2 = 5
    • View Profile
Re: Help needed with font hacking!
« Reply #13 on: January 14, 2017, 04:24:06 pm »
That looks horrifying...

Yeah, I'd suggest that Hikarun find another game.
Cigarettes, ice-cream, figurines of the Virgin Mary...

denim

  • Jr. Member
  • **
  • Posts: 19
    • View Profile
Re: Help needed with font hacking!
« Reply #14 on: January 15, 2017, 02:06:07 pm »
The font is compressed using a algorithm which removes the zeros from upper and bottom parts of each character, as a "trim". I think I saw something similar to this in the Der Langrisser's font.

With a small tool is possible to extract it and put it back...

« Last Edit: January 15, 2017, 02:19:13 pm by denim »

Hikarun

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Help needed with font hacking!
« Reply #15 on: January 15, 2017, 03:25:56 pm »
The only time I have ever seen a "sideways" font was in the two RPG Maker games, which had a VWF.
Even then, it is common for SNES games to use 12x12 fonts, which you can try all you like but you will never get to show up in a tile editor, because those aren't an even tile size (8x8 pixels).

You can try to edit the font as is, by carefully looking at each letter and finding matching parts.

But otherwise, you'd need to know ASM to use a debugger to find out how the font is stored exactly (as well as how width is determined if it is VWF) and then probably program something to rip and insert the font.
Not a beginner thing, to say. :(
Thanks for the insight but are VWF so difficult to be edited even on TiledBCG?
Doing it manually since yesterday but crystal tile 2 isn't being too efficient. I gotta learn to use it properly... :/

That looks horrifying...

 :laugh:

The font is compressed using a algorithm which removes the zeros from upper and bottom parts of each character, as a "trim". I think I saw something similar to this in the Der Langrisser's font.

With a small tool is possible to extract it and put it back...



Wow!  :o Nailed it, amazing. So it's compressed after all. Der Langrisser, huh? Is this tool widely available or did you create it? I'm no programmer so not sure if I can do it but I'll try looking into it... :-X

denim

  • Jr. Member
  • **
  • Posts: 19
    • View Profile
Re: Help needed with font hacking!
« Reply #16 on: January 15, 2017, 08:02:10 pm »
Der Langrisser is a japanese snes game with no offcial english release.

I created a small program for un-compress and compress the font of this game. I can send it for you, if you are really willing to translate this game.

Just to test my code,  I changed one character for a letter "A". Here it is how it is shown in game:


BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Help needed with font hacking!
« Reply #17 on: January 16, 2017, 03:16:11 am »
Thanks for the insight but are VWF so difficult to be edited even on TiledBCG?
Doing it manually since yesterday but crystal tile 2 isn't being too efficient. I gotta learn to use it properly... :/
VWF requires assembly code (unless the original game already had VWF support but forgot to activate it, which I'd assume is unlikely).
Look for "vwf" and "variable width" for some good posts on the RHDN forums.
I think it was roughly graded "medium difficulty" (which means you have to be able to learn seriously if you're a beginner, but you can succeed if you give it significant time and will.) It'd be fun to have a "difficulty guessing scale" shared somewhere on this site.

yugisokubodai

  • Full Member
  • ***
  • Posts: 156
    • View Profile
    • Assembly
Re: Help needed with font hacking!
« Reply #18 on: January 16, 2017, 10:12:33 am »
I translated Ghost Chaser Densei and Dragon Ball Z Butouden 3. These 2 games use compressed font.
It's better to decompress the font, edit it and compress then put it back to the Rom.

But if you don't want to deal with compression, you can do as what I did with these 2 games:

- Find the font in Vram. In Vram everything is uncompressed.
- Extract the font in Vram.
- Edit it.
- Now store the new font somewhere in your Rom.
- Find the routine that read the original compressed font.
- Make that routine to read from your new font.
- Enjoy.

https://www.youtube.com/watch?v=rd02eDOsURA

Hikarun

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Help needed with font hacking!
« Reply #19 on: January 16, 2017, 11:47:57 am »
Der Langrisser is a japanese snes game with no offcial english release.

I created a small program for un-compress and compress the font of this game. I can send it for you, if you are really willing to translate this game.

Just to test my code,  I changed one character for a letter "A". Here it is how it is shown in game:



VWF requires assembly code (unless the original game already had VWF support but forgot to activate it, which I'd assume is unlikely).
Look for "vwf" and "variable width" for some good posts on the RHDN forums.
I think it was roughly graded "medium difficulty" (which means you have to be able to learn seriously if you're a beginner, but you can succeed if you give it significant time and will.) It'd be fun to have a "difficulty guessing scale" shared somewhere on this site.

I translated Ghost Chaser Densei and Dragon Ball Z Butouden 3. These 2 games use compressed font.
It's better to decompress the font, edit it and compress then put it back to the Rom.

But if you don't want to deal with compression, you can do as what I did with these 2 games:

- Find the font in Vram. In Vram everything is uncompressed.
- Extract the font in Vram.
- Edit it.
- Now store the new font somewhere in your Rom.
- Find the routine that read the original compressed font.
- Make that routine to read from your new font.
- Enjoy.

https://www.youtube.com/watch?v=rd02eDOsURA

I see, thanks everybody for all the help and insight :D I was just fiddling with the rom so I guess I'll just find another one to fiddle with. I want to study programming to uncompress fonts, but rn it just sounds a lot of work and I'm still trying to get the sense of rom hacking, so I hope to get back to it when I can spare time...  :-\ Hopefully this topic should help someone else. :D