• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 29, 2024, 03:46:59 am

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


How to change the width of the space character in PSX (Solved)

Started by Gravrain, September 19, 2021, 01:04:35 am

Gravrain

Hey everyone! Long-time lurker here.

I'm currently working on an improvement patch for the PSX version of FFT, and was recently experimenting with the font. I was curious if I could get it to match the WotL font, which has some slightly different glyphs and spacing. Everything was going well until I realized that I didn't know how to change the width of the space (" ") glyph. I expected that it would be in the character set (detailed here), but I only found what I suspect is the {SP} glyph -- ID DA73h. I've combed the wiki and the forums for any information on this, but I haven't been able to find where the space glyph is stored. Any help would be appreciated! (Apologies if I missed something obvious -- I'm still relatively new at modding.)
  • Modding version: PSX

Xifanie

I'm not convinced that it's different for WotL, but here you go:

WORLD.BIN
Memory: 0x800FEB0C
File: -0xE0000

BATTLE.BIN
Memory: 0x8014B614
File: -0x67000

It's hardcoded just for this character only.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Gravrain

Thanks so much for your help -- I'd expect nothing less from the ASM master herself!

Your offsets seem to be correct, based on my initial testing. And just to prove that I'm not crazy, I've attached three screenshots that show the difference between the font of the PSP and PSX versions. They all display the exact same text from the Squire's "Rush" skill; the first from the PSP (WotL) version of the game:
Space (PSP).png
The second from the PSX (FFT: Complete v0.50) version of the game:
Space (PSX Before).png
And the third from the PSX (FFT: Complete v0.50 + your patch) version of the game:
Space (PSX After).png
I've color-coded the pixels to show that by changing the bytes that you referenced from 04h to 03h, I'm able to change the width of the PSX space character from 4 to 3 pixels wide.

Thank you again, as you've helped me immensely in my patch creation process. I should be able to fit much more text into the game because of this!
  • Modding version: PSX

Xifanie

Oh wow, huh. You're welcome!

I wouldn't get too excited about fitting a lot more text though. You can almost always just create new pages (with enough {Newline}s) and then there's the compression and DTE that need to be taken into account with Tactext. Saving 1px per space is ultimately insignificant in your ability to add more text, I'm afraid.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Nyzer

Yeah, I have to agree with Xifanie. The {SP} character is already half the width of the space character - it isn't pixel width that's the issue when it comes to Tactext or event space.
  • Modding version: Other/Unknown

Gravrain

I realize that changing the width doesn't affect the space available for text in the files, but it does increase the amount of text that can be fit on a single page. Like Xif mentioned, this doesn't matter most of the time, as new pages can just be added where necessary. However, for some text boxes (e.g. Errand Completion Notes, Propositions, and a few more that I can't remember right now), adding new pages causes some buggy behavior, effectively putting a hard cap on the amount of text that they can hold.

For some context, one of the goals of my (experimental) patch is to cram as of the WotL localization as I can into the PSX game (I know, I know -- what an original idea). Previous attempts like FFT: Complete have had to settle for significant cuts because of this limitation, not to mention having to check and reformat virtually every text box in the game to accommodate the different font and spacing. But having spent the last week messing around with the new font, it's made the porting process way easier -- just copy and paste, and that's it! No more worrying about page limitations, font differences, reformatting, etc. As a result, I've managed to port almost all of the WotL text with minimal cuts. I've even customized FFTacText to display the correct line widths and use the new space width when generating the DTE.

There are some bugs that still need ironing out, though; sometimes the text-printing routine starts printing garbage when it encounters a glyph with an odd width, but then it fixes itself as soon as it encounters another (it's expecting even byte offsets? IDK). Dialogue boxes also seem to use a different hardcoded space as well, since they've remained unchanged in my tests. But overall it's been promising.

I'm currently trying to figure out how the text-printing routines in BATTLE.BIN and WORLD.BIN work so I can address some of these issues. If you have any tips, I'm all ears!
  • Modding version: PSX

nitwit


RetroTypes

Quote from: Gravrain on September 28, 2021, 04:19:31 pmone of the goals of my (experimental) patch is to cram as of the WotL localization as I can into the PSX game

Not that I want to discourage you from your project, but Elric is planning to release TLWotL soon, which is TLW (almost all WotL content put into the psx version) with WotL text in most (all?) places. With TLW 2.02 and those resources having been released, TLWotL will probably come out within a week or two, and will be exactly what you're aiming for.
  • Modding version: PSX
  • Discord username: RetroTypes

3lric

Quote from: RetroTypes on October 01, 2021, 02:36:25 pmNot that I want to discourage you from your project, but Elric is planning to release TLWotL soon, which is TLW (almost all WotL content put into the psx version) with WotL text in most (all?) places. With TLW 2.02 and those resources having been released, TLWotL will probably come out within a week or two, and will be exactly what you're aiming for.

I agree. I mean by all means, if you want the challenge then go for it. But your goal has already been accomplished. ALL the PSP content barring Onion Knight, and the extra items, are in TLW. Including Rendezvous in single player fashion. All the scenes, Dark Knight and everything else are already there. And TLWotL (the version with the PSP tranlation :puke:) will be following shortly. All of tactext is already just about complete, as well as ASM hacks for the zodiac calendar, and many other ASMs to make the PSX version conform to the PSP versions dialogue types and sizes. The entirety of all events have already had their condensing on the backend, as well as all dialogue replaced to the PSP version as well, only testing really remains... TLW also adda new game + and a custom made treasure wheel for the rendezvous missions.

This is also a base patch with a absolute TON of optimization and consolidation on the back end for other modders to utilize. If I'd had known what you were doing, sooner, I'd have mentioned something... I just assumed everyone on this site already knew about TLW, as it's existed in a older state for a few years, and there have also been news posts about it on the site.

You can see the info about it here, since I guess you hadn't already
https://ffhacktics.com/smf/index.php?topic=12767.0
  • Modding version: PSX

Gravrain

October 12, 2021, 06:20:41 pm #9 Last Edit: October 13, 2021, 01:03:49 am by Gravrain Reason: Add link
Sorry for the delayed response, I haven't had a lot of free time lately.

I've been aware of TLW for quite a while (the new version looks great!), but I hadn't heard of TLWotL before. You're right that it'll probably do everything I'm trying to do in my patch, and better. I guess you could consider my patch a personal challenge; I've been working on it over the last year or so for my own use, and as a way to learn about hex editing, ASM, and hacking in general, since I'd never delved that deep into it before. Then I recently got the idea to release it, which encouraged me to remake and improve it, leading to this font-editing experiment.

The patch is actually ~95% complete at this point. It's modular, with a ton of optional features, and once I iron out the text-related bugs I'll just need to finish the documentation and testing. I think at this point I'll just make a WIP thread and link it here later for anyone who cares to check it out.

EDIT: Here's a link to the patch's WIP topic. If anyone can help with the remaining bugs, I'd really appreciate it!

https://ffhacktics.com/smf/index.php?topic=12794
  • Modding version: PSX