Miscellaneous Forums > Scripting and Reverse Engineering
[FF7] camdat files
nfitc1:
--- Quote from: Akari on 2009-10-15 04:56:08 ---I don't know how they stored it on PC, but on PSX each camera frame stored as transformation packet for GTE. This is used in field to set 3d transformations for models and in movies. It must be true for battle )
--- End quote ---
Are you talking about the movie cams or the battle cams? The PCs version of the battle cams might be different. It doesn't seem like anyone has UnLZSed them to compare them.
Battle related cameras can't just be origin and target coordinates, they'd have to include someway of playing sounds. The final Sephiroth battle is the best (only?) example of this. I believe it most likely that these files contain all the camera-related battle data (this is where all the indexes point to) and it's further likely that they contain a combination of relative and absolute pointers (point at caster for x seconds, then sweep to target(s), etc.).
Akari:
I looked at those a little. There is bytecode sequence as well =)
offset 0x4 is pointer to list of offsets to camera data's (3 offsets for each camera id).
offset 0xc is pointer to 3 camera data for win camera.
At each offset start of camera sequence. Control bytes are 0xd8-0xff.
ps: still don't know why it use 3 offsets. It just call function 3 times for each of offsets.
nfitc1:
There are four DWORD pointers at the beginning at 0x0, 0x4, 0x8, and 0xC
for camdat0.bin:
0x0 points to 1182 addresses in this file. Most of these are unique, but plenty are not.
0x4 has same structure as 0x0, but point to different locations.
0x8 points to 3 locations
0xC points to 3 locations (one of these is likely win cam, but what are the others?)
for camdat1.bin:
same as camdat0, but 0x0 and 0x4 point to 1125 addresses each
for camdat2.bin:
same as camdat1, but 0x0 and 0x4 point to 1122 addresses each
At a glance, I can't tell if any of the camera segments are similar to segments in other files. Why are they separated into three files? Are they different for each disc?
Akari:
--- Quote from: NFITC1 on 2009-11-18 16:11:11 ---There are four DWORD pointers at the beginning at 0x0, 0x4, 0x8, and 0xC
for camdat0.bin:
0x0 points to 1182 addresses in this file. Most of these are unique, but plenty are not.
0x4 has same structure as 0x0, but point to different locations.
0x8 points to 3 locations
0xC points to 3 locations (one of these is likely win cam, but what are the others?)
for camdat1.bin:
same as camdat0, but 0x0 and 0x4 point to 1125 addresses each
for camdat2.bin:
same as camdat1, but 0x0 and 0x4 point to 1122 addresses each
At a glance, I can't tell if any of the camera segments are similar to segments in other files. Why are they separated into three files? Are they different for each disc?
--- End quote ---
All this locations are camera scripts. Some of them are not in camdat though. For example idle camera script or start battle camera script.
Camdats are different for different battle layout. It's set in battle setup +0x12 byte. 0,1,8 - CAMDAT0.LZS, 2 - CAMDAT1.LZS, 3,4,5,6,7 - CAMDAT2.LZS.
Akari:
--- Quote from: NFITC1 on 2009-11-18 16:11:11 ---There are four DWORD pointers at the beginning at 0x0, 0x4, 0x8, and 0xC
for camdat0.bin:
0x0 points to 1182 addresses in this file. Most of these are unique, but plenty are not.
0x4 has same structure as 0x0, but point to different locations.
0x8 points to 3 locations
0xC points to 3 locations (one of these is likely win cam, but what are the others?)
--- End quote ---
New info.
Offset 0x0 points to scripts for camera position vector scripts.
Offset 0x4 points to scripts for camera direction vector scripts.
There are 3 scripts for each camera id. Each of them called every time and result stored to 3 different structures. Which one to use are completly random.
if ((game_timer & 3) != 3)
{
struct_id = game_timer & 3;
}
3 is special cases, if developer want camera to work not random way.
Win camera not the exeption. there are 3 pointers to this camera.
0x8 points to position scripts for win camera.
0xc points to direction scripts for win camera.
Simple script example from start battle camera direction vector:
FA(30F8,9CFF,1027) - set start position of camera
E2(3C) - set callback function for transition from start position to idle position from battle setup with given number of steps.
F5(3C) - set wait timer
F4 - wait
FF - finish
0xE2 opcode is most important. There are few callback functions, but they fixed for opcode. calling opcode 0xE2 and 0xE8 will produce different transition effect.
Problem mostly solved =)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version