Romhacking.net

Romhacking => Personal Projects => Topic started by: Gemini on November 24, 2017, 10:04:10 pm

Title: Final Fantasy IV Prettified
Post by: Gemini on November 24, 2017, 10:04:10 pm
It's about time I stop spamming this into the screenshots thread and move it to a separate discussion. So, what is FF4 Prettified? Like the name suggests, it's an embellished version of Final Fantasy IV with full proportional font (VWF) implemented to make it more pleasing to the eye.

The idea behind this hack comes from some old tutorial byuu published years ago on his website (which can be currently found here (http://romhacking.it/doc/view/id/55)) involving prerendered tiles and DMA transfers to avoid actually drawing anything other than pre-built sets of tiles for almost everything. This handy trick allows proportional fonts with almost no lag whatsoever and it can be applied pretty much to any game in need.

Most of the text used in this hack is either lifted from FFIV: Complete Collection, tweaked from there, or quickly translated from the original messages. So, in a manner of speaking, it can't be considered a real retranslation, even if it's based on a vanilla ROM of Final Fantasy IV (J). I'm not sure myself if this should be posted, when completed, to the hack section or as a translation; feedback on this would be appreciated. :P

The project is completely open source and can be modified by anyone who would like to either improve it or use it for a derivative translation / hack. You can find sources compatible with xkas plus here: https://github.com/Gemini-Loboto3/prettify

For the moment it covers mostly in-game menus, shops, and Namingway screens, but I'm planning on expanding it to dialog and battles. It also includes a nice expansion to player names, now supporting 8 characters instead of 6. I already have a full disassembly of the ROM ready to roll and I have located most of the stuff that needs to be changed, meaning it's a matter of time and brainstorming. :thumbsup:

Screenshots:
(https://i.imgur.com/VNFQzLR.png) (https://i.imgur.com/wQ9n6vR.png) (https://i.imgur.com/sSaM6Un.png) (https://i.imgur.com/9dhVpj4.png) (https://i.imgur.com/nTyKBTK.png) (https://i.imgur.com/6wJNjYt.png) (https://i.imgur.com/gA8PXmO.png) (https://i.imgur.com/0pxm3by.png) (https://i.imgur.com/1r922RC.png)

Old videos:
https://www.youtube.com/watch?v=o6lEC8zBP-Q
https://www.youtube.com/watch?v=3R2vrqmKU1Y
Title: Re: Final Fantasy IV Prettified
Post by: chillyfeez on November 24, 2017, 11:24:19 pm
I'm not sure what ever happened with it, but Gedankenschild was working on a FFIV hack that changed all of the monsters, battle backgrounds and (I think) location graphics to 4BPP. Seems like this would work well in conjunction with that. As I recall he was using FFIIUS as the base, but IIRC he seemed to think it would patch easily onto a JP version - image data are all in the same place I think.
But I honestly don't know if he ever finished it, and if not, whether he's still working on it.
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on November 25, 2017, 07:54:39 pm
As long as hacked sections don't overlap, both should mix well.

Meanwhile I've got to work something I wanted implemented for a while:
(https://i.imgur.com/3lVym8l.png) (https://i.imgur.com/iGGnQJC.png)

For those who don't get the difference, it's something already done in the J2E retranslation and on FF4 Advance: all items now have a description, instead of a restricted range. Took me a while to wrap together some code that actually saves on graphics storage this time. :(
Title: Re: Final Fantasy IV Prettified
Post by: Chronosplit on November 25, 2017, 08:26:07 pm
Wow.  I'll tell you one thing, that looks amazing in the menus.

I'd say that if most of this is prettifying it should be in Improvement.  IIRC the FFV script port went there too.
Title: Re: Final Fantasy IV Prettified
Post by: chillyfeez on November 26, 2017, 03:19:52 am
The original-font numbers look a bit odd alongside the new alphabet font. Possibly accentuated by the VWF. Are you planning on changing them, too?
Title: Re: Final Fantasy IV Prettified
Post by: KingMike on November 26, 2017, 10:14:47 pm
Maybe not so bad on the SNES, but I LIKED that the GBA version of FF6 used the original number font on the battle HUD. If because it was a portable screen so that was less strain to read compared to other GBA FF games that used super-tiny fonts. (at least FF4A, as I recall)
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on November 27, 2017, 06:36:07 am
The original-font numbers look a bit odd alongside the new alphabet font. Possibly accentuated by the VWF. Are you planning on changing them, too?
I tried reducing them a bit while keeping the original look almost intact because there's no room to render digits variable too:
(https://i.imgur.com/qfW0Ju9.png) (https://i.imgur.com/G2duNP6.png)
Any better this way?

Meanwhile I tried extracting again the FF4A script and it turns out many things are out of the original order (i.e. a quick copy and paste won't do it). I guess I'll have to resort to the PlayStation localization and tweak that a bit, since it's what was used in the GBA and PSP ports.
Title: Re: Final Fantasy IV Prettified
Post by: Chronosplit on November 27, 2017, 12:15:37 pm
Yeah, this is an issue with FFIV advance at least and not just in the script.  Somehow a lot of data is jumbled around in general.

GBA/PSP is based quite a lot on the PS1 script.  Some actually find it better due to a couple of changes (might want to look up what Legends of Localization says about the Magnetic Cave events or old internet jokes, for example).
Title: Re: Final Fantasy IV Prettified
Post by: Bregalad on November 27, 2017, 12:57:50 pm
This (along with the similar FF5 patch) would probably be great bases for translations in other language where the text is typically much longer than English (such as my native language, French).
Title: Re: Final Fantasy IV Prettified
Post by: Prince Valmont on November 27, 2017, 01:11:17 pm
Aw man. If this VWF were to ever be combined with the complete Namingway edition hack for dialog... it would be the ultimate Final Fantasy IV for SNES.
Title: Re: Final Fantasy IV Prettified
Post by: vivify93 on November 27, 2017, 06:26:38 pm
Not gonna lie there, I was thinking of porting Project II's script (Which Namingway Edition uses) to this project when it was all done... but remember that both Namingway Edition and Project II make numerous bug fixes and gameplay enhancements, which we'd need to figure out how to do in the Japanese version. I'm not sure I'd be comfortable using my script in the vanilla, unaltered edition with all its flaws.

But that's not to discuss here--when Gemini releases this is when we can talk about that.
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on November 27, 2017, 06:48:10 pm
GBA/PSP is based quite a lot on the PS1 script.  Some actually find it better due to a couple of changes (might want to look up what Legends of Localization says about the Magnetic Cave events or old internet jokes, for example).
I should give it a better look, to catch if there are any major issues in need of a quick fix.

This (along with the similar FF5 patch) would probably be great bases for translations in other language where the text is typically much longer than English (such as my native language, French).
That should be no problem, the project is open source and for anybody to tweak it.

I'm not sure I'd be comfortable using my script in the vanilla, unaltered edition with all its flaws.
I guess you'd have to tweak it quite a lot, since this project changes one small detail about how script formatting works, making it more similar to the GBA/PSP versions. Have a look at the current script and how it's formatted: https://github.com/Gemini-Loboto3/prettify/tree/master/script
Briefly, the game is going to support automatic line wraps and includes a "<New>" tag to separate pages. You'll have to do quite a lot or reformatting to make the inserter compatible with it. By the way, most of the script formatting has been done automatically (minor tweaks are manual work) and the code to do so is in my sources, so it could be adapted to work on any script.
Title: Re: Final Fantasy IV Prettified
Post by: Rodimus Primal on November 27, 2017, 10:42:18 pm
Not gonna lie there, I was thinking of porting Project II's script (Which Namingway Edition uses) to this project when it was all done... but remember that both Namingway Edition and Project II make numerous bug fixes and gameplay enhancements, which we'd need to figure out how to do in the Japanese version. I'm not sure I'd be comfortable using my script in the vanilla, unaltered edition with all its flaws.

But that's not to discuss here--when Gemini releases this is when we can talk about that.

Namingway's script has a few lines changed from Project II. Not many but enough that it also meant changing the old Training Room to the original smaller one and the Developer's Room as well. They for the most part would need some tweaking since the new text allows for more space but I think it would be great if it was applied the the Japanese version.
Title: Re: Final Fantasy IV Prettified
Post by: chillyfeez on November 27, 2017, 10:44:53 pm
Yeah, I doubt it would be as easy as just applying Gemini's patch, Vivi. If it was just a text patch, that'd be one thing, but since it tweaks assembly (even just a bit) it probably wouldn't patch right over FFIIUS.
Most likely you'd have to first copy Gemini's assembly hack, then reformat the text... Which would have to be done in a hex editor because the new format won't be FF4kster-compatible.
Not impossible, but it'd be a lot of work.
Title: Re: Final Fantasy IV Prettified
Post by: vivify93 on November 28, 2017, 03:13:09 am
Yeah, I doubt it would be as easy as just applying Gemini's patch, Vivi. If it was just a text patch, that'd be one thing, but since it tweaks assembly (even just a bit) it probably wouldn't patch right over FFIIUS.
Most likely you'd have to first copy Gemini's assembly hack, then reformat the text... Which would have to be done in a hex editor because the new format won't be FF4kster-compatible.
Not impossible, but it'd be a lot of work.
I said I thought it'd be cool to port Project II's script to this project, not apply Gemini's patch on top of Project II.

Then I went onto say that I wasn't sure if it was right to port Project II's script to this patch without all the numerous enhancements Project II has--Sealed Cave skip fix, Adamant Armor fixes, enhanced Pray, Cry, Salve, Goblin summon enhancement, Yang's HP fixed... etc. Meaning, we'd have to port those fixes to the Japanese version of FFIV.

 :huh:
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on November 28, 2017, 08:44:31 am
Most likely you'd have to first copy Gemini's assembly hack, then reformat the text... Which would have to be done in a hex editor because the new format won't be FF4kster-compatible.
No need for hex editors do to that. Prettified's rebuilder works from straight TXT, XML, and PNG files, so whoever wants to make changes simply needs to run a compile.bat to have it all reinserted.

Then I went onto say that I wasn't sure if it was right to port Project II's script to this patch without all the numerous enhancements Project II has--Sealed Cave skip fix, Adamant Armor fixes, enhanced Pray, Cry, Salve, Goblin summon enhancement, Yang's HP fixed... etc. Meaning, we'd have to port those fixes to the Japanese version of FFIV.
It depends heavily on where the expanded code for those patches is placed. You can probably integrate it all into subscripts and reassemble to make sure patched segments don't overlap. At the moment there are more than 700 KB free to use, along with over 16 KB free to inject any expanded text. Technically text can go even beyond those available 16 KB, since pointers are now 24 bits and can address data anywhere in the ROM.
Title: Re: Final Fantasy IV Prettified
Post by: chillyfeez on November 28, 2017, 11:44:21 am
Ahaha - I clearly was not paying very close attention. In my mind this project was "just a patch,"  but now I see that it is considerably more than that.
 :-[
I'm gonna go crawl back into my hole again now.
Title: Re: Final Fantasy IV Prettified
Post by: Spooniest on November 29, 2017, 11:54:10 am
Looks neat, you said you are using the Complete Collection script with some several changes, I'm going to assume for space's sake? Or why are you making them? I mean, dish about the script a bit?
Title: Re: Final Fantasy IV Prettified
Post by: Pennywise on November 29, 2017, 12:08:33 pm
Awesome work.

Technically you are translating the Japanese ROM into English, so it's a translation and should go in the translation section.
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on November 29, 2017, 01:29:11 pm
Looks neat, you said you are using the Complete Collection script with some several changes, I'm going to assume for space's sake? Or why are you making them? I mean, dish about the script a bit?
Currently it's more like I'm using part of the nomenclature from Complete Collection, since that script can't be used as-is without any actual string reordering (too much work for a "quick" project like this). I'm using the PlayStation script tweaked with said nomenclature and I'm making a few changes to the formatting because I want to shape the SNES version in a flavor similar to FF4A and FF4CC. As for space limitations to the script, there are none: it can be expanded until the ROM explodes. :laugh:

Technically you are translating the Japanese ROM into English, so it's a translation and should go in the translation section.
The thing is tho: it's based on existing translations and I'm making a few changes to modernize part of the UI, so I wouldn't call it exactly a translation hack.
Title: Re: Final Fantasy IV Prettified
Post by: KingMike on November 29, 2017, 01:55:34 pm
Didn't we categorize Spooniest's ROM hacks as "hacks"?
(from what I read, he was picking lines from different official translations and mixing them together)

So I think this would have to be similarly categorized.
Title: Re: Final Fantasy IV Prettified
Post by: Spooniest on November 29, 2017, 03:18:25 pm
using the PlayStation script tweaked with said nomenclature and I'm making a few changes to the formatting because I want to shape the SNES version in a flavor similar to FF4A and FF4CC.

Gear. You should know that the PSX script is a weird bird though, unlike any of the other official translations. I'm guessing though, that you've read Tomato's breakdown of the translations and know that.

It taught me the word "dotard," and was the first FF script I ever played where a semicolon was used (twice I think). It isn't half bad, really.
Title: Re: Final Fantasy IV Prettified
Post by: vivify93 on November 30, 2017, 01:53:04 am
Didn't we categorize Spooniest's ROM hacks as "hacks"?
(from what I read, he was picking lines from different official translations and mixing them together)

So I think this would have to be similarly categorized.
They would be under "translations." To my knowledge, the rule is on RHDN is, if a patch exists for non-English game to localize or convert it into English somehow, it's considered a "translation." If a patch modifies an existing fan translation, it's also considered a "translation." Similarly, if a game was originally in English, but a person(s) translated the Japanese script and tossed the new translation into the already-English game, again, this is considered a "translation."

Which is why Spooniest's J2eviscerate mod, Aeon Genesis' Tactics Ogre "PS1 script-to-SNES game" patch, and Ryusui's Breath of Fire II are all considered "translations" and thus are placed in that section on the site.
Title: Re: Final Fantasy IV Prettified
Post by: azidahaka on November 30, 2017, 04:53:47 pm
When i read abot prettified i thought it was news about  this: http://www.romhacking.net/forum/index.php?topic=20582.200 lol

 in any cae that font is a game changer, really amazing!
Title: Re: Final Fantasy IV Prettified
Post by: chillyfeez on November 30, 2017, 07:53:05 pm
When i read abot prettified i thought it was news about  this: http://www.romhacking.net/forum/index.php?topic=20582.200 lol

Yeah! That's the thing I was talking about.

Quote
in any cae that font is a game changer, really amazing!
Heh, no pun intended?
Title: Re: Final Fantasy IV Prettified
Post by: KingMike on November 30, 2017, 10:21:49 pm
They would be under "translations." To my knowledge, the rule is on RHDN is, if a patch exists for non-English game to localize or convert it into English somehow, it's considered a "translation." If a patch modifies an existing fan translation, it's also considered a "translation." Similarly, if a game was originally in English, but a person(s) translated the Japanese script and tossed the new translation into the already-English game, again, this is considered a "translation."

Which is why Spooniest's J2eviscerate mod, Aeon Genesis' Tactics Ogre "PS1 script-to-SNES game" patch, and Ryusui's Breath of Fire II are all considered "translations" and thus are placed in that section on the site.
I thought there was a distinction between text translated by the authors (a "translation") and copying a translation from another source. So it sounds like Gideon's TO patch would qualify as the latter (if the script itself remained largely Atlus' work) and Ryusui's the former (translating the text himself).
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on December 01, 2017, 03:17:49 pm
New screenshots of something that isn't menus again:
(https://i.imgur.com/G2ITAYa.png) (https://i.imgur.com/grTK9uO.png)

Started working on this tricky piece of crap Mode 7 screen. I'm tempted to improve the code a bit in order to support actual 16 colors for that font, instead of just 2 (which uses some ugly upscale from the 2bpp font). I would have pushed the staff roll in a similar fashion, but there isn't exactly too much time to transfer tiles while keeping the scrolling active I suspect, plus it's kinda irrelevant to the project. :P

Edited how font upscale works and redesigned the palette to allow for drop borders and shading:
(https://i.imgur.com/XvKOBLY.png)

I had to change the Mode 7 code to accept two different sets of tiles (one for the prophecy, the other for the staff roll), but fortunately that was the easiest part. And there goes another 16 KB of ROM used. :beer:
Title: Re: Final Fantasy IV Prettified
Post by: chillyfeez on December 02, 2017, 07:22:40 am
I really like how that looks. 16K well spent (depending on what else you were planning to do I guess).
Would you ever consider a more star wars-esque crawl? I don't mean exactly the same, but having the top portion angle away from the reader instead of towards. I was never fond of that.
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on December 02, 2017, 01:54:51 pm
I really like how that looks. 16K well spent (depending on what else you were planning to do I guess).
There's a ton more room to fit all my prerendered crap. :P I just went the lazy way and encoded both tile sets as 4bpp linear (easy to convert to mode7 graphics), without any real optimization.

Quote
Would you ever consider a more star wars-esque crawl? I don't mean exactly the same, but having the top portion angle away from the reader instead of towards. I was never fond of that.
I don't like much the effect either and I'm kinda tempted to remove it altogether like on the GBA port. I'm not sure yet, maybe I'll make it optional in the sources.
Title: Re: Final Fantasy IV Prettified
Post by: chillyfeez on December 02, 2017, 03:34:48 pm
If I'm not mistaken, the legend crawl is a different visual sequence from the "moon flies away" sequence, but you need to run the former in order for the latter to have the right data set in VRAM. Otherwise the earth looks like a bunch of blocky pixels instead of like a blue planet. I did figure out how to shorten the "crawl" sequence after removing the text, though. There's a countdown byte that can be adjusted. I probably have the exact offset written down somewhere if you want (though you seem more ASM savvy than I am so you might not need it).
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on December 04, 2017, 09:04:49 pm
Doing some work with crude formatting on dialog, finally:
(https://i.imgur.com/SLICkj8.png) (https://i.imgur.com/IvFLaBw.png) (https://i.imgur.com/FCipaW8.png) (https://i.imgur.com/mKVcVRg.png) (https://i.imgur.com/Ue7Jnua.png) (https://i.imgur.com/RNgARYt.png)
I still haven't finished working on the internal string formatter, but at least proportional rendering seems to be working as intended. Took me a while to sneak all those tiles into the NMI routines and rearrange the window graphics. :laugh:

PS: incidentally I found out a bug with Snes9x which treats SRAM as invalid memory for DMA during NMI. I quickly fixed by moving the rendering canvas to WRAM instead, so at least compatibility should be assured; still a fix to Snes9x would be nice since SRAM to DMA works fine outside of NMI.
Title: Re: Final Fantasy IV Prettified
Post by: Midna on December 04, 2017, 11:19:20 pm
I'd suggest against using the PSX script as a base for this project, it's full of little inaccuracies and dumb little stuff like adding in fourth wall gags without reason or motive. Either the GBA/PSP script or the DS script would be the way to go, I think.
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on December 05, 2017, 06:39:19 am
The problem with using either the PSP or GBA script is that it doesn't follow the original string order, which would take me an eternity to fix manually. I'll keep on using the PlayStation script with tweaks for simplicity's sake, so that someone else can work from that base to improve the overall quality if they wish to do so. It took me already quite some work to fix a lot of weird paging issues amd there are a ton more from my quick playthrough. :-X

By the way, should I prepare delta patches as I make more of the game proportional-ready? A good amount of it is already playable in this state and a couple more eyes spotting issues in the script would be appreciated.

Mysidian legend done with better vertical centering:
(https://i.imgur.com/aeL54ka.png)
The formula that calculates fading palettes was really something weird, especially because it was applying it to just one color, while I needed the gray shading pixels to fade in as well. Anyways, at least now this screen won't crash the game for good. Next crash point to fix: scrolling prologue.

Location names prettified and slightly expanded:
(https://i.imgur.com/IBRc7qI.png)
I may enlarge the window a bit if some location name demands so.
Title: Re: Final Fantasy IV Prettified
Post by: chillyfeez on December 06, 2017, 08:25:21 pm
Shouldn't be that hard to make the window text-length-dependent.
Just a thought - take it or leave it.

Edit: now that I think about it, with each letter no longer representing one tile's width, maybe that would be more of a pain to formulate than I originally thought.
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on December 07, 2017, 12:03:21 pm
Aaaand done with the last game crashing screen, aka the scrolling Prologue:
(https://i.imgur.com/2y6ay8T.png) (https://i.imgur.com/yVumIfM.png)
It recycles a good portion of dialog and Mysidian legend code, so it didn't take very long to do. Unfortunately I couldn't use the larger font here because there isn't enough VRAM to fit the greater amount of tiles it'd need (and it mimics the GBA prologue, which is for the better).

Also, while I was at it, I included a new control code to horizontally center strings in dialog, similarly to what Prologue and Mysidian legend do:
(https://i.imgur.com/gp4pyDG.png)

With these two out of the way the game is currently fully playable and can be tested already. The current patch can be found here: https://github.com/Gemini-Loboto3/prettify/raw/master/ff4pretty.xdelta

For those too lazy to downloa and patch the rom, here goes a video with the first 35 minutes of game: https://youtu.be/wvrqXzwnNDw

Shouldn't be that hard to make the window text-length-dependent.
Just a thought - take it or leave it.
The way I currently set it up makes that a bit complicated, but it also makes location windows behave similarly to their counteparts on GBA (which is what I was aiming for).
Title: Re: Final Fantasy IV Prettified
Post by: Grimoire LD on December 07, 2017, 03:00:36 pm
Incredible Gemini. This looks like a terrific base for any future modding, I've been away for a very long time so I doubt I'll be able to utilize it, but your work does not go unappreciated. A shame you have to use the PSX translation, that is only *slightly* better than the J2E translation. You mentioned that editing the scripts and such is as easy as  .xml file?
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on December 08, 2017, 08:03:56 am
There is one XML files, which is used to generate static tiles for menus, the rest is stored as simple TXT.

Meanwhile I fixed the issue with BG2 jumping around during NMI transfers, it was some error caused by xkas assembling stuff incorrectly. The patch should be updated, same like if you wanna try it.
Title: Re: Final Fantasy IV Prettified
Post by: cj iwakura on December 10, 2017, 02:00:58 pm
Looks really sharp. Is it possible to do something similar for VI?
Title: Re: Final Fantasy IV Prettified
Post by: dn on December 11, 2017, 03:25:08 pm
I'm working on it, but it's slow going.
(https://i.imgur.com/S6NeBKi.png)
Title: Re: Final Fantasy IV Prettified
Post by: KingMike on December 11, 2017, 04:52:19 pm
I do remember the RPGOne translation was hindered by that limitation. Chris tried to get it in but he couldn't get it, leaving most significantly the enemy names expanded in text but not able to use the extra length because of screen space.
(though the text itself was of course another thing  ;D )
Title: Re: Final Fantasy IV Prettified
Post by: lexluthermiester on December 13, 2017, 11:41:52 am
This looks really good! Like!  :thumbsup:
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on December 16, 2017, 03:13:41 pm
Started working on battle stuff:
(https://i.imgur.com/6Egqbvt.png) (https://i.imgur.com/J1saCgd.png)

Basic VRAM "expansion" done (moved BG3 graphics to a previous VRAM page, it exploits some unused ranges which granted me more than 350 tiles to work with), now I just need to find every single damn routine that populates this mess. :P
Title: Re: Final Fantasy IV Prettified
Post by: Teeporage777 on December 17, 2017, 09:49:47 am
 This looks really nice. Great job.
Title: Re: Final Fantasy IV Prettified
Post by: KillerBob on December 18, 2017, 02:36:21 pm
Incredible work! Looks great, it's unfortunate that you were unable to use the larger font for the opening/legend crawl. Had no luck trying to apply the work in progress-patch you posted, maybe I'm doing something wrong. Has anyone else tried it?
Keep up the awesome work! :thumbsup:
Title: Re: Final Fantasy IV Prettified
Post by: Squall_FF8 on December 19, 2017, 03:16:00 am
Excellent work!

May I ask you, what font format are you using? Is it something standard like Square Font, or something home-brew?

Also I'm interested in some technical details about implementation, like how many tiles are you using to render a page, what are the limitations, maybe share some difficulties ...
Title: Re: Final Fantasy IV Prettified
Post by: Grimoire LD on December 19, 2017, 04:17:11 pm
Started working on battle stuff:
(https://i.imgur.com/6Egqbvt.png) (https://i.imgur.com/J1saCgd.png)

Basic VRAM "expansion" done (moved BG3 graphics to a previous VRAM page, it exploits some unused ranges which granted me more than 350 tiles to work with), now I just need to find every single damn routine that populates this mess. :P

Well... you got Defend to finally be right. The rest of that is... a place I've never looked. I assume at leave 7-8 routines draw characters to the separate menus depending on context. That has always been a bit beyond me, so best of luck!
Title: Re: Final Fantasy IV Prettified
Post by: KingMike on December 19, 2017, 07:07:32 pm
I looked into how to hack those menus for Tomato.
I recall those menus used their own font basically with their own font encoding.
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on December 20, 2017, 08:55:33 am
Has anyone else tried it?
Which ROM are you using? Lenophis did some tests with the xdelta and it's working fine on his end too.

May I ask you, what font format are you using? Is it something standard like Square Font, or something home-brew?

Also I'm interested in some technical details about implementation, like how many tiles are you using to render a page, what are the limitations, maybe share some difficulties ...
Not sure what's a Square Font, but I'm using raw 2bpp fonts for almost everything. They're fast and require no extra code for proportional rendering. :laugh:
As for the actual technical part: dialog rendering uses 168 (24x7) tiles and disables pages scrolling to avoid issues with backbuffers, while messages with the 8x8 font use 192 tiles (24x8). The biggest technical difficulty was rewriting how text parsing is done, since the original does a lot of messy stuff in order to refill a tilemap, while my code goes in little steps: it expands a dialog into a buffer, formats line wraps (still WIP, it's not implemented in any release), then renders text into a canvas buffer, and finally hijacks the NMI routines to copy the canvas to VRAM.

Well... you got Defend to finally be right. The rest of that is... a place I've never looked. I assume at leave 7-8 routines draw characters to the separate menus depending on context. That has always been a bit beyond me, so best of luck!
I looked into how to hack those menus for Tomato.
I recall those menus used their own font basically with their own font encoding.
Defend, Change, and MP needed use 4bpp graphics derived from the actual 2bpp font since they are displayed on BG2. What I did there was replace the upscale + DMA transfer with actual 4bpp graphics. Finding tilemaps was a bit of a mess because battle code tends to use completely different conventions. I'm still struggling with just rendering the other strings.
Title: Re: Final Fantasy IV Prettified
Post by: Squall_FF8 on December 20, 2017, 09:21:18 am
Not sure what's a Square Font, but I'm using raw 2bpp fonts for almost everything.
I'm talking about this (http://www.romhacking.net/documents/435/). It has even an Editor (http://www.romhacking.net/utilities/624/). As far as I know it became a standard for all Square titles starting with GBA. The font format itself is not limited to 2bpp, but I haven't seen anything different. Interesting trait is possibility to have fonts with height higher then 8, which is interesting from rendering perspective :)
Title: Re: Final Fantasy IV Prettified
Post by: wanzer on December 24, 2017, 01:14:10 am
If we're talking prettification, why not make the field sprites bigger (like FF6 size?)
Title: Re: Final Fantasy IV Prettified
Post by: KillerBob on December 24, 2017, 07:01:31 am
Which ROM are you using? Lenophis did some tests with the xdelta and it's working fine on his end too.
Sorry for the false alarm. Don't know what I did wrong, but it works now.
Hope you succeed rendering the other strings in the battle engine,this is amazing work!  :beer:
Title: Re: Final Fantasy IV Prettified
Post by: Kiyoshi Aman on December 24, 2017, 08:55:27 pm
If we're talking prettification, why not make the field sprites bigger (like FF6 size?)

Are you volunteering to put in the work necessary to bring the field sprites up to FF6 standards?
Title: Re: Final Fantasy IV Prettified
Post by: Gedankenschild on December 25, 2017, 06:53:06 pm
Oooh, this looks really nice! When I saw the subject and who started it, I assumed we were talking about the PSX version. I thought you weren't particularly interested in hacking the SNES version...

I will most certainly make sure that my own hack remains compatible with this one! Hopefully the prerendered battle font doesn't use every little bit of VRAM left? I was hoping to increase the amount used for background graphics at least a little bit...
Title: Re: Final Fantasy IV Prettified
Post by: Gemini on December 26, 2017, 12:21:53 pm
Hopefully the prerendered battle font doesn't use every little bit of VRAM left? I was hoping to increase the amount used for background graphics at least a little bit...
(https://i.imgur.com/9MkpUKv.png) (https://i.imgur.com/nR13851.png)
I guess I kinda overdid VRAM expansion and left no empty tiles. :P
Title: Re: Final Fantasy IV Prettified
Post by: Gedankenschild on December 26, 2017, 03:44:20 pm
It actually took me a little to realize you hadn't scrolled all the way down on the 2nd screenshot. :o
That doesn't look like a lot at all for all that prerendered stuff! Are you only loading what's visible on screen and DMAing things from SRAM on the fly?
I think I remember byuu writing about that.