Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: halkun on 2004-06-16 09:41:18

Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-16 09:41:18
Well, you guys conviced me. I've decided to go ahead and document all the FF7 engine findings into one super document. I've decided to call it "Gears" as not only a name that inspires the inner workings of something, but also because it brings up the "Steampunk" genre that FF7 takes place in.

I finished the outline and will be populating the document with content that I can find from here and all around the Internet.

The byline was tricky to come up with as it's not just me. I decided to write "By Joshua Walker and the 'Qhimm team'"

I hope that's OK...

This will help us muchly. Not only will we have a centralized place for data collection, but will allow us to take the engine apart in small chunks that are easy to decipher.

Here is the outline/Table of contents. If you have anything you want to add, let me know. This will dictate the way the data is presented. Did I get all the terms right?

Code: [Select]

Table of Contents
Introduction
History
-PSX version overview
-PC version overview
Engine Basics
-Common Terms
-Parts of the Engine
-A Look at the Debug Room
The Kernel
-Kernel Overview
-Generic Program Flow
-The Threading System
-Data Caching
-File System Access
The Field Module
-Field Overview
-Event Scripting
-Triggers
-The 3D overlay
-The Actors
-The Ego
-Data Organization
-Textures (The TIM Files)
-Polygons (The PLY Files)
-Hierarchy (The HRC Files)
-Animation (The ANM files)
-Models (The RSD Files)
The Battle Module
-The Mathematics of Battle
-The Battle Scene
-Allys
-Enemies
-Magic Scripting
-Data Organization
-Textures (The TIM Files)
-Sprites (The SPT Files)
-Models (The RSD Files)
The Menu Module
-The Accessors
-Game Saves
The World Map
-Data Format
Appendix
-Item Listings
-Resource Lookup tables
-Source Code Forensics
BUGS
-PSX Version
-PC Version


IF YOU WANT TO HELP
I am using OpenOffice.org as my document writer of choice. The reason why is because it supports open formats for data exchange (XML) and has a pretty wicked PDF generator. I would recommend if you want to assist, download OpenOffice and send me changes in .sxw format. (OOo's native compressed XML format) OOo is free, runs on every popular OS, and is availible at http://www.openoffice.org
Title: "Gears" - The FF7 Documentaion Project
Post by: mirex on 2004-06-16 10:43:11
i would have some corrections, they all are meant for PC version

Code: [Select]

The Field Module
   -Data Organization
      -Textures ( The TEX files )
      -Model (The P Files)
      -Model Skeletal Hierarchy (The HRC Files)
      -Model bodypart-textures assignment (The RSD Files)

The Battle Module
   -Data Organization
      -Textures ( The TEX files )
      -Models ( The P files )
      -Skeleton files ( ??AA files )
      -Animation files ( ??DA files )
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-16 11:34:21
Thanks for your input, however we have a bit of a condundrum.

The datafiles in FF7 are actually dirived from Sony's original Psy-Q development libaries by Psygnosis. This system used common file formats that are native to the PSX. The PC formats are in turn dirived from those.

For example:

a TIM file is a "Texture In Memory". It's a native Psy-Q format that's really a raw copy of the PSX's video memory. The TIM file also holds CLUT and cache data. In the PSX version this was "compiled" into a BIN resourse and on the PC version, it was renamed to a TEX file and compiled into an LGP. However the files are internally the same thing. I think it would be best to "call a spade a spade" and use it's original development nomeclature. This is why I have "Common Terms" under "Engine Basics" at the very beginning. This wil sort out all the wierdness between the PSX and PC versions.

I should move the PSX version and PC version overviews into "Engine Basics" as well to help strighten everything out. For example the skeletons are really uncompiled HRC files, which is also a native Psy-Q format as well.

I know the PC version is more "open" than the PSX one, however there should be room to grow. One version of the program is no less than the other.

Do you have any ideas how we can properly orgenize the seperite systems without rewriting the doc twice? I think going by thier Psy-Q names are the best way to go. Looking at the source code directory listing, the /lib dir appears to be a Psy-Q wrapper of some sort that they used during the PC porting process.
Title: "Gears" - The FF7 Documentaion Project
Post by: mirex on 2004-06-16 12:31:06
but the PC and PSX things should be differenced because they are at least a little different, like its file structure.
Title: "Gears" - The FF7 Documentaion Project
Post by: Kislinskiy on 2004-06-16 13:03:18
I think some parts of the PSOneFFVII and PCFFVII are too different to throw them together. Look at the battle models for example. Every battle model on the PSOne is stored as a LZS compressed file containing all needed information. PC battle models need .p, .hrc, .rsd and .tex files that are stored in one huge LGP archive.
Title: "Gears" - The FF7 Documentaion Project
Post by: DeadLajik on 2004-06-16 14:39:21
Are they really that different ? I only own the PSX version of FF7 (which I play on my PS2) but since they are the same game and their data structures are probably somewhat related, I think both should be discussed in the document.
Title: "Gears" - The FF7 Documentaion Project
Post by: Kislinskiy on 2004-06-16 14:47:43
Yes they are that different. Handle them in the same document? - Yes. Throw them together under the same topic like "battle models"? - No.

Battle models
|_PC
|--|_...
|_PSone
---|_...

That would be OK IMHO.
Title: "Gears" - The FF7 Documentaion Project
Post by: Threesixty on 2004-06-16 15:27:10
When I hear Gears....I think of
Xenogears.
Title: "Gears" - The FF7 Documentaion Project
Post by: Darkdevil on 2004-06-16 15:46:47
Quote from: Threesixty
When I hear Gears....I think of
Xenogears.


Glad im not the only one...
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-16 17:59:14
Ok comprmise, when talking about the data members, we use the Psy-Q names, and then explain how the data is retreaved on each platform. I refuse to beleave that when it comes to brass tacks, the internal structs are different. After the data is converted into something "sane" we can furthur disect it. There will be diffrences. For example HRC files on the PC are text, while the PSX ones are compiled, but the data refrenced are the same thing.

here's a quick example off the top of my head.

Quote

The polygon format:
A PLY file contains the 3D pieces that make up models used the game.......

PC: These file are refrenced by a .p extention are are retreaved by......

PSX: These files are collected into a BIN archive or a compress LZS archhive. To retreave the model you want you simply....

When the file is retreaved, it's internal format is as follows...


How about that?
Title: Hmmmmmm hmmmm
Post by: Cyberman on 2004-06-17 03:40:11
The problem a lot of people are having is they aren't seeing it with the same perspective obviously.  Halkun is looking at what the ORIGNAL data was, not how it's currently stored.  By reversing this process finding out what the PSX or PC data formats are now is merely the process of tools to create the formats.

I know they are vastly different but they came from the same data.  That's what Halkun is working from.

For representing the end format perhaps showing how the end file was created from the original data (like what Halkun just said).
Also reversing this would be another cool thing (creating the original data from the file).

Cyb
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-17 10:50:12
I finished the "History" secton tonight. It's rough, but should be OK. I need some info on th european release dates.

Also I just dicoverd that the deveopers used CVS as version control for the PSX version..

I found in $ID tag in the PSX executable.

Quote

$Id: sys.c,v 1.115 1995/11/29 08:50:18 suzu Exp $



you can download my humble beginnings on gears here.
http://the-afterm.ath.cx/gears/

Send me any changes you might have.
Title: "Gears" - The FF7 Documentaion Project
Post by: Kislinskiy on 2004-06-17 11:54:56
European release date: 15. Nov. 1997.
Title: "Gears" - The FF7 Documentaion Project
Post by: Topher on 2004-06-17 11:56:05
Halkun, you are my idol.

It's a shame I can't read the document (yet) *goes to download compatible software*
Title: "Gears" - The FF7 Documentaion Project
Post by: Cyberman on 2004-06-17 16:20:14
Halkum:
What format is the document in?  Might help for people wanting to PEER at it :o

Kislinskiy:
I killed my viewer SNIFF. I needed to rewrite it anyways but I can still mourn it's loss ;)

The program still works just none of the OGL code does for some reason, I think I messed up a pointer (le smirk).

It's a huge spagheti to say the least sp wittling out useless code and making it do something that makes sense is the next job ;)

Cyb
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-17 17:58:11
You use OpenOffice.org to read the files. They are the natiive OOo format.

If you wanna be really fancy, the file itself is a gzipped xml resourse, readable by any XML reader. It best to use OpenOffice.org

http://openoffice.org
Title: "Gears" - The FF7 Documentaion Project
Post by: Kislinskiy on 2004-06-17 18:06:15
You need OpenOffice to view the document. It is available at http://www.openoffice.org.
BTW I lost my complete source code. I had forgotten to back up my "Visual Studio Projects" folder..  :(

edit: Too slow.  :z
Title: "Gears" - The FF7 Documentaion Project
Post by: J*** H******* on 2004-06-17 19:10:22
Message
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-17 22:52:13
Habit ^_^

My PSX doc was written in StarOffice, I like the program, and on top of that it's the only word prossesor I own. You see, I don't have a viable windows computer anymore. I run Linux. Sadly, the RTF export isn't all that hot and I lose formatting badly. I'll be adding page numbers and chapter names in the headers. It also exports to DocBook really well. I also have the ability to make tables and sidebars and plaster large 300 DPI pictures in my document, (Which I will be doing heavily).

I feel like writing a book.
Title: "Gears" - The FF7 Documentaion Project
Post by: Topher on 2004-06-18 00:47:09
After Googling yielded results pointing towards OpenOffice, I started to download it last night, but I got abysmal transfer rates, so I gave up. I'll try again later.

Update: Just downloaded OpenOffice at school, it's installing now, not long left.

Update #2: Just finished reading. Looking good so far!
Title: "Gears" - The FF7 Documentaion Project
Post by: DeadLajik on 2004-06-18 23:25:17
I looked at the document in Open Office and it looks good! Keep up the good work.

I just wanted to make a positive comment to keep you motivated. Good work.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-19 06:55:02
I need screenshots

If you guys could, I would adire some really dynamic screenshots of FF7 in action. I have some placeholders now, but the PC graphics look so much better in terms of bitmaps. I could use the following:

Pictures full pictures of the menu, worldmap, minigame, battle, and field.

I can't use pictures with  logos or other corruptions on the pictures. Also, I would really like the stock engine. No hi res Clouds or a Sephy/Arieth/Yuffie party please. (At least, not for now)

If you can, using Qhimm's save game converter, try and get some screenshots of PC vs PSX graphics. (Both pictures at almost the some point in time.) I think the PC version has a taller 3d battle view

Thanks

ADDUNDUM:

I've uploded a new version of "Gears", you can can dowload it at http://the-afterm.ath.cx/gears

Changes include an expanded Table of Contents (Outline), a spiffy cover sheet, Engine basics, and psudo-text for the entire document.

Have fun....
Title: "Gears" - The FF7 Documentaion Project
Post by: sfx1999 on 2004-06-19 21:24:55
Hmm the cover sheet is messed up for me.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-20 00:43:07
How is it messed up? Does the picture not show?  Is it screwing up the formatting? Is there a "broken link" like the image wasn't saved to the sdw file?

Thiere are also other images too. (The engine overiew) that's a openoffic drawing. Does that come up?


Also does anyone know where Terrence Fegenson went off to? I would adore to edit his battle mechanics FAQ, but need his permission to slightly edit his doc to better jive with mine, such as adding tables and some pictures.
Title: "Gears" - The FF7 Documentaion Project
Post by: sfx1999 on 2004-06-20 01:36:27
The author was split onto the second page, that's all.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-20 01:39:23
Fixed ^_^

Running linux, I have a slightly diffrent font martix that windows users. This creates a lot of "off by one" errors. I'll try and look out for that.


ADDUNDUM!!!

To keep myself from double-posting.. I just want everyone to know that I updated my Gears doc in the download area almost every night. You can grab it and review if you wish.
Title: "Gears" - The FF7 Documentaion Project
Post by: Topher on 2004-06-20 22:54:41
Do you still want those screens? (I noticed you have some in the doc. now)

I can cap some when I get home, but you'll need to be a bit more specific (What menus, etc.).
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-21 02:20:38
Maybe.

I have FF7 installed on my PC now and have been playing musical save games between my PSX emulator in Linux and the native app on windows. So I can capture from either. I did do the battle mechnics from Terrence's doc. For fun, you can capture a screenshot of all of the 31 statuses (sleep, blind, poison, silence, etc) . I can add that to battle mecanics tables.

Also does any one know when the 7777 check is made during the battle program flow. Terrence didn't mention it.

I'm working on adding all the known file formats right now. It's a bigger project that I thought. Formatting it all is such a pain ^_^
Title: "Gears" - The FF7 Documentaion Project
Post by: Darkdevil on 2004-06-21 08:51:02
Well persoanlly I reckon its only impletmented into the battle flow untill you have 7778 HP or more.  And its then inserted from there...
Title: "Gears" - The FF7 Documentaion Project
Post by: Cyberman on 2004-06-21 23:36:54
Quote from: halkun
Maybe.

I have FF7 installed on my PC now and have been playing musical save games between my PSX emulator in Linux and the native app on windows. So I can capture from either. I did do the battle mechnics from Terrence's doc. For fun, you can capture a screenshot of all of the 31 statuses (sleep, blind, poison, silence, etc) . I can add that to battle mecanics tables.

Also does any one know when the 7777 check is made during the battle program flow. Terrence didn't mention it.

I'm working on adding all the known file formats right now. It's a bigger project that I thought. Formatting it all is such a pain ^_^


I was wondering when you would say 'air' hehehe
Well if he need help with battle models Kislinskiy has gotten further on the things than I have, I can decode them and I have the first section decoded (Section 0) the next section needs to be decoded as I think it is actually the information I'm looking for (mumble).

Open Office Dies on loading the document, well actually it just dies period for some reason, but at least I have something to look at in the future (mumbles begrudgingly at open office).
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-21 23:42:56
OK, I have an Idea, I'll save the Gears doc localy and export a PDF every night. That way it won't be such a hassle for anyone who wants to read it.

I'm going to be signing up on that romhackers site, it looks like a real awesome resourse. They deal more with the scripting attibutes while Qhimm here deals with the graphical side of things. I'm gonna make a postnig, watch some BBC "Coupling" (I got that show on DVD for my b-day... It's the BOMB!) and go to bed. I'll make an addundum when I have the PDF up.

ADDUNDUM!!!
I have now moved the doc internally and have a PDF set up. You can access it here
http://the-afterm.ath.cx/gears/gears.pdf

You can also just access it from the root directory if you don't want to load the whole thing in your browser.

http://the-afterm.ath.cx/gears

That should get some more eyes on it.
Title: "Gears" - The FF7 Documentaion Project
Post by: Contra on 2004-06-22 03:05:53
Gee, thanks Halkun. Make me go through all the trouble of downloading OpenOffice to see this thing, then replace it with a PDF as soon as I get it installed! :P Then I realize that due to my recent reformatting, I don't have Adobe Acrobat! So I have to download Acrobat Reader as well! :P :P

Heh. Just teasing.

And as I finally find myself able to read through this file.... I just have one thing to say about it... *big breath*  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.

:P

-Contra
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-22 03:54:10
Do a search for "Lorem ipsum" on google. That has a very intresting stroy.....
Title: "Gears" - The FF7 Documentaion Project
Post by: mirex on 2004-06-22 07:50:24
Quote from: halkun
OK, I have an Idea, I'll save the Gears doc localy and export a PDF every night. That way it won't be such a hassle for anyone who wants to read it.

yaaeeeey ! great idea :) finally i can read it
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-23 11:56:24
I updated Gears again. I need to make sure that everyone's docs on thier websites are complete. I have discrpences on the .P format. Also I need the .a format. Ahlexx's is missing and Fice doen't have a doc
Title: "Gears" - The FF7 Documentaion Project
Post by: Anonymous on 2004-06-23 12:37:13
Message
Title: "Gears" - The FF7 Documentaion Project
Post by: Darkdevil on 2004-06-23 13:02:33
I think Halkun was refering to Alhexx's .A document there Jari...
Title: "Gears" - The FF7 Documentaion Project
Post by: J*** H******* on 2004-06-23 13:49:12
Message
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-23 17:19:30
Oops, that's right, I forgot that hi was doing armed servide duity... I was active in the american military from 199-1996, so I can relate
Title: "Gears" - The FF7 Documentaion Project
Post by: Darkdevil on 2004-06-23 19:11:00
Quote from: halkun
I was active in the american military from 199-1996, so I can relate


DAMN!!! 1006 years in the military and you claim to be only 30!  Tell me...What is your secret?

hehehe
 j/k
Title: "Gears" - The FF7 Documentaion Project
Post by: Alhexx on 2004-06-24 14:28:02
Quote from: Jari
Not exactly missing... I think that he's still performing his compulsory armed service, but he does drop by now and then.


That's right. I've got 3 days left :)

I'm gonna take a closer look at your document, halkun, and I'll see if I have something to add. I just have a question: What does this mean? :-?

Code: [Select]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.

 - Alhexx

 - edit -
As for the .a document: I still haven't started to hack that format yet... :(
Title: "Gears" - The FF7 Documentaion Project
Post by: Darkdevil on 2004-06-24 16:09:18
Its the default latin filler for many documents to offer a look into what they look like when completed...Its used in Publisher XP...
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-24 17:39:42
It's filler that's been around for the last 1500 years! Linguists have been amazed on how intact it is from it's original text.

The reason why it's used it because it has the same spacing and wordsize as normal english. It's a paragraph, and the correct size to be one. It's much better than putting something like "Fill here later" and a repeating word, as it doesn't look like natural english.

It also assists in formating whch is why my doc look a little more professional than a simple FAQ
Title: "Gears" - The FF7 Documentaion Project
Post by: mirex on 2004-06-26 11:48:42
FF7 .A animation brief info:
http://mirex.mypage.sk/FILES/ff7_a.txt
Title: "Gears" - The FF7 Documentaion Project
Post by: ragnarok13 on 2004-06-27 14:43:48
halkun:
In case it helps any, I remember one PC version bug: Ribbon, when equipped, not only protects you from negative statuses, but also from Haste. I hate that bug :evil:
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-06-27 17:32:16
When you have numb or death cast on you, the timer goes down MUCH faster when you have haste on. That's very much a negitive effect.

In a pinch I've slowed or stoped one of my own characters just so I could slow the timer down. That way I could "get to them later"
Title: "Gears" - The FF7 Documentaion Project
Post by: sfx1999 on 2004-06-27 21:14:15
Quote from: ragnarok13
halkun:
In case it helps any, I remember one PC version bug: Ribbon, when equipped, not only protects you from negative statuses, but also from Haste. I hate that bug :evil:


[edit]

UHh haste is a status effect. I believe ribbon protects from all status effects.
Title: "Gears" - The FF7 Documentaion Project
Post by: Sir Canealot on 2004-07-02 00:09:12
Heh, I was going to say if you needed an editor type person to check over your work, I'd be happy to help.
I'll be reading it anyway when I can be bothered, so it's not much effort to note errors if I DO find any :P (and lord only knows, I've seen things get gone over by 3 people and there's still typos in it)

But no worries, thanks for the reading material (when I can be bothered) ^_^
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-02 08:33:42
I attached Gears to my WWW button and also added a sig ^_^ That should help get the word out....

Well, I *THOUGHT* I added a sig...
Title: "Gears" - The FF7 Documentaion Project
Post by: Darkdevil on 2004-07-02 09:09:58
Sigs arnt active on the forum Halkun
Title: battle data
Post by: Lord_Skylark on 2004-07-08 03:04:32
*is eager on if a really really detailed analysis was done on the enemies AI* If not, I can try to figure it out.

I should really finish my FF4 AI (simpler...- but it took a hell of alot of work to figure it all out - just some minor battle visual effects that I didn't figure out how they were called up exactly - but I should just release it anyhow)

~Sky
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-08 03:37:44
The ai iscript is in scene.bin. SOmeone have-decrypted it. I've been burnt out as of late.
Title: Okay
Post by: Lord_Skylark on 2004-07-08 04:37:18
Who decrypted it? Cause I could type it up really nice and stuff. If not, I plan on working on that eventually.

~Sky
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-08 09:47:40
If you've got basic AI decryption done, I want it ^_^;  Been wanting to figure out their battle routine for a while now, especially to nail down counters and, say, work out what causes Dragon Zombies to use Pandora's Box (as example).

Oh, and yeah, there was no problem with using the Mechanics stuff in your project, Halkun, though I will warn you that there's a number of errors in it scattered around that I never bothered fixing: UW Modifiers being one of the biggest "recent" (as in, about a year ago) things I mucked about with on GameFAQs (interesting factor that put together Morph and solved some problems with Death Penalty and Conformer calculations), among other things.  Statuses as well: there's actually the full 32 in the game; Dual was in the wrong place (it should be in between Reflect and Shield), and what was in Dual's place was renamed to Seizure.

What I *really* want at the moment, though, is the LCG that FF7's random number generator uses.  If I can get that, I *should* be able to hex edit it in memory and get my own random numbers out, thus happily allowing various random things to be tested.  So if you have any information about that, I'd love to hear about it.
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-08 10:02:36
By the way, looking over the document...

Objects that you can win and steal are the *same thing*.
0x0320 is the byte mask of what items can be dropped/stolen and their chances.  00-3F means a Drop, 80-BF means a Steal, and the chance is out of 63 (basically).
0x0324 is the item you get from the *first* byte in the byte mask.  It could be a drop, steal or nothing depending on what the byte mask said.
0x0326, 0x0328 and 0x032A refer to the other bytes in the mask.
Oh, and while we're on the subject, 0x032C is 6 bytes referring to the commands allowed for Manipulate.  However, the first 2 bytes of 0x032C is *VERY* important: it's the command the monster will use when Berserk.  This leads to another very important bug: if the command listed is FF FF and the monster is *NOT* immune to Berserk, it will try to use a command that does not exist, and will (luckily) never have the MP for: so the message "<monster>'s skill power is used up." will appear over and over.  (Try Berserking 2-Faced, Doorbull, Guardian, Manhole, XCannon or Hojo's Right Arm for fun related to this)  If it *DID* have the MP necessary (I forget the exact amount), the game would crash.  Fun.


Anyways, yes, would like a basic AI primer or some data on the LCG, if anyone has it.  Failing that, the full disassembled battle routine would also be nice <cough>
Title: "Gears" - The FF7 Documentaion Project
Post by: mirex on 2004-07-08 10:16:01
Quote
The ai iscript is in scene.bin. SOmeone have-decrypted it.

Yup i have the scene.bin description somewhere on the disk ... but who was it from ... oh now i remember, it was from fremen (http://forums.qhimm.com/profile.php?mode=viewprofile&u=696) i think ... but also someone else decoded it.

so here should be the link to description
http://perso.wanadoo.fr/fremensf/forumff7/ff7hack/scenebinfileformat.pdf
and here some threads relative to it:
scene.bin compression (http://forums.qhimm.com/viewtopic.php?t=2699)
FF7's .BIN Format Spec (http://forums.qhimm.com/viewtopic.php?t=2113)
Can someone send me/upload the uncompressed scene.bin please (http://forums.qhimm.com/viewtopic.php?p=38266&highlight=#38266)
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-08 10:22:35
I have that in gears.

Someone has been decoded more than that. Lemme shake a contact and see what I can come up with.
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-08 10:35:13
mirex, that's just the basic monster data specification that's been translated (and some of us have had that basic data from memory for years; we just didn't know *where* it was kept since scene.bin was compressed).  I was hoping someone meant that they'd done some work on the *AI*, which is also kept with monsters, but with the basic specification, no information on that appears to be listed.

(I'm glad Fremen posted that Scene decompression program though; exactly what Skylark and I wanted in the first place)

And while I'm looking through Gears again, I might also note another mistake in the old copies of my Mech document: Hero Drinks don't multiply base damage by their percentage, they affect Atk and MAt by that percentage instead.  So they work exactly the same as they do for Def/MDf.  It's done at the same place though (when Small changes Atk to 0), so no reordering necessary.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-08 10:46:29
Oh Hi Terrence. I hope you didn't mind I shoved you doc into Gears. I did give it a bit of a facelift for readability...

Say, do you know there the 7777 check is made?

(If HP==7777 then damage == 7777)
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-08 10:53:20
No clue, and read above for what I said about Mechanics guide inserted into Gears.

I'd *assume* the 7777 check is one of the last things done.  Like, even after Element and the like.  I suppose it's easily checked though, but don't particularly want to play with Emerald right now.
Title: "Gears" - The FF7 Documentaion Project
Post by: Messiah99 on 2004-07-08 11:02:01
Quote from: halkun
Say, do you know there the 7777 check is made?

(If HP==7777 then damage == 7777)

Just a guess on my part, and I wouldnt know how to check and verify it just now, but Id imagine the Lucky 7s factor would be located near if not along with the other status effects. Just like poison drains HP every turn and small reduces the damage modifiers so that you can only deal 1, lucky 7s alters your damage to a flat 7777 every hit.

If the applicable files governing status change information have been figured out already and its not there however, I apologize for wasting everyones time reading this, haha.
Title: "Gears" - The FF7 Documentaion Project
Post by: mirex on 2004-07-08 12:56:41
Terence Fergusson: yup no work on AI ... i was looking through scene.bin only for monster info ... but i would be glad to see more from it ... especially monster attack strings and so on, to add it into Leviathan program.
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-08 13:05:56
Monster attack strings are easy; each ability has its own ID and name, and they're stored directly below the basic monster data.  AI data comes after the attack strings and attack data.  Or do you mean stuff like "Warning! Warning!" that Monodrive shouts?  Those type of messages are in the AI data.

Edit: Bored, bored, bored.  Downloaded a simple disassembler and am now tracking down battle mechanics code.  Found a few promising areas that might be related, so will work on translating them and see what comes up.  Probably nothing, but at least it's something to do and kinda fun.
Title: "Gears" - The FF7 Documentaion Project
Post by: mirex on 2004-07-08 13:08:49
i saw them there down below, but they are not every time at the same place .. i mean their position and stuff is not documented yet, and i didn't find it out too.
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-08 13:17:37
Their position is easily documented.  The list of IDs start at 0x840 in a Scene file (each ID = 2 bytes), and the names themselves start at 0x880 in a Scene file (each name = 32 bytes).  Which attacks an enemy uses is listed by their IDs from offset 0x48 in each monster data and continues for 32 bytes (so 16 different attacks maximum).  It's that easy.
Title: Result of Bored, Bored, Bored
Post by: Terence Fergusson on 2004-07-08 14:21:15
Hacked myself an All Lucky 9s: or rather, anytime a character has 9999 HP, they do 2345 damage ^_^  (They didn't do the 64 hit crazy thing until they were at 7777 HP though: that's a different check altogether)

Yeah, we love assembler.  Now I just have to backtrack through it all and work out what's stored where and finish off the basic damage code.  Fun.  Don't expect it any time soon... but the biggest upshot of all this is probably going to be quick location of the RNG.  And then the fun truly begins.

I should've done this YEARS ago... but then again, I didn't have as much *practice* with assembler YEARS ago.  (Blame FFTA.  The ARM assembler is one of the nicest things to work with o/~)
Title: Hey
Post by: Lord_Skylark on 2004-07-08 18:32:13
I just know awjile back when I first was looking through the AI very briefly that for The Jenova Synthesis and Bizarro Sephiroth that those battles call up only one enemy - like with synth is loads up the same enemy 3 times then chanages the stats of both of its arms. And in the AI I found the data where it at least alters it's HP - but I haven't looked beyond that.

But yeah, I know how the attacks are stored, but the AI tells exactly how the monster thinks on what attacks to use and stuff.

Since FF1 (which basically has no AI) and FF4 are the only two AIs I've worked on.....I imagine FF7's would be along the same lines, just more in-depth (and the FF4 one did take me a hell of a long time to figure out) But he's like examples of what I have never released from FF4 hacking I did...

156 - Gold Dragon
    If monster is confused
        1-Thunderbolt
    Normal
        1-Fight
        2-Lightning
        3-Fight
    If monster receives any damage
        1-Entwine

157 - Thunder Dragon
    Normal
        1-Lightning

158 - White Dragon
    Normal
        1-Fight
        2-Fight
        3-Fight
        4-Fight
        5-Fight
        6-Maelstrom
    If monster receives a summon attack
        1-Earthquake
    If monster receives a physical attack
        1-Slow
    If monster receives a fire attack
        1-Dragon Fire
    If monster receives an ice attack
        1-Snowstorm
    If monster receives a lightning attack
        1-Lightning

[easy ver:
[   Normal
[       1-Fight
[       2-Snowstorm
[       3-Hurricane
[   If monster receives a summon attack
[       1-Entwine
[   If monster receives a fire attack
[       1-Dragon Fire
[   If monster receives an ice attack
[       1-Snowstorm
[   If monster receives a lightning attack
[       1-Lightning

159 - Red Dragon
    If monster is confused
        1-Firaga (targets itself and its group)
        2-Fight (targets itself and its group)
    If monster is alone
        1-Fight
        2-Heat Ray
        3-Fight
    Normal
        1-Fight
        2-Fight
        3-Fight
          Fight

[easy ver
[   If monster is confused
[       1-Fire 3 (targets itself and its group)
[       2-Fight (targets itself and its group)
[   If monster is alone
[       1-Fight
[       2-Fight
[         Fight
[       3-Fight
[         Fight
[       4-Heat Ray
[   Normal
[       1-Fight
[       2-Heat Ray
[         Fight
[   If monster receives a summon attack
[       1-Needles (targets a monster)

160 - Behemoth
     Normal
         1-Fight
     If monster is alone & if monster receives a holy attack
         1-Maelstrom [easy: Hurricane]
     If mosnter receives any damage
         1-Fight
     If monster receives a magical attack
         1-Fight

~Sky
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-08 18:41:50
Yeah, that's the thing.  I've looked at FF6 long enough to understand *their* AI (there's plenty of documents on it around to learn).  So it was a *SHOCK* to look at the standard AI for, say, an MP (only has two attacks and no counters) and see it go up to 100+ bytes.

FF7 AI is strange, and until some basic commands can be pulled out, we're going to be stuck.  (Although getting stuff like the HP setting stuff from Jenova and the messages that appear from, say, Air Buster do help)

Anyways, I'm working on battle mechanics again, and having fun looking through the data (I think I found Goblin Punch's code just a minute ago), so... we'll see.

Edit: Decided to look at 1st Rays, since they're *definitely* one of the simplest enemies in the game (Shadow Maker's are a close second, but they have a few checks they need to do).  Code is, thankfully, simple:

00 00 00 52 70 23 00 12 70 20 02 A0 20 03 60 41 80 84 82 90 60 20 61 [17 01] 92 10 00 00 60 01 90 72 29 00 10 00 00 60 00 90 73

They only use one attack (Laser Cannon, but it's a silent use of it that never prints up the name) which has ID 17 01 (I've marked it in the code with square brackets).

I'm not ready to play around with it just yet and make comparisons, so I'm not sure where to start... *yet*.  Eh.  If I decide to work on it more, I'll post more, but until then....
Title: ...
Post by: Terence Fergusson on 2004-07-08 23:19:49
Well... I found the RNG.

It sucks.  And that's all I'm going to say about that.

Thankfully, some good came out of all this.  Nailed down Sadness' formula (Dmg = Dmg - [Dmg * 3 / 10]), as well as random variance (Dmg = [Dmg * (3841+Rnd(0..255)) / 4096]).  Saw some other interesting things that might be related to critical strikes... but... unsure.  Need to look into it some more, but that'll take time.

I think I'll look at stats, next, anyhow.  See what I can dig out there.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-10 05:01:46
Documenting the debug rooms are burning me out.  (>_<)

It's a neccasary evil as without them you loose a key map the the game system.

Also, it allows me to explore the opcodes. My current working theroy is that every opcode is used at least once in the debug rooms. If I need to experiment with the arguments of an opcode, all I have to do is alter the arguments is one that is already placed in a script, That just requires editing a few bytes with a hex editor and placing the field file back in the LGP for testing.

My current scedule is dumping a BLACKBGD* file's script and dialog, and comparing it to a debug document I have. I then document every script attached to a character and any significant init scripts for that field file. I also correct the debug document with correct functions (for example, change "does nothing" to "Does a SPECIAL (FE) that resets the global flags")  and put that in my doc.

I'm running into some brick walls.

1) Some of the debug rooms crash the script dumper, and I don't know which room it is then.

2) Many of these scripts are just JUMPMAPS to a particular part of the game. Once a JUMPMAP is compleated the debug room field is unloaded from memory and the map that was called is loaded an executed. Many of the JUMPMAPs have no location arguments causing the PC to be in a bad place where the new script won't execute correctly. Mapping the JUMPMAPS are causing me to burn out very quickly.

3) going through every character and matching the window with the dialog with the script name in 5 different windows is also burning me out.

I need some help so I can get this done as quick as possable. I would like to go onto finding out the script arguments next, but can't until all debug rooms are documented, the opcodes are found "in situ", and all the jumpmap map codes are properly linked to what field file they are. (I haven't even started that yet)

Anyone what to lend a hand? (See my updated GEARS doc for an example of what I'm doing)
Title: "Gears" - The FF7 Documentaion Project
Post by: Messiah99 on 2004-07-10 06:45:24
Well, not sure what I could do, as Im not really knowledgeable of most of what youre doing, but if anyones willing to hold my hand and walk me through a bit of the technique and get me up to speed, from there Im a willing workhorse. If noone else is able to help, and someones willing to show me what to do, Im always on my instant messengers provided Im online at the time (28.8k, gotta love it).
Title: "Gears" - The FF7 Documentaion Project
Post by: lasyan3 on 2004-07-10 07:27:43
Quote from: halkun
1) Some of the debug rooms crash the script dumper, and I don't know which room it is then.

I will take care of this :wink: . Which files are crashing ?
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-10 07:53:59
PC version:

blackbg1
blackbg6
blackbg8
blackbgc
blackbgd
Title: "Gears" - The FF7 Documentaion Project
Post by: The SaiNt on 2004-07-10 09:36:42
Quote from: Terence Fergusson
Monster attack strings are easy; each ability has its own ID and name, and they're stored directly below the basic monster data.  AI data comes after the attack strings and attack data.  Or do you mean stuff like "Warning! Warning!" that Monodrive shouts?  Those type of messages are in the AI data.

Edit: Bored, bored, bored.  Downloaded a simple disassembler and am now tracking down battle mechanics code.  Found a few promising areas that might be related, so will work on translating them and see what comes up.  Probably nothing, but at least it's something to do and kinda fun.



Hey, if you need to know some stuff about the executable, just PM me.
I've got A LOT of the executable documented due to my SECRET project.
Title: "Gears" - The FF7 Documentaion Project
Post by: lasyan3 on 2004-07-10 12:26:36
Ok, I have done some research on all the background files, so now let's make it clear once for all :
There are 20 BLACKBGx.DAT files.
--> Numbers A, F, G don't contain dialogs nor events (it's obvious when you see the size of those files : 2 ko).
Among all the others files :
--> Numbers 1, 9, C, E, J are not related with the debug room.
--> Numbers H and I perhaps contains commands for the debug room at the end of the script, but I am not sure.
--> All the others (2, 3, 4, 5, 6, 7, 8, B, D, K) contain events of the debug room.
Note : Numbers 1, 6, 8, C, D can now be opened by Hack7.
Title: "Gears" - The FF7 Documentaion Project
Post by: Topher on 2004-07-10 12:30:58
Is there a way to convert the PC data into PSX data so Hack7 will open it?
Title: "Gears" - The FF7 Documentaion Project
Post by: lasyan3 on 2004-07-10 12:36:33
It should be really easy, since the only difference between PSX and PC files are the header. I'll see what I can do. But with the current Hack7 you can't use pc files, 'cause it decompresses the files, and PSX files are compressed in a totally different way of the PC files.
Title: "Gears" - The FF7 Documentaion Project
Post by: Topher on 2004-07-10 12:57:22
-- Removed --

Lasyan3 just sent me one.

Thanks!
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-10 14:54:38
Would you mind making the PC reading version of Hack7 available for download?  There's a few scripts I'd particularly like to look at at the moment in order to get some game questions answered.

(Disassembly Update: Finished working on how stats are gained per level.  Now have full data on that, and proven almost without a doubt what the maximum and minimum stats each character can get is)
Title: "Gears" - The FF7 Documentaion Project
Post by: lasyan3 on 2004-07-10 15:27:54
If you only need something to read those files, you can use this prog I made for halkun :
http://the-afterm.ath.cx/script_dump.zip
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-10 16:02:08
Thanks.  Very nice program, just a shame it can't read the file I want.

The file I'm interested in is 'frcyo' (yes, I want to get at the chocobo breeding data; I've had enough with this part being such a mystery now.  I know how some things work, but I now want the code so I can decipher it and write up/submit a document based on it).  If you do ever manage to get it to read it, I'd be very interested in an update.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-10 16:10:29
The chocobo breeding data is in blackbg4. You can look at the pointing Tifa script (tift) and see how the data is accessed.
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-10 16:25:39
That just seems to be how to *access* the data.  It's *changing* the data I'm interested in (though the information was useful since it'll make it easier to track down what's what when I finally have the breeding script).
Title: "Gears" - The FF7 Documentaion Project
Post by: Topher on 2004-07-10 17:14:40
After poking around the source of Hack7 and playing with some PC files I managed to figure out how to tell how many events there are (it seems to be limited to 256/map) and how to list them all...

I'm still trying to figure out how to tell how many scripts there are per event, and how many commands there are per script...
Title: "Gears" - The FF7 Documentaion Project
Post by: lasyan3 on 2004-07-10 17:21:32
Quote from: Terence Fergusson
Thanks.  Very nice program, just a shame it can't read the file I want.

The file I'm interested in is 'frcyo' (yes, I want to get at the chocobo breeding data; I've had enough with this part being such a mystery now.  I know how some things work, but I now want the code so I can decipher it and write up/submit a document based on it).  If you do ever manage to get it to read it, I'd be very interested in an update.


I'll do something about this bug.
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-10 17:48:51
Thank you.  I appreciate it.

In the meantime, I guess I'll work on... huhm.  Not sure.  Maybe Critical Strike calculations... still got some unknowns there I'm interested in....
Title: "Gears" - The FF7 Documentaion Project
Post by: Lord_Skylark on 2004-07-10 19:23:01
THe program that I used to decompress the scene.bin file decompresses it so I can read the stats as hex and stuff, but it doesn't decompress the actual battle text/messages correctly. The enemy names and attack names view correctly, but the messages that monsters "say" don't.

Thanks,
~ANdy
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-10 19:41:49
Lord Skylark> It decompresses them fine.  That's exactly how it looks like in memory.  Hell, I was surprised when I saw that the enemy names and attack names were in full ASCII in the Scene.bin dumps; in memory, they're already converted into FF7's alphabet.

Text messages in the AI script are always prefaced by 93 and end with FF.  In general, 10-19 are the numbers 0-9, 21-3A are uppercase letters, and 41-5A are lowercase letters (it's just happy coincidence that the lowercase letters happen to coincide with standard ASCII's uppercase letters).
Title: "Gears" - The FF7 Documentaion Project
Post by: lasyan3 on 2004-07-10 20:35:08
I just remembered I had a document about file format for the PSX version. It describes the media files, such as movies, sound and 2D/3D graphics files. link :
Title: "Gears" - The FF7 Documentaion Project
Post by: Cyberman on 2004-07-11 00:15:33
Halkun: Don't download that file Laysan3 referenced it's something you've repeated asked not to see.

Thanks Lasyan3 although it doesn't have FF7 file formats in it per sea, it does have some of the formats prior to compilation by the tools Square made for there FF games on the Playstation.

I did remember what happened to the documentation I had, heh, I deleted it purposefully.

It was a long time ago.

Cyb
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-11 01:20:40
I can take a guess, I've seen the file offered to me many many many  before when I was making the PSX doc. It was one on my "hit list" of files not to download. Lemme guess, a PDF full of sony's file formats?

Actually, I remeber once I had Psy-Q offered to me a little more focefully than one would think was normal. That was just plain wierd. (I think I told that story)

This is a message that goes out to everyone....


Distrobution of Sony's propriatary documentation is a NO-NO!


Not only is it copyrighted by Sony, it also conatins information that could taint the reversing if the PSX datasets. Posting any Psy-Q related development docs stright from Sony is no different than posting an ISO of FF7.

Actually this is worse as it could invalidate any work done on the PSX data. Do not download this.

(Listens to the PSX reversers go "awww! Man!" as if I just took their candy away.)

I actually have legaly owned Sony's docs once upon a time. I used to have a PS2 Linux kit. Knowing sony, they probably put thier copyright notice on the second or third page like they did with the Linux docs.
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-11 01:36:29
Actually, I've changed my mind.  I'm going to work on the next best thing to Chocobo Breeding: Bone Village.

Was making quite a bit of headway... and then I noticed an undocumented bit in the If...Then code.  The script dumper always lists it as != value... but I don't think that's the case.  Looking at the value translated after the Then, it would seem that that number dictates what the comparison is (just like in Legend of Mana!  Hee!)  (00) is clearly the != expected... but (01) is definitely ==.  Not sure on the other bytes... but would like some feedback if anyone has a full list.  Otherwise, I'm going to have to guess, or something ^_^;

I plan to post the basic information on the GameFAQs MB (and here) once done.  Any conditions/requests for credit, etc, etc?  Otherwise, I'll likely just list you as 'respected people who gave me tools to dump out the script' when I make the GameFAQs post...

Edit: (09) and (0A) are clearly bit comparisons: (09) checks if the bit is not set, (0A) checks if the bit is set.  They're tied to the BIT-ON and BIT-OFF commands.
Title: "Gears" - The FF7 Documentaion Project
Post by: Cyberman on 2004-07-11 01:55:43
Quote from: halkun
I can take a guess, I've seen the file offered to me many many many  before when I was making the PSX doc. It was one on my "hit list" of files not to download. Lemme guess, a PDF full of sony's file formats?

mmm hmmm :)

Quote from: halkun

Actually, I remeber once I had Psy-Q offered to me a little more focefully than one would think was normal. That was just plain wierd. (I think I told that story)

This is a message that goes out to everyone....

I actually have legaly owned Sony's docs once upon a time. I used to have a PS2 Linux kit. Knowing sony, they probably put thier copyright notice on the second or third page like they did with the Linux docs.

I so wanted that when it came out, then I realized they had made it nigh unto impossible to do anything with it.  Sort of like carefully designing a vegetable so that you can't cook it or doing anything else with it other than wash and eat it raw.  I was so frustrated with that I decided not to waste my money on it. I wonder if there are any kits on EBAY now?  I should get the network device for the PS2 sometime (as I have cable DSL now).

Well it wouldn't surprise me if they seed the information on the net to nail people to protect there property.  I've nothing against Sony in terms of what's theres. The primary thing I have against Sony, is they tend to be hypocritical, about everything they do that is say one thing and do another.  Sony is very good at litigating, they tend to litigate everything.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-11 02:22:07
Going a little off topic.

I found the PS2 Linux kit very awesome tool when you realize what it's used for. I got rid of mine for reasons other than political.

Yes, you are not going to be able top make games for others to play. Not only that, Sony tells you right off the bat you are not going to make games that will likely be sold to companies. (Most if not all thierd-party developers only deveop in-house for legal reasons)

It was actully the 3rd party deveopers that demanded this, not the public at large. You see, that was happening was the new guys out of college were just having a bear of a time with the PS2. To say it's "difficult to code for" is about as much of an understatement as "outer space is big"

Companies were wasting six months to a year on training on each new deveoper, which was very expensive. They have new emplyees that really coudn't contribute to a project until they were up to speed.

This kit allowed for anyone to tweak under the hood. You gain valube experance so deveopers could hire "right out of the gate" also they didn't have to comb schools. Anyone who consistently produced good code would be considered.

I got mine so I could learn OpenGL and work real close to the metal of a honest to god gaming system legaly. I also wanted to support Sony for making the choice to use linux.

However, I was slammed by the architecture. I knew the PS1 was was very unprepaired for what a PS2 had under the hood. It wasn't a PS1(+1) it was a new Sony system with a ps1 inside it. (Which was locked out, BTW)

That thing has SIX co-prosessers that all had to share a super wide, propritary, 4,096 bit bus in perfect time or the whole graphics subsystem would smash.

What irked me was Sony said it came with OpenGL libaries and it came with MESA that rendered in Software only. Watch gears run in 245 FPS..... ooooh! (It should run 10000+ on accelerated hardware)

It was just too hard. I was plannang on porting epsxe to it (Not as stupid as it sounds) but the way the PS2 was built was so knorked up, I gave up and sold it. I should of at least kept it so I could hack the memory cards, but I had recently quit my programming job, (Yes, I was a paied Linux programmer) and never touched software deveopment again.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-11 04:11:09
Not exactly a dumble post: I need some information...


Which debug field file is Kitase's? (That's the north one with the shiny Aerith and the half-blue Cloud) I can't seem to find that one.
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-11 04:13:27
Hee.  Been doing a lot of work tonight.

Plot Progression Byte (Word, actually)!  FF7 uses a counter that stores where you are in the basic linear plot.  Here's a few sample values:
03F0: Meteor first appears in the sky
04AD: Cloud and Tifa are found in Mideel rubble (after Cloud recovers)
056F: Bugenhagen takes the Huge Materia from you
0635: Hojo prepares to fire Sister Ray
0644: Right after Hojo's defeat
0654: Disc 3 has begun

No optional stuff are stored in this variable, since it's a purely linear counter.  If you've gotten to a certain number, then you've passed all the points before it.  The address of this variable in the script dumps is referred to as (20)[0000] (it's set via SET-WORD ( 20, 00, <word value>))

Also, I've managed to crawl through most of how Bone Village determines the *exact* prize you get... now I just have to work out how it determines the rough prize category you get.  That's going to be interesting...
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-11 12:06:39
This is interesting. I wonder how many globals dees the engine have? 256 Longs?

Oh BTW, I'm done with the debug rooms. They arn't as complete as I would like them, but they are mapped. I'm going to start on decrypting all the opcodes as soon as my head stops swimming.

(Download updated Gears with my WWW button)
Title: "Gears" - The FF7 Documentaion Project
Post by: Alhexx on 2004-07-11 15:22:59
I never though that we (or better YOU) have made such a progress in FF7 hacking... it seems like there are a lot of things already hacked here, which I didn't even know they exist... :o

 - Alhexx
Title: "Gears" - The FF7 Documentaion Project
Post by: Cyberman on 2004-07-11 16:05:30
Quote from: Alhexx
I never though that we (or better YOU) have made such a progress in FF7 hacking... it seems like there are a lot of things already hacked here, which I didn't even know they exist... :o

 - Alhexx

Deviation from topic
Alhexx there is this black hole out there that represents what one doesn't know.  The problem is the more you learn the closer you get to it, and you realize really how little you do know ;)
End Deviation

I feel like Mandelbrot suddenly

If you think it might be helpful I can work on a tool for scripting in FF7.
The big deal would be syntax (as I would use a syntax highlighter), would you say that FF7' scripting was C like or something weird? (I fear the later is most likely   :roll: ).

Cyb
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-11 22:54:42
The only thing I have is opcodes. A language sentax will have to be created. I would adore to see what the original scripts looked like. I'm still trying to figure out how to express the arguments Do I use hex? Decmial? Should I use C style and start naming variables and then create an #include file. (This is how the infocom compiler "inform" works)

Sierrra used a scripting language for thier adventure games, but you could always look at the sentax in the game itself.

Hmmmm
Title: "Gears" - The FF7 Documentaion Project
Post by: Topher on 2004-07-11 23:00:41
FF7's scripting language is more like ASM than C/C++, however if you were willing to spend some time, you could make a program that decompiles the script into a C/C++ style language and then recompiles it when you save.

Also Halkun, I see in your doc you have:
Quote
3. No (野) - Itsushige Nojima (野島一成)

The correct translation is actually Kazushige Nojima.

Technically, Itsushige is right, too (same kanji), but it should be Kazushige.
Title: "Gears" - The FF7 Documentaion Project
Post by: Goku7 on 2004-07-11 23:50:30
Hey, regarding the decoding of the in-battle text messages....any chance that one of you can edit the ones used during the first boss battle of the game?  I think there's a typo in this message:

Cloud: "Attack while its tail's up!"

Now, correct me if I'm wrong, but shouldn't Cloud say "Don't attack while it's tail's up!".....?

Just wondering if that's always been a typo or if they meant for Cloud to tell Barret to attack despite the Tail Laser counterattack.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-11 23:52:53
Going through the same's scripts, you discover there is *a lot* of typeos in the game.

That's just one of many.
Title: "Gears" - The FF7 Documentaion Project
Post by: Topher on 2004-07-12 00:01:18
It says:

"Attack it while it's tail's up"
"It's gonna counterattack with it's laser!"

In two seperate lines.

It should say "If you attack it when the tail's up", "It'll counterattack with it's laser".
Title: "Gears" - The FF7 Documentaion Project
Post by: Cyberman on 2004-07-12 00:13:56
Hmm Ok.. I suppose we could make up a syntax then..
C would be a good start I suppose as well.

Well I would not call it like assembly as it's compiled, it's more like JAVA in that respect ;)
Irregaurdless of that, what type of parameters do the scripts accept?
IE
1 byte
2 byte
4 byte
operands?
Anything unusual like strings?
Does it accept pointers if so what kind of pointers?
File names? etc.

If it uses for example pointers to names and scripts etc. I would be more inclined to use C for the base of the scripting language. if it passes strings directly then I guess 'C like' is not likely what it was like ;)

C like is probably a good starting point actually :) It's the most common denominator.
Disassembly of the script into a C like syntax I do not think will be too difficult.
Compiling new scripts is a horse of a different color however :)

Cyb
Title: "Gears" - The FF7 Documentaion Project
Post by: Terence Fergusson on 2004-07-12 01:20:11
Trust us when we say it is *VERY* like Assembly.  It certainly doesn't seem to have as many compiling artifacts as the FF7 executable appears to have, at any rate.

It wouldn't surprise me if the scripting 'language' they used was just a straight 1-to-1 translation of commands into the relevant opcodes:
If [Global Var] >= 220 Then Goto [Label] instantly compiles into: 14 [Global Var Address] DC 03 [Offset to Label].  This isn't exactly all that different from compiling assembler into machine code... hell, most assemblers support labels at least, if not variable names.

What I'm looking forward to at the moment is getting a script dump of the Chocobo Breeding stuff, since there's going to be some interesting variable manipulation there, which should help nail some more opcodes (as well as help me figure out a part of gameplay that hasn't been fully documented for years).
Title: "Gears" - The FF7 Documentaion Project
Post by: Goku7 on 2004-07-12 02:09:46
Quote from: halkun
Going through the same's scripts, you discover there is *a lot* of typeos in the game.

That's just one of many.


Yes, but I thought that the PC version (which is what I was refering to) had most if not all of the typos fixed....?

Regardless, the point remains that this is one of the typos that slipped through the fingers of both development teams.....and its one that always kinda struck me as odd, that's all.
Title: "Gears" - The FF7 Documentaion Project
Post by: Cyberman on 2004-07-12 04:14:02
Quote from: Goku7
Quote from: halkun
Going through the same's scripts, you discover there is *a lot* of typeos in the game.

That's just one of many.


Yes, but I thought that the PC version (which is what I was refering to) had most if not all of the typos fixed....?

Regardless, the point remains that this is one of the typos that slipped through the fingers of both development teams.....and its one that always kinda struck me as odd, that's all.

All things considered, I don't think they spent a whole lot of time fixing bad translations etc.  I think they like Alhexx were lazy programers (laughs). :)

Cyb
Title: Book Marks!
Post by: Cyberman on 2004-07-19 17:11:25
Halkun
Since you are exporting to PDF is it possible you can add book marks to the Gears Documentation you are making?
Or.. at least an index would be handy.  

Call me lazy I donno  :lol:

Cyb
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-19 17:39:58
The table of contentets are in a state of flux right now. (And horrably outdated) I need to move file formats into kennrel and make a better appendix. I'll look into how to export them using openoffice.....
Title: "Gears" - The FF7 Documentaion Project
Post by: Cyberman on 2004-07-19 20:10:44
Quote from: halkun
The table of contentets are in a state of flux right now. (And horrably outdated) I need to move file formats into kennrel and make a better appendix. I'll look into how to export them using openoffice.....


Ahh I noticed you don't have the OpenOffice doc available anymore hmmm, how do you export to PDF? Using GhostView?

Ahh cool, I believe the BCX and Battle model information for the PS1 is getting close to being deciphered to the point of documentable.  However I need to rewrite a large amount of code for this as it's currently thin pasta mixed with meat sauce (spagheti in otherwords)i

If you have been watching 'The Repository' Pixel has a new PCSX binary with built in debugging, although not terribly interesting in it's own right, I have made steady progression in getting a debugger interface working friendly like with it.  At first it might seem like a trivial and pointless thing to say, however I expect by the end of the week to be able to find out what's going on with the various data files in the playstation version with it.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-07-19 22:35:15
I export PDFs using Openoffice, there's a button thingy that does it automagiclly. I have recently spied a bookmark button I'm going to try out just to see if it exports bookmarks to PDF or not.

::EDIT::

Nope, I can't find an obvios way to export bookmarks. I'll have to dig deeper when gears is nearing compleation or becomes to unwieldy when I write it.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-08-01 21:01:10
It time for my weekly update. Just thought I'd annouce an new gears is ready for download (WWW Button).

New This update:

1) Reworked the Table of contents a little. I need to try and keep that in line with the rest of the document

2) Fixed bad grammer/spelling errors I cought

3) Moved File formats up to Kernel and moved on. I also added RAM and VRAM management. It's missing information on the SEQ format, PSX model format, and other odds and ends. (sound, for example) Anyone who has has up to date, non sony related information on these, I would like that. It has enough information in there to have novice hackers start in on some of the common file formats.

4) Cleaned up MENU, I'm missing the difference between the PSX and PC versions of a save header file. I only have the save map that's saved from memory. I shall call that "DONE" as I can't decrypt the .MNU files, however I don't like it's astetics. Is there a better way to orgenize the menu pictures?

5) I have FIELD all set to start doing my data dump into. I have a really kick-butt VRAM image of a field file that I"m going to be using as an example.

I'm keeping all the generic file formats in KERNEL and andything special will go into ther respective module. I'm wating on Qhimm's work on the scripting language before I write anything concrete on that. I'm also waiting for cyb to finish his PSX model formats so I can toss them in as well.

Terrence is working on Scene.bin's logic system. That can go in to.

I would really like some comments on how it's coming along. My next major cosmetic thing I'm going to do is add dynamic page numbers as a footer and a header at the top to make it look more professonal.

I'm sorry, I can't add bookmarks to the PDF. I'm going to need someone with acrobat to do that for me when Gears nears compleation.
Title: "Gears" - The FF7 Documentaion Project
Post by: Vanit on 2004-08-15 01:17:27
"3.1 Model Formats for PSX" is in latin or something.... why isn't it in english? :/
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-08-15 02:03:32
It says this.

Quote

"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?

On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.



go to http://www.lipsum.com/ for more information on why this is relevent to FF7
Title: "Gears" - The FF7 Documentaion Project
Post by: blackeyed_cn on 2004-08-15 17:32:13
why can't I download it? :(
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-08-15 19:17:01
did you click on my www button? it's there when I clicked on it.
Title: "Gears" - The FF7 Documentaion Project
Post by: blackeyed_cn on 2004-08-15 19:22:03
Quote from: halkun
did you click on my www button? it's there when I clicked on it.

I clicked,but can not open that page,I donot know why,Am I the only person which can not open it?
I hate Chinese network service :(
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-08-15 19:27:28
They probably have a blanket ban on the .cx domain. Can you see my avatar? If you can't then it's the filter on your side.

It might also be that I get my internet through Yahoo, which carries American news too.

Can someone post a copy of gears for blackeyed_cn so he can get it around his rather unpleasent system admin issue?
Title: "Gears" - The FF7 Documentaion Project
Post by: blackeyed_cn on 2004-08-15 19:46:43
Quote from: halkun
They probably have a blanket ban on the .cx domain. Can you see my avatar? If you can't then it's the filter on your side.

It might also be that I get my internet through Yahoo, which carries American news too.

Can someone post a copy of gears for blackeyed_cn so he can get it around his rather unpleasent system admin issue?

Our government do not allow us to know much about American news...
I can't see your avatar...
Any one help me?
Add my MSN: [email protected]
send it to me plz :)
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-08-15 20:25:10
I run linux, and don't have much in the way of MSN. Can someone else?
Title: "Gears" - The FF7 Documentaion Project
Post by: blackeyed_cn on 2004-08-15 21:14:36
Quote from: halkun
I run linux, and don't have much in the way of MSN. Can someone else?

M4v3r have sended it to me,thx again
Title: "Gears" - The FF7 Documentaion Project
Post by: Cyberman on 2004-08-16 00:14:03
Quote from: Vanit
"3.1 Model Formats for PSX" is in latin or something.... why isn't it in english? :/

Ummm because it's not really there, Halkun put filler information in instead. He's crafty that way. Why not try reading the threads in the forum? There are a few of them here explaining the various model formats and discusing them. This thread (http://forums.qhimm.com/viewtopic.php?t=2519) in particular (which is rather active) has the FF7 battle model format, as the format is known and discused a lot in the thread.  The animation data, which will allow the whole model to be viewable, is the missing link thus it will not appear in gears for a while. Sorry can't hand you something on a silver plate there dude.  :lol:

Also note you will see that latin text wherever the information is not known or incomplete at best in the Gears Documentation.  I'll also note that all the models are compressed so you need to uncompress them before being able to use any of the data as well.  Look around this forum as there are PLENTY of references and information regarding the formats on the PSX version of FF7's various model files.

Cyb
Title: "Gears" - The FF7 Documentaion Project
Post by: blackeyed_cn on 2004-08-16 04:47:37
OMG,The Gears is so wonderful...are you finish it by yourself??
But why it is a pdf instead of a doc?
U know,My english is very poor,I read english material with the help of the translation software,but it does not work at pdf :(
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-08-16 06:13:29
I exported a .doc version of Gears and it's with my pdf

Can somone download it and send it to blackeyed_cn for me.

It's at the www button too.
Title: "Gears" - The FF7 Documentaion Project
Post by: mirex on 2004-08-16 07:49:39
Quote
"3.1 Model Formats for PSX" is in latin or something....

Halkun maybe you should add some informative first chapter to the gears 'Why are there some parts in latin' to make it clear.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-08-16 08:02:59
When Gears is done and goes "Live", it won't have any latin in it. It will also have bookmarks, and an intoduction which I traditionally write last. Anyways, I like educating people on Lorum Ipsum. It's intresting to me.
Title: "Gears" - The FF7 Documentaion Project
Post by: blackeyed_cn on 2004-08-16 12:06:14
Quote from: halkun
I exported a .doc version of Gears and it's with my pdf

Can somone download it and send it to blackeyed_cn for me.

It's at the www button too.

Now,I can download and see your avatar  :D
U look pretty COOL~
Many Thx!
Title: "Gears" - The FF7 Documentaion Project
Post by: sfx1999 on 2004-08-16 22:18:31
Hey Halkun, Gaim supports MSN messenger and AIM. Also, that one project that used to be called Everybuddy did, too.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-08-16 22:25:36
I don't IM.... I bearly IRC. I also have a firewall that's pretty hostile to bi directional file transfers
Title: "Gears" - The FF7 Documentaion Project
Post by: sfx1999 on 2004-08-16 22:30:31
It's not like you can't disable the firewall on certain ports or forward them. It sounds to me like your just lazy.

Just open up your Linksys router's thing and forward those ports. It's easy.

And if you have one built into Linux, I just have to ask why you would need one. It's not like you are using it as a mission critical server, and it is not like someone will just hack your computer for no reason. Plus they'd have to break root, and you should be abls to spot that if you are the Linux guru I think you are.
Title: "Gears" - The FF7 Documentaion Project
Post by: Vanit on 2004-08-18 10:53:30
I was actually hoping to find some info on how the field model data was stored etc so I might have some hope of 'porting' my Hi-Res Cloud patch to the psx version. I actually taught myself how the pc version stored the models and I worked out everything for myself (more extensively than documented in gears in some areas)... I was too lazy to look up the current documentation. Thanks for the info though, I'll poke around the forums a bit more thoroughly when I have some free time.
Title: "Gears" - The FF7 Documentaion Project
Post by: blackeyed_cn on 2004-09-19 10:34:42
Is there a complete version about script commands?
Now it only explain a few opcodes,such as RET...
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-09-19 13:47:33
Qhimm was working on them. I didn't want to duplicate the work.
Title: "Gears" - The FF7 Documentaion Project
Post by: blackeyed_cn on 2004-09-19 14:30:51
And....
I can't get the Script Dump from
http://the-afterm.ath.cx/hack7_en.zip
http://the-afterm.ath.cx/script_dump.zip
I do not think it is my network problem
Did u delete them?
How can I get them now?
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-09-19 15:31:33
Oops those were lost in a recent hard drive crash.... I looks like I lost more than a few config scripts.
Title: "Gears" - The FF7 Documentaion Project
Post by: lasyan3 on 2004-09-20 05:32:00
Quote from: blackeyed_cn
And....
I can't get the Script Dump from
http://the-afterm.ath.cx/hack7_en.zip
http://the-afterm.ath.cx/script_dump.zip
I do not think it is my network problem
Did u delete them?
How can I get them now?
Here :
http://lasyan3.free.fr/mytools/hack7_en.zip (http://lasyan3.free.fr/mytools/hack7_en.zip)
http:///lasyan3.free.fr/mytools/script_dump.zip (http:///lasyan3.free.fr/mytools/script_dump.zip)
Title: "Gears" - The FF7 Documentaion Project
Post by: blackeyed_cn on 2004-09-21 14:09:51
Quote from: lasyan3
Quote from: blackeyed_cn
And....
I can't get the Script Dump from
http://the-afterm.ath.cx/hack7_en.zip
http://the-afterm.ath.cx/script_dump.zip
I do not think it is my network problem
Did u delete them?
How can I get them now?

Here :
http://perso.wanadoo.fr/lasyan3/mytools/hack7_en.zip
http://perso.wanadoo.fr/lasyan3/mytools/script_dump.zip

Here,I have some problem with these two tools.
Does hack7 only support PSX version?
And I can only open a few files with script_dump
when I try to open some file,it shows:
http://photoimg4.qq.com/cgi-bin/load_pic?verify=TsLSttO5p3m5M%2BQVFvlnrA%3D%3D
I can not read it....I do not think it is English....
Some times,it works a while and show:
http://photoimg4.qq.com/cgi-bin/load_pic?verify=NyAlcBivdMEeLZ8FThYV0w%3D%3D
I want to know is it my computer or file problem or your tools problem?

Here is text problem:
http://photoimg4.qq.com/cgi-bin/load_pic?verify=c04GwUWuJuukpQ4i8JC0cQ%3D%3D
but it is okay,I have wrote a program to edit text
http://photoimg4.qq.com/cgi-bin/load_pic?verify=XRk2JGvIZE2KEOWJo2wgrA%3D%3D
but there still something wrong with script I dumped:
http://photoimg4.qq.com/cgi-bin/load_pic?verify=11YOC4uQq1tM37uk7rrpCA%3D%3D

I know my questions is too much.... :D
If I have bothered anyone here,I say sorry :D

Mad edit: pictures too big...
Title: "Gears" - The FF7 Documentaion Project
Post by: lasyan3 on 2004-09-21 18:28:04
Unfortunately, hack7 does not support pc version, only psx. BUT script_dumper does support both pc and psx version, you can choose between them.
About the "Zut, encore un" dialogbox, it informs me that the file you are trying to open does not contain important information the program need to correctly open this file. So I have to open manually the file and add its support in the source. It's done now, you can download again the prog (if you find others files with the same problem, please tell me).
About the "violation d'accès" crash, it can come from my prog or your computer (I didn't test my prog on a chinese computer, sorry ;). You can always send me some files who make the prog crash and i'll take a look.
Title: "Gears" - The FF7 Documentaion Project
Post by: halkun on 2004-09-22 07:59:58
Qwerty, You know, you should consider yourself incredably lucky..

I wholly admit I seem to hung myself on my own pretard for leaving that picture in my avatar directory on accident.

Having said that..

1) This did not belong in tech related, and offered nothing to the conversation.

2) Whenever you see a security flaw, with data left in the open, *ALWAYS* contact the server admin first. If it is ignored, then get thier attention.

3) Rooting around on a mod's hard drive, even if it's as trivial as removing a file name end exposing the underlying directory, is a pretty dumb thing to do.

Two warnings issued. You are lucky I didn't ban you.
Title: Filed animation file reserved1
Post by: Kero on 2004-09-24 11:48:43
Hello, could you add this to gears? Well adjust what is needed, I dont know
wheather it works on others models than I tried, it was only few.
typedef float vec3f[3];

typedef struct {
  U8   res0[4];
  S16  frames;
  S16  res1; //maybe frames if S32, I have no idea
  S16  bones;
  S16  res2;
  U8   res3[24];
} aheader;

typedef struct {
  vec3f  res[2];
  vec3f *data;
} aframe;

vec3f res[1] is vector you shoud move center of object in order to keep it "in right shape". Well bad expression. While *data are here to rotate joints between bones, res[1] is to adjust position of model according to rotations of bones, in order to example keep foots on floor.
Good example: aja.hrc - chocobo  from world and asc.a animation from world_us or something like that. In ilfana you can see, that chocobos foots dont stay on one place and moving themself. If you move center of body, root, in frame i about vector res[1] then it will stay still.
Well as you can see difference between standing chocobo on the worldmap and between ilfana.
Sorry for such a long text to express something simple.