Author Topic: [FF8] Triple Triad TIM data  (Read 2184 times)

Sebanisu

  • *
  • Posts: 171
    • View Profile
[FF8] Triple Triad TIM data
« on: 2019-12-28 03:39:36 »
At location 0x7A9B10 in FF8_EN.exe 2013 steam version. Is the TIM file for Card Faces.

I was confused about the TIM data for the Card Faces. As I seemed to be missing half the cards. Turns out the CLUT is a bit unique. The CLUT Width is 256 and Height is 56. Usually this means there are 256 colors and 56 palettes. But turns out there are 110 palettes of 128 colors and 1 palette of 256 colors. So the game is taking the left half and right half of the cult and swapping between them for all the cards. The card image data has like 4 rows by 28 columns of cards. The odd columns would use the left side of the CLUT and the even columns would use the right side of the CLUT. The card back uses the most colors so it uses both sides.

Just wanted to share. Trying to prep OpenVIII for some card game coding.
CLUT data:

After writing some code to combine all the card faces with the correct palettes into one image:



At location 0x796A90 in FF8_EN.exe 2013 steam version. Is the TIM file for Symbols & Numbers.
This one had it's CLUT divided into 16 rows x 3 cols of 16 color palettes. Total of 48 palettes. Though a majority of them were empty. I did a break down:       
Code: [Select]
            3 pages, 256x256; inside () is palette id +1.
            page 1 = 5 rows. first 3 rows are 16x16 grid, last 2 rows are a 24x24 grid
                      row 1 has 11 hex numbers: 0-A (1)
                      row 2 4 of 4 frame animations: fire(4), ice(7), lightning(10), earth(13)
                      row 3 4 of 4 frame animations: poison(16), wind(19), water(22), holy(25)
                     row 4 has 9 numbers: 0-9 (28)
                      row 5 has 2 items: +1, -1 (31 or 34)
            page 2 = 3 rows of 256x48: You Win!(2), You Lose...(5), Draw(8)
            page 3 = 3 rows of 256x64: Same!(9), Plus!(6), Combo!(9)
Seems CLUT column 1 was for everything on the left page. CLUT column 2 was for the center page and CLUT  column 3 was for the right. Every subgroup has its own palette.

After writing some code to combine all the pieces with the correct palettes into one image:


Update: I noticed timviewer was overriding the color's per clut to 16 for 4 bpp tims. So I added some code to do that. So I no longer need to force it for the Symbols and Numbers.

http://forums.qhimm.com/index.php?topic=11084.msg154418#msg154418 This guy figured it out a while ago :P
« Last Edit: 2019-12-28 22:48:12 by Sebanisu »

LordUrQuan

  • Alpha testing your worst nightmares
  • *
  • Posts: 602
  • LOAD "FF2J",8,1
    • View Profile
Re: [FF8] Triple Triad TIM data
« Reply #1 on: 2019-12-28 17:10:44 »
Two questions:
1.  How in a nine-card playing field is a draw even possible?
2.  Will your code worth with the CD version of the TIMs (as we found a couple months ago, original CD and Steam are different in more ways than just registry keys)?

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: [FF8] Triple Triad TIM data
« Reply #2 on: 2019-12-28 19:59:41 »
1) i'm unsure from what i gather from MCINDUS the game only loads 2 columns of card faces at a time. So it'll cycle through things till everything needed drawn is drawn I guess.
2) All I need to do is find the different EXE data offsets for the 2000 version. The data should be similar so i could load both the exe's up and search for the same data and note the offsets.
I wonder if the 1.2 patch will change the offsets too as the 2000 version without a patch might be different enough to move stuff. My code does a pretty good job a detecting if data is not a TIM file. So if unsure of I could test a few offsets to confirm which set is valid. I need to copy my files off my cd again. As I lost my hard drive I had that on.


Atleast in the remaster I don't need to do this as the files are already dumped by dotEmu.
« Last Edit: 2019-12-28 20:01:22 by Sebanisu »

LordUrQuan

  • Alpha testing your worst nightmares
  • *
  • Posts: 602
  • LOAD "FF2J",8,1
    • View Profile
Re: [FF8] Triple Triad TIM data
« Reply #3 on: 2019-12-28 21:20:12 »
I think you misinterpreted my meaning of "draw"... not drawing in the sense of putting pixels on the screen, but rather as in "we ended in a tie."

Sebanisu

  • *
  • Posts: 171
    • View Profile
Re: [FF8] Triple Triad TIM data
« Reply #4 on: 2019-12-28 22:50:04 »
draw is possible if your score is the same. I think you actually have to take over a curtain number of cards. like when you start you start at a score of 5 v 5. when you flip one you go up to 6 and they go down to 4. something like that.