1
Scripting and Reverse Engineering / [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:
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
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