Vagrant Story/SHP files: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(New page: SHP data These files are used to store 3d models for charictors and some props which aren't a part of the map data. All values are in hex. $0 $4 signiture "H01" $4 $1 ...)
 
No edit summary
Line 142: Line 142:
                         $0      $1      CLUT colour reference
                         $0      $1      CLUT colour reference
         $0      $?      unknown texture footer (may or may not be present)
         $0      $?      unknown texture footer (may or may not be present)
[[Category:Vagrant_Story]]

Revision as of 09:57, 20 November 2009

SHP data

These files are used to store 3d models for charictors and some props which aren't a part of the map data. All values are in hex.

$0      $4      signiture "H01"
$4      $1      number of joints in the skeleton
$5      $1      number of groups
$5      $1      number of groups
$6      $2      number of triangles in the first polygon group
$8      $2      number of quads in the second polygon group
$A      $2      number of nemain polygons (which are further grouped into triangles and quads)
$C      $44     unknown data (something to do with mapping the lip syncing textures to the face)
$50     $6      collision size and height (shape is a cylinder)
$56     $2      menu position Y
$58     $C      Unknown
$64     $2      Shadow radius
$66     $2      Shadow size increase rate
$68     $2      Shadow size decrease rate
$6A     $4      Unknown
$6E     $2      Menu scale
$70     $2      Unknown
$72     $2      Target sphere position Y
$74     $8      Unknown
$7C     $4      LBA XX_COM.SEQ
$80     $4      LBA XX_BT1.SEQ
$84     $4      LBA XX_BT2.SEQ
$88     $4      LBA XX_BT3.SEQ
$8C     $4      LBA XX_BT4.SEQ
$90     $4      LBA XX_BT5.SEQ
$94     $4      LBA XX_BT6.SEQ
$98     $4      LBA XX_BT7.SEQ
$9C     $4      LBA XX_BT8.SEQ
$A0     $4      LBA XX_BT9.SEQ
$A4     $4      LBA XX_BTA.SEQ
$A8     $4      unknown (always zero)
for $B entries
        +$0     $2      chain attack animation ID
$C2     $32     unknown but it doesnt matter the 3D model loader doesnt map this to RAM at all)
$F4     $4      pointer to magic effects section (relative to offset $F8)
for $18 entries
        +$0     $2      unknown (noticeable effects when casting spells)
$128    $4      relative pointer to AKAO section (relative to offset $F8)
$12C    $4      relative pointer to groups section (relative to offset $F8)
$130    $4      relative pointer to vertex section (relative to offset $F8)
$134    $4      relative pointer to polygon section (relative to offset $F8)
+       joint section
        for number of joints in skeleton
                JOINT_DATA
                $0     $4      size of bone
                $4     $1      parent joint ID
                $0     $1      unknown
                $0     $4      mountable joint ID
                $0     $9      unknown
+       group section
        for number of groups
                GROUP_DATA
                $0     $2      joint group is asigned to
                $2     $2      last vertex in this group
                (the next vertex will become the first vertex for the next group)
+       vertex section
        (note that the number of vertices must be obtained by parsing the group section)
        for number of vertices
                VERTEX_DATA
                $0      $2      x co-ordinate
                $2      $2      y co-ordinate
                $4      $2      z co-ordinate
                $6      $2      zero padding to 8 byte alignment
+       polygon section
        for number of triangles in first polygon group
                TRIANGLE_DATA
                Triangle vertices are arranged in anti-clockwise order
                $0      $1      polygon type ID ($24 = triangle $2C = quad)
                $1      $1      size in bytes of the polygon data
                $2      $2      unknown (probably alpha transparency or double sided polygons)
                $4      $2      vertex 1 index*4
                $6      $2      vertex 2 index*4
                $8      $2      vertex 3 index*4
                $A      $1      u 1 co-ordinate
                $B      $1      v 1 co-ordinate
                $C      $1      u 2 co-ordinate
                $D      $1      v 2 co-ordinate
                $E      $1      u 3 co-ordinate
                $F      $1      v 3 co-ordinate
        for number of quads in second polygon group 
                QUAD_DATA
                Quad vertices are arranged in standard TMD order
                $0      $1      polygon type ID ($24 = triangle $2C = quad)
                $1      $1      size in bytes of the polygon data
                $2      $2      unknown (probably transparency or double sided polygons)
                $4      $2      vertex 1 index*4
                $6      $2      vertex 2 index*4
                $8      $2      vertex 3 index*4
                $A      $2      vertex 4 index*4
                $C      $1      u 1 co-ordinate
                $D      $1      v 1 co-ordinate
                $E      $1      u 2 co-ordinate
                $F      $1      v 2 co-ordinate
                $10     $1      u 3 co-ordinate
                $11     $1      v 3 co-ordinate
                $12     $1      u 4 co-ordinate
                $13     $1      v 4 co-ordinate
        for number of polygons
                $0      $10 or $14      POLYGON_DATA or QUAD_DATA as above
+       AKAO section
        $0      $4      maximum number of AKAO frames
        for     maximum number of AKAO frames
                $0      $4      relative pointer to AKAO frame
        for actual number of AKAO frames
                $0      $?      AKAO frame data
+       magic effect section
        $0      $4      unknown
        $4      $4      size of magic effect section (doesnt include this 8 byte header)
        $8      $12     unknown
        for num magic effects
                $0      $2      relative pointer to magic effect data
        (note that pointers descend but the magic effect data ascends with blank data between them)
        for num magic effects
                $0      $4      magic effect data (unknown)
+       texture map section
        There is no pointer to the texture map section you must walk the file by going to the
        magic effects section and reading the size of that section. then add 8 (number of bytes in
        the magic section header
        $0      $4      size of texture map in bytes
        $4      $1      number of extra pallets
        $5      $1      half the width in pixels
        $6      $1      half the height in pixels
        $7      $1      number of colours per pallet
        for number of pallets
                for number of colours per pallet
                        $0      $2      colour data
                                        most significant bit is alhpa used to set transparency
                                        next comes 5 bits each for blue, green and red
        for height in pixels
                for width in pixels
                        $0      $1      CLUT colour reference
        $0      $?      unknown texture footer (may or may not be present)