Author Topic: Question about the graphic  (Read 890 times)

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Question about the graphic
« on: July 04, 2016, 09:24:38 AM »
Hey guys,

I'm 'working' on FF5, but alas the forum there is quite 'silent'. I see you have accumulated quite a knowledge about FF4, so hopefully my question will be easy for you :D

I'm trying to display the images of a mobs from SNES rom of FF5. The game uses a master table of 5 bytes that contain:
 - Palette, Tiles & Tile-Map offsets
 - Compress, Shadow & Size flags.
First 3 are obvious, Size   0 is 64x64 pixels; 1 is 128x128 pixels.

So I wonder (and hope so): Does FF4 uses similar structure? If thats the case, do you know what Compress & Shadow does?
You may see my current progress here and the forum topic for it.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Question about the graphic
« Reply #1 on: July 04, 2016, 10:13:10 AM »
I'm gonna start off by saying that it's probably not similar. Even though FFV looks a lot like FFIV when you're playing it, the devs likely figured out better ways to do things by the time they made FFV. FFIV is a programming clusterfuck.

That being said, I also am a bit unclear about what it is you're trying to figure out...

Let's start here: What are "mobs?"

Bahamut ZERO

  • Cagnazzo
  • *
  • Posts: 347
  • Gender: Male
  • If ye're takin a beatin, hop in de back row!
    • View Profile
Re: Question about the graphic
« Reply #2 on: July 04, 2016, 11:40:21 AM »
Are trying to view the graphics for monsters or something? If so most of the monsters in FF5 are in 4BPP SNES format (though about a dozen are in 3BPP SNES).

I can't remember what the offsets were for 'em, since I was just dicking off with that game one day in YYCHR.
I update my graphics thread on almost a daily basis, so keep an eye out for new stuff!

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: Question about the graphic
« Reply #3 on: July 05, 2016, 02:09:11 AM »
Quote
Even though FFV looks a lot like FFIV when you're playing it, the devs likely figured out better ways to do things by the time they made FFV.
Yeah, like job system, FF4 assign a job to a specific player, while in FF5 you may have all jobs on each character.

Quote
FFIV is a programming clusterfuck.
I'm not sure what you imply but FF5 is clustered too. The good things is that it uses master tables that links things together.

Quote
That being said, I also am a bit unclear about what it is you're trying to figure out...
Let's start here: What are "mobs?"
Sorry I thought its commonly used slang among gamers. Mobs = monsters :D

Quote
I can't remember what the offsets were for 'em, since I was just dicking off with that game one day in YYCHR.
I doubt you can really see an image of a monster in YYCHR. The main reason is that most of such programs rely on the assumption that the sprite is filled rectangular NxM block of tiles. Although FF5 fills 8x8 or 16x16 logical blocks, you need a Map of how to fill a block, without it I doubt you will see a proper image.

P.S. Sorry things in my mind goes faster than I can type or make a sentence, so if something doesn't make a sense I will be happy to explain :D

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Question about the graphic
« Reply #4 on: July 05, 2016, 09:55:57 AM »
Quote
Quote
Even though FFV looks a lot like FFIV when you're playing it, the devs likely figured out better ways to do things by the time they made FFV.
Yeah, like job system, FF4 assign a job to a specific player, while in FF5 you may have all jobs on each character.

Quote
FFIV is a programming clusterfuck.
I'm not sure what you imply but FF5 is clustered too. The good things is that it uses master tables that links things together.

No, sorry, "clusterfuck" is a vulgar slang term that means "big mess." The data and assembly in FFIV often are not organized very well at all, and when I say "the devs likely figured out better ways to do things," I mean that they figured out more effective ways to code, not necessarily that they made more fun ways to play.

For example, monster image data is entirely different, apparently. In FFIV, each monster entry is four bytes:
0: Size Index - monsters' rectangular sizes are picked from a table and can be 2x2, 3x4, 4x4, 17x41, or whatever. But any entry that's over 7F gets an entirely separate set of rules and is used to indicate either a special size, defined by an entirely separate five-byte table, or a PC enemy, like when you fight Yang or Kain, for example.
1: Palette Index
2-3: Sprite Pointer

So, unfortunately, the monster image table in FFIV seems to work nothing like that of FFV, so I'm afraid knowledge of one won't illuminate much about the other in this case.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: Question about the graphic
« Reply #5 on: July 05, 2016, 06:07:16 PM »
Quote
So, unfortunately, the monster image table in FFIV seems to work nothing like that of FFV, so I'm afraid knowledge of one won't illuminate much about the other in this case.
Unfortunately indeed. I hoped that they will share common structures.

On the bright side, I was able to pinpoint the asm code that does 'decompressing' so together with examination of the data, I was able to see how it works. Now only Shadow flag is left, but fortunately it doesnt seems to play role of how to render the image :)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Question about the graphic
« Reply #6 on: July 05, 2016, 06:10:17 PM »
The size flags could be something similar to the size byte in FF4. Do monsters of the same size graphic have the same settings for their size flags?

Shadow might have something to do with whether the monster literally casts a shadow, i.e. floating monsters. Those exsted in FF5, right? Maybe I'm imagining things.

Compress... no idea. Maybe some part of the process involves some kind of data compression?

This is all pure speculation on my part. I enjoy playing FF5 now and then but I have never looked inside the guts of the rom.
Let's dance!

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: Question about the graphic
« Reply #7 on: July 06, 2016, 02:31:04 AM »
Quote
Shadow might have something to do with whether the monster literally casts a shadow, i.e. floating monsters. Those exsted in FF5, right? Maybe I'm imagining things.
Wooah, it seems that's exactly the case!!! I checked almost all monsters. Floating ones dont have pre-render shadow under, so I guess there is a subroutine that adds it. Good guess Pinkpuff :D

FYI:
Size = 0 when the monsters is drawn in 64x64 pixels
Size = 1 when monster is drawn in 256x256 pixels
Compress = 0 - normal 4bpp image
Compress = 1  - 3bpp image drawn in 4bpp video mode. It seems thats well known trick for SNES. They call it compression, because a tile uses 24 bytes instead of 32 bytes (in normal 4bpp). That multiplied by 8x8 tile grid (size =0) saves up to 512 bytes. Add to this 16bytes from palette (16->8) .. so yeah I understand why some people call it compression :D