Author Topic: FF7 - field files - Section 1 format  (Read 7849 times)

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
FF7 - field files - Section 1 format
« on: 2003-10-21 14:05:20 »
A guy over the Repository's forum posted an incomplete spec of the first section of a field file... if someone is willing to complete it by adding infos just post here.

you can find the original post here
http://www.romhacking.com/battleground/viewtopic.php?t=263

Section 1 Spec:
Code: [Select]
00 __ __ __ __ __ __ __ __ __ | End
10 ?? __ __ __ __ __ __ __ __ | (Unused)
11 ?? ?? __ __ __ __ __ __ __ | ??:...Goto ??
12 ?? __ __ __ __ __ __ __ __ | (Unused)
13 ?? ?? __ __ __ __ __ __ __ | ??:...Goto ??
14 50 mv cv 00 jv __ __ __ __ | (Unused)
15 50 mv cv 00 jv jv __ __ __ | If Menu(??)=??...Endif
40 tb tm __ __ __ __ __ __ __ | Message(??, ??)
48 mp tb tm fv lv mv __ __ __ | Menu(??, ??, ??, ??, ??)
49 00 06 ?? __ __ __ __ __ __ | Rename(??)
49 00 08 ?? __ __ __ __ __ __ | Shop(??)
50 tb xx xx yy yy ww ww hh hh | Window(??, ??, ??, ??, ??)
60 ?? ?? ?? ?? ?? ?? ?? ?? ?? | Map(??)
70 00 ?? ?? __ __ __ __ __ __ | Battle(??)
C8 ?? __ __ __ __ __ __ __ __ | PartyAdd(??)
C9 ?? __ __ __ __ __ __ __ __ | PartyRemove(??)
CA c1 c2 c3 __ __ __ __ __ __ | PartySet(??, ??, ??)
F1 00 ?? ?? __ __ __ __ __ __ | Sound(??)
F8 ?? F9 __ __ __ __ __ __ __ | FMV(??)
------------------------------+-----------------------
0F F9 __ __ __ __ __ __ __ __ | Add 1 of Materia 00-4F
0F FA __ __ __ __ __ __ __ __ | Add 99 of All Items
0F FB ?? __ __ __ __ __ __ __ | Battle Lock (01=On)
0F FC ?? __ __ __ __ __ __ __ | Movie Lock (01=On)
0F FD ch tm __ __ __ __ __ __ | ch's Name = tm
0F FE __ __ __ __ __ __ __ __ | Global Reset
30 cs cs jv __ __ __ __ __ __ | If buttons pressed != cs, Jump Forward jv Bytes (+3)
39 00 ?? ?? ?? ?? __ __ __ __ | Gil
49 00 01 ?? ?? __ __ __ __ __ | Warp
49 00 02 ?? __ __ __ __ __ __ | Battle
49 00 03 ?? __ __ __ __ __ __ | FMV (Audio)
49 00 04 00 __ __ __ __ __ __ | FMV (Add Video)
49 00 07 ?? __ __ __ __ __ __ | Reform
49 00 09 00 __ __ __ __ __ __ | Main Menu
58 00 it it qu __ __ __ __ __ | Add qu of Item it
59 00 it it qu __ __ __ __ __ | Remove qu of Item it
5B 00 ma ap ap ap __ __ __ __ | Add Materia ma with ap AP
80 50 mv nv __ __ __ __ __ __ | Set mv = nv
81 20 1E ?? ?? __ __ __ __ __ | Main Menu Modifier (0000=On)
95 05 mv __ __ __ __ __ __ __ | Increment mv
97 05 mv __ __ __ __ __ __ __ | Decrement mv
F0 ?? __ __ __ __ __ __ __ __ | Music


EDIT: I forgot to mention that they are talking about the PSX version... but since is almost the same as the PC version...  :wink:

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
FF7 - field files - Section 1 format
« Reply #1 on: 2003-10-21 14:10:10 »
hmm doesnt make much sense to me
Doesnt look too similar to the PC version
lol CZarDragon is on the psx hacking for ff7? Wow
wont be long till they crack it all then :)

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
FF7 - field files - Section 1 format
« Reply #2 on: 2003-10-21 14:17:10 »
Well, as far as i know, the window thing is correct. I translated the game in italian and i had to discover how the game handle the windows sizes and positions, and i'm talking about the PC version

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
FF7 - field files - Section 1 format
« Reply #3 on: 2003-10-21 17:30:35 »
the explanation on the sides is abit mistifying, any chance of a small explanation?

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
FF7 - field files - Section 1 format
« Reply #4 on: 2003-10-22 13:27:49 »
Well, let me try to explain. Who knows something about the field files knows what i'm talking about. Each field file is divided in 9 parts normaly. The first one is the one that contains text, but not only text. After studing a little bit the field files i've figured out that the first sector can be always divided in 5 parts. The header, the script, the pointers of the text, the text and AKAO (audio stuff i think). In dettails, if you look at md1stin you got:

Code: [Select]

                                |  POINTER  |  SIZE   |
md1stin                         |           | 426902  |
  |                             |           |         |
  --HEADER                      | 0000 0000 | 42      |
  |                             |           |         |
  --md1stinSECTOR1              | 2A00 0000 | 18973   |
  |  |                          |           |         |
  |  --md1stinSECTOR1.1header   |           | 140     |
  |  --md1stinSECTOR1.2script   |           | 2056    |
  |  --md1stinSECTOR1.3pointers |           | 230     |
  |  --md1stinSECTOR1.4text     |           | 4591    |
  |  --md1stinSECTOR1.5akao     |           | 11956   |
  |                             |           |         |
  --md1stinSECTOR2              | 474A 0000 | 42      |
  --md1stinSECTOR3              | 714A 0000 | 1318    |
  --md1stinSECTOR4              | 974F 0000 | 6672    |
  --md1stinSECTOR5              | A769 0000 | 1178    |
  --md1stinSECTOR6              | 416E 0000 | 12008   |
  --md1stinSECTOR7              | 299D 0000 | 52      |
  --md1stinSECTOR8              | 5D9D 0000 | 744     |
  --md1stinSECTOR9              | 45A0 0000 | 385859  |
  |                             |           |         |
  --CLOSING (FINAL FANTASY7)    | 0006 8388 | 14      |


The part we are talking about is the SECTOR1.2script. I hope that's more clear than just the codes and descriptions at the start :P

by using the word "script" i mean the actions, the texts, the battles that there are in the game. For example, in md1stin, everyone get down from the train, kicks the guard's asses and Barret talks to you.

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
FF7 - field files - Section 1 format
« Reply #5 on: 2003-10-22 20:32:52 »
ok
it just was the way it was laid out before had me baffled.
Yes this has been discussed before by The SaiNt and Ficedula.
Ficedula did translate/decode most of the script section, as Cosmo shows the text in the appropriate windows. but yes there is still alot left.
Saint and Sephiroth3d Do have documentation for all of this.
Contact them

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
FF7 - field files - Section 1 format
« Reply #6 on: 2003-10-22 23:44:50 »
Ficedula (hi :wink:), SaiNt and Sephiroth3D, do you have it ?

Aaron

  • *
  • Posts: 2818
    • View Profile
    • http://aaron-kelley.net/
FF7 - field files - Section 1 format
« Reply #7 on: 2003-10-22 23:59:41 »
You might have better luck if you contact them by PM or e-mail, as they don't seem to be around the boards as often as they used to be.

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
FF7 - field files - Section 1 format
« Reply #8 on: 2003-10-23 14:36:57 »
Ombra try searching back through the forum looking at early threads
threads like "field files" "section 6" "cosmo" those kinda threads

mav

  • *
  • Posts: 239
  • The Sauce team
    • View Profile
FF7 - field files - Section 1 format
« Reply #9 on: 2003-10-23 21:32:09 »
Hm... as far as I know, Cosmo doesn't even touch script section. Window sizes are calculated manually (sum of widths of all letters). Anyways, a lot have been done by CZarDragon, and with help of others, we can discover the rest :).

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
FF7 - field files - Section 1 format
« Reply #10 on: 2003-10-23 21:40:51 »
Seems to me that noone is willing to cooperate... but who cares... it's just a game right? Come on guys! I don't think that the remake could be possible without stuff like the script section. I think that more than one knows but noone is willing to write something.

@Skillster: we are talking about section 1 and not 6

FF7 - field files - Section 1 format
« Reply #11 on: 2003-10-26 00:05:35 »
I have old docs and stuff from the forthcoming FF7PC Techdoc I can dig out. I can't do it right now, but maybe in a few days.
But yeah, the Script was what we never figured out. Cosmo handles Dialog, backgrounds/Palette, and music, mainly.
The SaiNt's figured out some more (not sure if he wants them made public), and I've done a little with another section.
Trouble is that, IIRC, the PC field files are mostly different than the PSX ones. For instance, isn't the way backgrounds are stored completely different?

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
FF7 - field files - Section 1 format
« Reply #12 on: 2003-10-26 08:53:30 »
i think so srethron, they had to be ported
guys there was a complete break down of the TOC of the field files in age old posts, the TOC enabled us to find  sections in the field files for background, music, party locations, sprites, battle information, turning off random battles etc.And no, scripting in FF7 has no way related to the remake, the remake uses its own 3d engine and file system

Cyberman

  • *
  • Posts: 1572
    • View Profile
FF7 - field files - Section 1 format
« Reply #13 on: 2003-10-27 04:13:21 »
Quote from: _Ombra_
Seems to me that noone is willing to cooperate... but who cares... it's just a game right? Come on guys! I don't think that the remake could be possible without stuff like the script section. I think that more than one knows but noone is willing to write something.

@Skillster: we are talking about section 1 and not 6


Well On the PSX at least SECTION 1 is stored in in files called ######.DAT
LZS compressed date files however I only deciphered some of the header I found pointers and text but finding the actial size of the data offsets etc. has been rather challenging. (and not terribly successful on my part).
I can mostly parse the header of it. At the very least I can parse the list of names in it. Find the start of the script pointers etc though.. heh doesn't seen too swift :P
4sbwy_1.dat
Code: [Select]

5000 8011
7544 8011
7674 8011
7ECC 8011
7EF4 8011
81D8 8011
8208 8011
?? 2 5 ??
ID Count=5 2
0367 (871)
?? 2 0 0 2 0 0 0 0 0 0 ??
Author = 'keisuke'; ID = '4sbwy_1';
00003C 'MASK'
000044 'init'
00004C 'line'
000054 'cloud'
00005C 'item3'
000064
000C58(3160) 0012C4(4804)
Calc Values
Start of Text = 0003D3
End of Text = 000C74


The start data was easy to get but past that.. heck I lost hair with it. :)

My 'header' information.
Code: [Select]

typedef char DAT_ID[8];
typedef struct
{
   UINT16   REF1;       // 2
   UINT16   ZZ0;        // 4
   UINT16   REF2;       // 6
   UINT16   ZZ1;        // 8
   UINT16   REF3;       // 10
   UINT16   ZZ2;        // 12
   UINT16   REF4;       // 14
   UINT16   ZZ3;        // 16
   UINT16   REF5;       // 18
   UINT16   ZZ4;        // 20
   UINT16   REF6;       // 22
   UINT16   ZZ5;        // 24
   UINT16   REF7;       // 26
   UINT16   ZZ6;        // 28
   UINT8    ZZ7[2];     // numbers? 30
   UINT8    NameC;      // ID Name Count 31
   UINT8    ZZ8;        // numbers? 32
   UINT16   ZZ9;        // number? 34
   UINT8    ZZ10[10];    // numbers? 44
   DAT_ID   Author;     //?  52
   DAT_ID   LocID;     //?  60
}
DAT_HDR;


However if someone knows where the start of the sections are I can make better heads and tails of it myself :)

I've tried to guess where the text begins .. there doesn't seem to be an obvious chunk of information pointing to offsets in the data. Or anything to indicate there size or where they start as far as I can time. It might be stored in another file. Or I'm missing something :) (wouldn't be far fetched I guess).