Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Zeemis on December 07, 2016, 07:15:40 pm

Title: FF5 Advanced Compressed Graphics Question
Post by: Zeemis on December 07, 2016, 07:15:40 pm
Greetings,

Its been a long time since I've hacked a Final Fantasy game; however, with the growing popularity of the Steam final fantasy ports, I thought I'd dabble again. Using the "FFV Editor (http://www.romhacking.net/utilities/898/)" by Zanerous, I was able to sucessfully import my own creature sprite. He displays correctly in the editing program; however, displays all distorted in-game. Additionally, the "FFV Viewer" by Squall spits out an error stating "Not Valid LZSS" stream. I am aware that the monster sprites (at least I think) are compressed, so I went to check to see if they also showed up oddly via "NLZ-GBA Advanced", a LZSS GBA decompressor. It appeared fine, so I was thinking that FFV Viewer couldn't read the custom offset that the sprite/palette data was being saved, which the FFV Editor saved at the end of the rom (0071017C). Any idea why it's showing up distorted? FF6 uses "mold" data for enemy sprite detection, could it be that?

(https://s27.postimg.org/hjybg0qlv/Final_Fantasy_V_Advance_USA.png)
Title: Re: FF5 Advanced Compressed Graphics Question
Post by: Madsiur on December 08, 2016, 12:42:12 am
Byte 3 & 4 of the size data (which the editor doesn't change) seem to set some flags. You might be missing one of these though I don't know what these flags do.
Title: Re: FF5 Advanced Compressed Graphics Question
Post by: Zeemis on December 08, 2016, 09:00:32 am
I think you're right since the editor placed the sprite at the end of the rom, it may have not added those two bytes. I'll look into those bytes, they are most likely related to mold data since the editor doesn't go over molds (assume FF5 uses molds).

Alternatively, I could elect to instead replace the exsting sprite; however, if those two bytes do in fact have to do with mold data, then it wouldn't matter unless I'm replacing the exact size sprite with that of the same size.

EDIT
Replacing the existing sprite didn't work; however, I did find this:
http://slickproductions.org/slickwiki/index.php/Squall:FF5_Monster_Graphics#Form

So if you look at the end example of that "Steel Bat", that shows exactly why my sprite is showing up partially. I believe it's using the existing "form" data. I really wish that editor would allow us to go a step further and choose the new sprite form data lol. That'd make me greedy though, so I'll keep at it.
Title: Re: FF5 Advanced Compressed Graphics Question
Post by: Madsiur on December 08, 2016, 01:12:43 pm
The "size" offset in the editor has 4 bytes. First two are I think XX tiles width (byte 1) by YY tiles height (byte 2). Some monsters like Neo Exdeath has a size of 01 01 so it's probably set in another way. As for byte 3 & 4 there are in some cases set to 1, 2, 4, 5, 8, etc. but often to 00 00, meaning possibly the byte(s) could have special flags, maybe some of these SNES counterparts. Palettes and tilesets have their own 4 bytes pointers in GBA version so you can forget those. There could be a size flag, shadow flag and form flag on those two bytes...

SNES
Code: [Select]
+0 bit7:   Compression flag
   bit6-0: Tileset ID (high)
+1 bit7-0: Tileset ID (low)
+2 bit7:   Size flag
   bit6:   Shadow flag
   bit5-2: unused
   bit1-0: Palette ID (high)
+3 bit7-0: Palette ID (low)
+4 bit7-0: Form ID