Miscellaneous Forums > Scripting and Reverse Engineering
How Final Fantasy field stuff is done.
halkun:
I have this book called "The Complete Works of Final Fantasy" It was written by Hironobu Sakaguchi and gives some real good insight into how Final Fantasy works. That and also some snippis of code and some stories from my old contact from square, I can put togeather how FF7 was made.After the story is written, the whole game is put out onto a storyboard. Then each and every scene is sketched out and the dialoge is attached to it. Let's take a look at the bery beginning of the game, as this has every single part of the engine in it. Here's a review.You start the game, and you are treated to a little moviewith music, you see areith, pan back, long shot from the left, she turns, and starts walking. Pan out to the street, up and out, pan, pan, pan, pan, then the logo comes in on time with the music, pan in, pan in, train, pan in, train, pan in and you see the guards the train pulls in, stops, the good guys come out fihgt, cloud comes out last, barret turns, "'come on newcommer, come with me" he runs off. You follow. two guards come out, fight, then to the next screen, some dialog, you name youself, jessie open the door. Another movie pan, and you go forth.I know this is long-winded but let me tell you what's going on behind the scenes.You start at the title screen, with the sword, and select new game. Now the title screen is "outside" the main engine. When you start the game the loads the first "field" file. The field file (who's name escapes me for the moment) is really a script that the engine uses to tell the story, not just the speech but what the characters do.The first field files tells the engine that it needs to load the opening theme, opening movie, the first poly cam pan for the guards, the npc models, the character models, the solders, the bone movement, background, and the speech script.The field file starts the music and streames the movie. Now all the dependncies are loaded into memory, and the CD-ROM is busy so don't count on it loading anything. Now on the PSX version, when the camera is panning in and you can see the train below coming into the station, the color depth drops from 24 bit color to 15. The cam file is then started and the guards are placed on the "ground" ontop of the movie in every frame. As the train comes to a stop at the very last frame, it is replaced by a static "field background" made up of two layers of 128x128 square blocks. (or is it 32x32) the lower layer is the "ground" and the ipper layer is theing that the character can be obcured by.The scene acts out using a script in the field dir of that moves the characters and the barrett says his dialog. WHen you move you hit a trigger in the field file that makes the guards come out. There is a fight. AFter the battle the computer loads a *deffernt* field file. This one has no script and and exit to *another* field file.Upon exitin the first screen the old fild file(s) get dumped and new data is loaded. Now bacground, new characters, the door that jessie opens, another cam file for the pan behind cloud, and another movie is readied to be streamed. (because it's with polys it's 15 bit) You talk to the right people, certian triggers are trpped to make them say things, and to change your names. then the script follows through by moving the door, everyone running through, and then the movie sreams with the cam overlay. cloud runs off and aonther field file is loaded in the nex scene.Every field file has a scene in it (Think about it) each field file points to another and togeather the script makes a story. crack the field file format, and you have a new game.***** The debug rooms *****This thing is a huge field loader. This is where you test your fields after they have been compiled, and also test each aspect of the engine. The trigger room (The one with the big airith) the cam room (The one with the people lineed up in a square so you can see the camera axis during the movie) and the battle room with the monsers with exactly 10,000 (1000) health and even starts so you can test weapon/armor math so it all works out. If you want to crack the script, crack the debug field files. I think I've rambeld enough I'm going to bed now.-Halkun
Joey:
Halkun! my mentor!!!!! HeheheheheWell, you do know a lot of stuff. I bow to your wisdom......(Qhimm said this last time, didin't he?)Well, could you please tell me about what's going on with FF9 now that I don't work with Square anymore.Sorry, Qhimm for the messages. there is something wrong with my internet connection lately.
The Skillster:
halkun, your theory is sound, but i can tell you that text from the debug room =s doesnt ONLY resdie in the blackbg files, for instance open md1_1 this is the very 1st scene on the station platform. open it in cosmo, look at the huge amount of MISC TEXT most of these are lines from the debug room, some other scenes hold stuff too. I assume the blackbg files ALSO contain the background pictures for some of the debug rooms too.
Qhimm:
I haven't had the possibility to work much with FF7psx, but IIRC the field background tiles are 8x8 each (on PC at least).On the PC version however, the field files are (as you all know) combined into field archives (they're separate files on PSX). But, since the same field background never (well, rarely) occur twice, I'd say that you don't "switch" scenes every time something changes in the game, but rather that the individual elements are controlled by the story flags. For example, when you fight the two guards, the trigger is deactivated using a flag but the field file is still the same. Again, this is based on my experience with FF7pc, so don't take my word for any of this for FF7psx.
halkun:
Sometimes I wish I didn't play with the PSX version so much, it's hard to tell where the PSX stuff ends and the PC stuff begins. Let me therorise something and see if this makes any sense.
Ok, let's pretend we are a storyboarder for FF7. We have this wall with every backgound sketched on an 5x9 card with a little "what's happening in this scene" written on the back of it. We have just finished making the storyboard and and all the cards are in order from the beginning of the game to the end. Each card represents a field background too.Ok so we take a card, lets say the scene where aeirth and cloud have the conversation infront of the big wall and the chocobo carrage comes in, turns to the right, and tifa is there. We give this card to a field programmer who gets the models from the modelers and the background from the background renderers. He follows the script written on the card and makes the scene. He then puts "exit triggers" on the scene (You see them when you push the select button, the red triangles showing where you can exit) attaches something like, "when cloud goes off the screen to the right, load the first wall market field and execute" I stand corrected, after the scene is ran when you enter it for the first time, is is placed in an "inactive" state so the whole scene doesn't replay itself when you enter it again, but you can still walk through it. Whenever you enter any field file an inital entry script will play. The upshot is that the field files are interpreted I know that as a fact. I postulate that blackbg is actully executed at the beginning of the game (During the back background before the movie starts) . At the very beginning the interpreter reads "If the debug flag is set, link up the debug dependcies and execute the debug room, if not, execute this scene here"Makes sense, you don't want to swap out field files every time you needed to debug something. Just lump the debug roooms in with the first scene, you know that even if the story changes, that scene will always be first and you don't need to swap *that* put with anything. I have a better idea! Ok, at the way beginning of the game where you can select "New Game" or "Continue" I bet dollars to douhnuts that the debug verson had the same thing, but had "debug" and "continue" This will load ou blackbg like it would for the normal verson of the engine, but execute the debug room, not the beginning scene from the same field file! Notice that the debug room has no backgrounds attached, I bet field files can handle only one bacground at a time, on the background for the debug room od the opening train station.Makes sense, FF8 could have up to two backgrounds pre-loaded, thats why there is a background on the floor of the ff8 room, the other background is probably the nurses hospital bedI have to study japanese now. bah what do you guys think?-Halkun
Navigation
[0] Message Index
[#] Next page
Go to full version