Users browsing this thread: 1 Guest(s)
Patch: Variable-Width Small Font for Longer Names

#1
Posts: 7
Threads: 1
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2020
Reputation: 0
Status
None
(Updated 1/15/2021)

Hi everyone,

Here's a patch I've been working on for a month or so. It replaces the small fixed-width font with a variable-width one, allowing the SNES version of the game to use the GBA names of enemies, items, spells, abilities, etc. It's compatible with, but doesn't require, the Ted Woolsey Uncensored Edition. Here are some screenshots with this patch on top of the Ted Woolsey Uncensored Edition:

[Image: CJIQY5v.png]
[Image: 7Ajsioe.png]
[Image: M8chBX6.png]
[Image: WDYsKXj.png]

The zip file contains two patches. Use ff6vwf.ips on top of the vanilla 1.0 ROM, or ff6twuevwf.ips on top of the Ted Woolsey Uncensored Edition.

Note that this should be considered alpha quality. Please feel free to report bugs.

Known issues:
  • Multi-targeting spells in the menu causes portraits to blink for a bit.
  • There is some minor glitchy text during the cutscenes in the Vargas fight.
  • Page up/page down in menus is slower than it could be.
  • The window closing animation during encounters can cause the wrong text to be displayed for a few frames.
  • Portraits blink when changing the order of party members in the menu.
I posted the source on GitHub: http://github.com/tachimarten/snes-vwf You'll need ca65 to assemble it.

Thanks for all the excellent info on the wiki, especially the disassemblies. It made this project much easier!


Attached Files
.zip  ff6vwf.zip (34.65 KB, 37 downloads)
  Find
Quote  
[-] The following 10 users say Thank You to tachiweasel for this post:
  • assassin (12-09-2020), DrakeyC (12-16-2020), Gi Nattak (12-09-2020), madsiur (12-09-2020), NPCnextdoor (12-09-2020), Rodimus Primal (01-21-2021), seibaby (12-09-2020), SilentEnigma (12-09-2020), SSJ Rick (12-16-2020), Warrax (12-17-2020)

#2
Posts: 173
Threads: 23
Thanks Received: 20
Thanks Given: 6
Joined: Feb 2016
Reputation: 8
Status
Enlight
Awesome work!
Can't wait to sink my teeth into this.

I recently began attempting a similar task (albeit way hackier... pre-rendered 2bpp strings), but have yet to really nail the DMA song & dance when battle is in progress (needed for items, spells, etc.)
So, hopefully I can learn a thing or two. Wink

(12-09-2020, 01:52 AM)tachiweasel Wrote: If I get time I might try using the variable-width font in more places, like item names. Or feel free to send patches Smile

The first thing may be to address the conflict you have with the big font (?), which I hope is not insurmountable.
A lot of other names (like items) frequently display alongside big font text within the field menu.

But that's the dream -- getting legit (or at least legit-looking) variable width font across the game.

My assumption has always been that doing true variable width font would be too slow for large amounts of menu text and would require the scrolling effect to work.
But I could be very wrong! Even typing that out felt overly pessimistic about the SNES. Can anyone weigh in?
Quote  

#3
Posts: 281
Threads: 18
Thanks Received: 12
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
Wow, impressive stuff. Holy grail level.
  Find
Quote  
[-] The following 1 user says Thank You to seibaby for this post:
  • tachiweasel (12-09-2020)

#4
Posts: 7
Threads: 1
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2020
Reputation: 0
Status
None
(12-09-2020, 05:52 PM)SilentEnigma Wrote: The first thing may be to address the conflict you have with the big font (?), which I hope is not insurmountable.
A lot of other names (like items) frequently display alongside big font text within the field menu.

I think the solution may be to cancel all my pending DMA requests when a text box opens. The problem is that my code will queue up DMA until it's confident FF6 isn't doing any DMA on a frame. This helps to avoid glitches from running out of VBLANK time, but it does mean that if FF6 starts hogging all the bandwidth over many frames my DMA might take so long to run it could be invalid by the time it gets to proceed.

There shouldn't be any reason why big VWF text would be inherently incompatible with small VWF text (after all, big text appears alongside my small VWF text when the game announces ability names in battle), but we'll have to ensure that the space in VRAM where we write the small VWF text to is free, of course.
  Find
Quote  

#5
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
this patch (and the user) came out of left field, and is impressive!

for extra credit, have you considered re-enabling the FF6j feature of providing enemy quantities alongside the names as a patch option?  you've certainly created the real estate for it (in most or all?) cases.
Quote  
[-] The following 1 user says Thank You to assassin for this post:
  • tachiweasel (12-09-2020)

#6
Posts: 7
Threads: 1
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2020
Reputation: 0
Status
None
OK, after another week of work I've landed the following additional alpha-quality, lightly-tested work in the GitHub repo:
  • The variable-width font is used for to display the long item and equipment names from GBA release in the Item menu, the Equip menu, the Relic menu, and shops.
  • Also, the VWF is used for long item names in the Item, Throw, and Tools menus during encounters.
  • The Colosseum menus now use the VWF for long enemy names and item names.
  • Gau's Rages use the variable-width font for the long enemy names, both during encounters and in the menus. Note that the Rage menu becomes single-column in order to save on VRAM space. (Don't worry, it's still double-column in encounters--the issue is theoretically fixable but would be a pain.)
  • Magitek abilities use a variable-width font to fit the GBA names in encounters.
  • Mog's Dances use a variable-width font to fit the GBA names, both in encounters and the menu.
  • Sabin's Blitzes use their GBA names in the menu. The code that displays the long names from Ted Woolsey Uncensored Edition was adapted to VWF.
  • The patch tries to be optionally compatible with the Ted Woolsey Uncensored Edition. If you want to combine the two patches, apply the variable-width patch after TWUE.
I think this covers most of the cases in which variable-width fonts help avoid abbreviation in Final Fantasy 6. (Of course, in the future they still might be nice to use, even when not needed, just for consistency's sake.) I haven't yet lengthened names of spells, Espers, and Strago's Lores because the TWUE patch already does the work necessary to make the GBA names fit. (Also, spells in particular would be difficult with the way the patch is set up because the spell list has a lot of text.)

Known issues:
  • Variable-width font names can take a few frames to update when a new menu appears. This is because the patch is conservative and would rather wait to update a name than risk running out of VBLANK time and corrupting the screen (I suspect this is the problem with Bisqwit's Chrono Trigger VWF patch on accurate emulators). FF6 tends to use a lot of VRAM bandwidth already and often times there isn't much available. Nevertheless I think this can eventually be improved quite a bit.
  • The scrollbar in Gau's Rage menu is jumpy and can fall off the screen.
I plan to spend some time tomorrow testing and hopefully fixing whatever issues I run into. If all goes well I'll post a new IPS patch afterward.
  Find
Quote  
[-] The following 4 users say Thank You to tachiweasel for this post:
  • madsiur (12-15-2020), seibaby (12-15-2020), SSJ Rick (12-16-2020), Warrax (12-20-2020)

#7
Posts: 7
Threads: 1
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2020
Reputation: 0
Status
None
Here are some screenshots of the current development branch. At this point, only a handful of fixed-width strings remain in the entire game. There are plenty of bugs to fix though Smile

https://imgur.com/a/olXgrDx

[Image: OsyFnay.png]
[Image: Q8F8Ek3.png]
[Image: WDYsKXj.png]
[Image: yb6YQDf.png]
  Find
Quote  
[-] The following 3 users say Thank You to tachiweasel for this post:
  • madsiur (12-22-2020), NPCnextdoor (12-23-2020), SilentEnigma (01-16-2021)

#8
Posts: 7
Threads: 1
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2020
Reputation: 0
Status
None
I've posted an update to the patch as an edit to the first post, possibly the final one for a while as I won't have as much time to work on it going forward. At this point, the patch completely removes the fixed-width font in favor of a variable-width font everywhere, except for numbers and the character naming menu. Enemies, items, spells, Espers, Bushido moves, Lores, Blitzes, Rages, and encounter commands all use their GBA names. The menus have also been fully retranslated to remove abbreviations.
  Find
Quote  
[-] The following 3 users say Thank You to tachiweasel for this post:
  • madsiur (01-16-2021), seibaby (01-16-2021), SilentEnigma (01-16-2021)

#9
Posts: 173
Threads: 23
Thanks Received: 20
Thanks Given: 6
Joined: Feb 2016
Reputation: 8
Status
Enlight
Hi tachiweasel, just took the new build for a spin. Once again, very admirable work. This could be a real game-changer in the long term.

A few more issues to note (some you may already know):
  • The text at the top and bottom of the pre- final battle menu is missing.
  • In the Lineup menu, if you open someone's status screen and then return, some of the text from the status screen "ic Evade Sp" gets thrown up into the top right corner.
  • Paging up/down in the field menu displays incorrect text for a few frames. It is not usually noticeable. But it does stick out when there are two columns, like the Magic menu, and when moving between the "Use" and "Key" screens of the Item menu. Question: Would there be enough VRAM space to have some kind of alternating buffer? (This would also apply to the glitched text when exiting out of battle submenus.)
  • Opening the spells list is a bit awkward. This could potentially be solvable as above.
  • GBA's text for the equipment details screen has "x can be equipped by:" ...and now you have the space for it, too Wink
  • For some equipment, the item's details screen has the first 8x8 pixel block of Terra's name missing. Weird.
  • In the battle magic menu, the cursor for the right column ought to be shifted 8 pixels to the right. (Did not find the relevant offset in my notes, unfortunately.)

(12-09-2020, 01:52 AM)tachiweasel Wrote: Known issues:
  • Multi-targeting spells in the menu causes portraits to blink for a bit.
  • There is some minor glitchy text during the cutscenes in the Vargas fight.
  • Page up/page down in menus is slower than it could be.
  • The window closing animation during encounters can cause the wrong text to be displayed for a few frames.
  • Portraits blink when changing the order of party members in the menu.

A few questions/comments:
  • I am surprised that the blinking portraits issue is a thing. None of the VRAM text graphics pool really need to be refreshed, right? I wonder if the game is rerunning that routine unnecessarily.
  • Have you had the chance to test other special battle scenes beyond the Vargas fight?
  • Overall, the load times are quite a bit better than I expected.
  • In spite of the complexity of the task and the remaining issues, the hack already feels well on its way toward stability.
  • The custom font is well designed on its own, but does feel out of place against the larger text and original window sizes. One solution, of course, is to reduce the size of the large font. But I wonder how the performance might be impacted by using a wider small font, something like FF2 Origins on PS1.
(01-15-2021, 07:23 PM)tachiweasel Wrote: I've posted an update to the patch as an edit to the first post, possibly the final one for a while as I won't have as much time to work on it going forward.

If you think you might end up stepping away permanently, would you be willing to publish any additional technical insight you have on the remaining issues?
I would definitely like to see this go prime time sooner or later, including if that means someone else picking it up someday.

Kudos!
Quote  

#10
Posts: 7
Threads: 1
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2020
Reputation: 0
Status
None
> In the Lineup menu, if you open someone's status screen and then return, some of the text from the status screen "ic Evade Sp" gets thrown up into the top right corner.

I think I didn't even realize there was a Lineup status screen. This probably just means there needs to be code added to redraw text that the status screen overwrote.

> Would there be enough VRAM space to have some kind of alternating buffer? (This would also apply to the glitched text when exiting out of battle submenus.)


I thought about that, but there isn't a lot of free VRAM. Page up/page down in field menus can be improved by bracketing the operations with a "transaction" (there are some examples of this in the existing code), which will make the code try to upload all the text over one frame instead of doing one line per frame as it usually does. Encounter submenus are trickier because there really isn't much VRAM available, and I was thinking the easiest thing to do may just be to blank each submenu before closing it.

> For some equipment, the item's details screen has the first 8x8 pixel block of Terra's name missing. Weird.

Probably a mistake in the static tile allocation of the text in that screen. That screen has to tightly pack the text in order to fit it all in the tile map.

> I am surprised that the blinking portraits issue is a thing. None of the VRAM text graphics pool really need to be refreshed, right? I wonder if the game is rerunning that routine unnecessarily.

I think that the game always redraws the portraits to handle the case in which one of the party members changed Imp status. It's unnecessary in most cases and could be patched out to improve things there. (The Lineup menu is even worse--the game redraws almost everything every frame and I have to add some workarounds to prevent flicker.)

> Have you had the chance to test other special battle scenes beyond the Vargas fight?

I've played the game up through the Cranes, and also lightly tested the Colosseum and Kefka.

> The custom font is well designed on its own, but does feel out of place against the larger text and original window sizes. One solution, of course, is to reduce the size of the large font. But I wonder how the performance might be impacted by using a wider small font, something like FF2 Origins on PS1.

The problem here wouldn't so much be performance as it would be running out of space in the tilemap. If you look at some of the menus, like Config, gear details, and party equipment overview, you can see I get close to running out of tiles on BG1/BG3. Not saying it can't be done, but there would need to be a lot of tilemap reshuffling and probably some abbreviation/rewording.
  Find
Quote  
[-] The following 1 user says Thank You to tachiweasel for this post:
  • SilentEnigma (01-24-2021)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite