Difference between revisions of "FF8/WorldMap rail"

From Final Fantasy Inside
< FF8
Jump to navigation Jump to search
my_wiki>MaKiPL
(Added frames)
m (18 revisions imported)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
By MaKiPL
 
By MaKiPL
  
==Info==
+
== Info ==
Rail.obj is a file containing key locations of train movement. It stores location on world map, and the train automatically rotates, gives power and calculates needed info (like cargo rotation and etc.)
 
  
===File scheme===
+
Rail.obj is a file containing key locations of train movement. It stores location on world map, and the train automatically rotates, gives power and calculates needed info (like cargo rotation and etc.) This file '''cannot be LZS compressed'''. Doing so makes the game not recognize the file.
The file is built the similiar way as [[FF8/WorldMap_wmx|World map WMX.obj]]. The engine is loading animation for specific train every 0x800 bytes (2048). Always. Animation cannot be larger than 2048, and if is smaller than 2048 bytes, then what's left is filled with 00. One animation frame is 16 bytes.  
 
  
 +
=== File scheme ===
  
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
+
The file is built the similiar way as [[FF8/WorldMap_wmx|World map WMX.obj]]. The engine is loading animation for specific train every 0x800 bytes (2048). Always. Animation cannot be larger than 2048, and if is smaller than 2048 bytes, then what's left is filled with 00. One animation frame is 16 bytes. Max animation frame is 127, because 127*16=2032+16(header).
! style="background:rgb(204,204,204)" | Offset
+
 
! style="background:rgb(204,204,204)" | Length
+
<br />
! style="background:rgb(204,204,204)" | Description
+
 
 +
<br />
 +
 
 +
{| class="wikitable"
 +
! Offset
 +
! Length
 +
! Description
 
|-
 
|-
 
| 0
 
| 0
Line 22: Line 27:
 
|-
 
|-
 
| 2
 
| 2
| 10 bytes
+
| 2 bytes
| Unknown
+
| Unknown (Padding?)
 +
|-
 +
| 4
 +
| UInt32
 +
| Train Stop offset #1*
 +
|-
 +
| 8
 +
| UInt32
 +
| Train Stop offset #2*
 
|-
 
|-
| varies
+
| 12
 
| count * 16 bytes
 
| count * 16 bytes
 
| Animation frames
 
| Animation frames
 
|-
 
|-
| varies
+
| 12 + (count*16)
 
| varies
 
| varies
 
| Padding / 00
 
| Padding / 00
 
|}
 
|}
  
===Animation key frame===
+
* Train stops are offset to animation frames, in which the train stops like (running in the tunnel, or waiting at the station)
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
+
 
! style="background:rgb(204,204,204)" | Offset
+
=== Animation key frame ===
! style="background:rgb(204,204,204)" | Length
+
 
! style="background:rgb(204,204,204)" | Description
+
{| class="wikitable"
 +
! Offset
 +
! Length
 +
! Description
 
|-
 
|-
 
| 0
 
| 0
| 2 Bytes signed
+
| 4 Bytes signed*
 
| X Axis
 
| X Axis
|-
 
| 2
 
| 2 Bytes
 
| Unknown
 
 
|-
 
|-
 
| 4
 
| 4
| 2 Bytes signed
+
| 4 Bytes signed*
 
| Z Axis
 
| Z Axis
|-
 
| 6
 
| 2 Bytes
 
| Unknown
 
 
|-
 
|-
 
| 8
 
| 8
| 2 Bytes signed
+
| 4 Bytes signed*
 
| Y Axis
 
| Y Axis
|-
 
| 10
 
| 2 Bytes
 
| Unknown/ Always 00?
 
 
|-
 
|-
 
| 12
 
| 12
Line 68: Line 72:
 
| Unknown
 
| Unknown
 
|}
 
|}
 +
 +
* Location on world map (global) is saved upon 4 bytes. To better understand this (and in fact-operate/hack) just convert it to decimal. Vars are in big-endian.
 +
 +
00 00 FE FF is far west. FF FF 01 00 is far east.

Latest revision as of 05:25, 23 May 2019

By MaKiPL

Info

Rail.obj is a file containing key locations of train movement. It stores location on world map, and the train automatically rotates, gives power and calculates needed info (like cargo rotation and etc.) This file cannot be LZS compressed. Doing so makes the game not recognize the file.

File scheme

The file is built the similiar way as World map WMX.obj. The engine is loading animation for specific train every 0x800 bytes (2048). Always. Animation cannot be larger than 2048, and if is smaller than 2048 bytes, then what's left is filled with 00. One animation frame is 16 bytes. Max animation frame is 127, because 127*16=2032+16(header).



Offset Length Description
0 Byte Count of animation frames
1 Byte Unknown
2 2 bytes Unknown (Padding?)
4 UInt32 Train Stop offset #1*
8 UInt32 Train Stop offset #2*
12 count * 16 bytes Animation frames
12 + (count*16) varies Padding / 00
  • Train stops are offset to animation frames, in which the train stops like (running in the tunnel, or waiting at the station)

Animation key frame

Offset Length Description
0 4 Bytes signed* X Axis
4 4 Bytes signed* Z Axis
8 4 Bytes signed* Y Axis
12 4 Bytes Unknown
  • Location on world map (global) is saved upon 4 bytes. To better understand this (and in fact-operate/hack) just convert it to decimal. Vars are in big-endian.

00 00 FE FF is far west. FF FF 01 00 is far east.