Author Topic: Scene Editors all buggy ?  (Read 8336 times)

Salk

  • *
  • Posts: 609
    • View Profile
Scene Editors all buggy ?
« on: 2007-01-15 04:51:24 »
Hello!

In order to tweak items carried by monsters, I used Scene Explorer and first Scenester and then Scene Edit with the same buggy results.

If I change items carreid, the encounters will all become screwed up as reported here:

http://forums.qhimm.com/index.php?topic=6238.25

A quick way to see this is to change Tonadu, scene 59 by deleting one of the two items he carries. Doing that, the first fight scene at the very beginning of the game becomes against a Hell Hound instead of the two Shinra Soldiers like it should be.

Can anybody be of help here ?

First, I thought it was a bug in Scenester. I repeated the experiment with another Scene Editor and the result is the same. Now I might start suspecting the Scene Reader program itself unpacking and packing again the Scene.bin file.

If anybody has any idea about how to check this or if anybody has had successful experiences tweaking the monsters' items, I would love to hear from him.

Thanks for your patience!

Salk

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
Re: Scene Editors all buggy ?
« Reply #1 on: 2007-01-15 06:24:40 »
Hi,
I don't remember there being anything wrong with the Scene Packer/Unpacker software.
The known issues with one of the programs was the fact that if you changed any of the items won or stolen they would all default to Potion regardless of what you saved. The other editor incorrectly labelled the Enemies Element strengths and weaknesses.

Sorry I do not remember which is which.

Best advise is to grab a hex editor, open the scene file you want to edit and search for the monster's name (remember that FF7 doesn't use ASCII for text, so try searching for onadu instead of Tonadu. When you have found the section (use wiki.qhimm.com to help you) make a copy of the scene file.

Now make your changes and compare the two. You should be able to tell what changes were made, if not post the portion that has changed here and we will try to help.

Sorry I didn't explain everything in detail because I hope it will encourage you to do some reading up on the Scene files themselves.

Salk

  • *
  • Posts: 609
    • View Profile
Re: Scene Editors all buggy ?
« Reply #2 on: 2007-01-15 13:49:49 »
Thanks for your answer, The Skillster!

I am a computer illiterate but I will try and make good use of your advice.


Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Scene Editors all buggy ?
« Reply #3 on: 2007-01-15 17:04:33 »
Which version are you working with? PC or PS1?
Are you refering to battle scenes? (sounds like it)

(PS1) IE SCENE.BIN in \BATTLE ? or on the PC (not sure but it's not in the LGP archives I believe).

Skillster isn't SCENE.BIN compressed in sections using LZS?

It's been a long while since I've meddled with that :)

Cyb

Salk

  • *
  • Posts: 609
    • View Profile
Re: Scene Editors all buggy ?
« Reply #4 on: 2007-01-15 18:33:52 »
I am working on the PC version of Scene.bin.

Better said, I would like to work on it because I don't really know where to start.

I checked the Wiki here http://wiki.qhimm.com/FF7/Battle/Battle_Scenes and I must thank people that put up a big effort in this although they recommend to edit the Scene.bin through a scene editor (but my problem is that those editors don't seem to be reliable at all).

I also downloaded a free Hex Editor and I am totally lost just by looking at the endless sequence of numbers as I open Scene.bin...

I will try my best to understand how it works though. Thanks for your interest!

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Scene Editors all buggy ?
« Reply #5 on: 2007-01-15 20:37:07 »
The reason why the recomend a Scene editor is that if you read this
Overview

The scene.bin file contains 256 gziped files which give us information for all the FF7 monsters. In order to find these files in scene.bin, you have to know that the file is structured with blocks exactly 0x2000 bytes in length. In the first table (scene.bin block), you will see what contains a block. Blocks are concatenated with each other to form the scene.bin file. So if you want to extract data from scene.bin, you'll need to find the correct blocks and to extract the gziped files from it. After that you simply ungzip those files and you'll find 256 files, with a length is 7808 bytes. Known information about those files can be found in the second table (The Data File specification). Because extracting file manually would be a pain, several tools was developed in order to help you. You can use SceneExplorer (http://elentor.com/Projetos/FF7-Tools/Extracting/SceneReader.zip) for example, it's a win32 tool to extract and repack scene.bin archive.

You'll notice it's a very specific format and you cannot hex edit the data directly (since it's compressed).  I suppose it's high time this become part of Q-gears needs (IE scene.bin reader for the battle module).  Well as it says you will need to manually extract the files (all of them) then repack the entire file. This is why Scene editors exist (because it's a big pain to do that).  ALSO note that the game itself might be the buggy results you are getting. It has some internal sanity checks in it's engine so be warned.  If the results are consistantly the same. (You should specify what the problem is just to see if it's something you can't do in FF7).

Cyb

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
Re: Scene Editors all buggy ?
« Reply #6 on: 2007-01-15 21:14:03 »
SceneEdit had the Potion Item bug and Scenester had the Element property bug.

Yes scene.bin is compressed and you use Scene reader to uncompress it into about 200 or so "scene files".

Once you have those these are all raw and can be opened and examined in a Hex editor.
If you read the Wiki carefully you will understand that there is sort of a Table of Contents in the Heading of a scene file.
But in the wiki it should also tell you where a certain "section" begins. IE:

Look at this page:
http://wiki.qhimm.com/FF7/Battle/Battle_Scenes

See the heading Data file format?

That is your reference to what is where in the Scene file.

Each type of enemy in this scene file will have its own ID(s) and it's own section in the scene file.
These sections contain specific statistics such as the Enemy Data section.
There is a section which lists all the Attacks for the enemies in this section.
And so on.
Once you have made your changes you can use Scenereader to pack up all your scene files back into the scene.bin file ready for use in FF7PC.

For more info on the Enemy Attack info look at my topic here:
http://forums.qhimm.com/index.php?topic=4939.msg64476#msg64476

For more info on the Enemy Statistics look at the Wiki here:
http://wiki.qhimm.com/FF7/Battle/Battle_Scenes#Enemy_data_format

If you get confused, again please copy paste that section of data from the unpacked scene file and explain what you are looking to edit.

Unfortunately Elentor, Me and a few other people stopped looking into this data after the Qgears got up and running.
Hopefully you can revive our interest!

PS Cyberman: Scenester and SceneEdit REQUIRE you to UNPACK the Scene.bin file with SceneReader first before it will open them.
It is a hassle to implement a compression and decompression module into the software because of FF7's internal checks (see all the field and lgp editors for example).

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Scene Editors all buggy ?
« Reply #7 on: 2007-01-15 23:03:23 »
Hmmm I see... I wonder if this is something to work on for Q-gears since we are using the proper libraries for handling LZS decompression it should be able to perform symetrical compression no? :)

Right.. looks like there is considerable data.

Dumb Question Skillster.  Is the encoding FF7 region based on the text data?
I'm hoping to get the Japanese encoding information and stick that into the wiki (and into my JenovaFF7 save file editor).

Cyb

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
Re: Scene Editors all buggy ?
« Reply #8 on: 2007-01-16 03:22:15 »
Just want to remember that if the new files you are going to insert in the scene.bin are bigger the original ones and they exceed the size of the banks the file is divided into, you need to recalculate the table present in the third file of KERNEL.BIN (at offset 0x0F1C of the decompressed file i think) or else the battles are going to be messed up

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
Re: Scene Editors all buggy ?
« Reply #9 on: 2007-01-17 07:12:10 »
Guys you have to remember that the sections you are editing in the relevant scene file is padded with zeros/FF up to the end of its allotted section.
You can't get more space then date, so in practise you cannot adjust the size of the file as you cannot break the boundaries already described in the header for the Scene file.

Cyberman: I didn't quite understand your question.
There is text in the scene files - enemy names and enemy attacks, possibly other AI/scripted events like conversations or messages that might appear during the battle(Not sure about these since I didn't work on that section, more clues might be in the Wiki).
Again if you are replacing the text you just pad the rest of that section with zeros or FF.

Sorry I keep thinking padding is usually done with zeros, but in this case I think it is the hex value FF.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Scene Editors all buggy ?
« Reply #10 on: 2007-01-17 14:49:47 »
All Right is the text encoding the typical FF7 encoding? IE is the data like that of FF7 US/Japanese etc.?

Cyb

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
Re: Scene Editors all buggy ?
« Reply #11 on: 2007-01-17 21:43:50 »
You can't get more space then date, so in practise you cannot adjust the size of the file as you cannot break the boundaries already described in the header for the Scene file.

Hey Skillster, re-read my post. You can break the boundaries but you have to modify the third file of the KERNEL.BIN

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
Re: Scene Editors all buggy ?
« Reply #12 on: 2007-01-21 10:36:28 »
Ombra: Of course that is an option too, but perhaps if you wanted to add new enemies or add more enemies per scene file - but that would get messy as that would involve transferring attack data, AI scripts etc for the enemies you wanted to add. Possible but not something you need in a basic editor - yet.

Cyberman: the text is encoded in the normal FF7 non ascii table, so it is easy to notice the lower case lettering straight from the hex editor (enemy names, attack names). Hope that answers your question.

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
Re: Scene Editors all buggy ?
« Reply #13 on: 2007-01-21 17:54:22 »
Ombra: Of course that is an option too, but perhaps if you wanted to add new enemies or add more enemies per scene file - but that would get messy as that would involve transferring attack data, AI scripts etc for the enemies you wanted to add. Possible but not something you need in a basic editor - yet.

I agree with that but in any case, in theory, you can do it since the table in KERNEL.BIN is 64 bytes and only half of it it's used, that means we can have up to 63 banks of 0x8000 bytes. That is supposed to be the limit. Btw, i don't know somebody crazy enough to modify the files that much :P

Kashmir

  • *
  • Posts: 93
    • View Profile
Re: Scene Editors all buggy ?
« Reply #14 on: 2007-01-22 07:13:08 »
Hey um, this is sort of related i guess.

i have the source code for two scene.bin editors which i made if anyone wants them... the problem is they are both incomplete on their own... but together they would make a pretty good complete app, i just never got around to finishing it off & probley never will.

The 1st scene editor had all the functionality for editing & saving the files themselves but got corrupted during a hd screwup, but 99% of the code is still intact.

The 2nd scene editor is fine but can only load scene.bin files and extract the .gz or .scn files. note: the gzip functionality provided by the .net is okay for extracting scene files but does not have the ability to recompress the files correctly... so proper gzip from http://www.gzip.org/ would have to be implemented if you wanted to reconcatinate the scene.bin file

Oh yeah, and understanding the code might be somewhat difficult :| , it would probley take 3 days for to complete the editor. They were also written when i was somewhat inexperienced so expect some stupidity in some places. It would be better/faster to make the application from scratch useing the code purely as reference. without the code as reference it would probley take about 2week to make the application with it it should only take 3 days... much longer if you dont work on it often.

Oh yeah, and ombra is right... if you are going to make changes to the scene.bin file you will have to modify the kernel, the smallest change to some parts makes the recompression come out too big screwing everything up, so if you are going to want to edit the scene.bin you might as well do it right and mod the kernal as well. However with that said, i couldnt find any information within the wiki as to the details of whats in the kernal to mod it myself so i dont actually know whether modding the kernal will work or not, but theres only one way to find out right?
« Last Edit: 2007-01-22 07:14:44 by Kashmir »

Salk

  • *
  • Posts: 609
    • View Profile
Re: Scene Editors all buggy ?
« Reply #15 on: 2007-01-22 19:38:51 »
Thankfully _Ombra_ has been so gentle to offer to compress my files using his proprietary compressing tool so that I should no longer need to use a hex editor as I take a big shortcut here.