News:

11 March 2016 - Forum Rules

Main Menu

Help needed with font hacking!

Started by Hikarun, January 12, 2017, 06:22:20 PM

Previous topic - Next topic

Hikarun

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.

yugisokubodai

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

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

Quote from: yugisokubodai 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...

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.

Quote from: USC 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.

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

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

Quote from: SunGodPortal 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.

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

not sure it works but have you tried non-square tiles?
(Marmalade Boy, huh? is that any good?)

Hikarun

Quote from: BlackDog61 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?)

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

Quote from: Hikarun on January 13, 2017, 09:16:36 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

Quote from: BlackDog61 on January 13, 2017, 11:51:50 PM
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

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

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


SunGodPortal

Quote from: mrrichard999 on January 14, 2017, 11:51:13 AMThat looks horrifying...

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

denim

#14
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...


Hikarun

Quote from: KingMike 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. :(
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... :/

Quote from: mrrichard999 on January 14, 2017, 11:51:13 AM
That looks horrifying...

:laugh:

Quote from: denim 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...



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

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

Quote from: Hikarun on January 15, 2017, 03:25:56 PM
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

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

Quote from: denim 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:



Quote from: BlackDog61 on January 16, 2017, 03:16:11 AM
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.

Quote from: yugisokubodai 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

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