Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: kela51 on 2017-04-01 12:41:03

Title: FF7 PC possible program?
Post by: kela51 on 2017-04-01 12:41:03
Hi guys! I would like to know if it's possible for you to create a program to get names files for all magics models and textures when i'm playing in real time? I don't know if you understand what i mean.. because in magic files, lots of .p files can be replaced but i don't really know what these files corresponds. Thx in advance guys!
Title: Re: FF7 PC possible program?
Post by: nfitc1 on 2017-04-01 22:03:47
I'd love something like this too. Aali's driver could theoretically do this, but since we don't have the source we might be able to wrap it somehow. I've been toying with this idea for years and can't make a good solution.
Title: Re: FF7 PC possible program?
Post by: kela51 on 2017-04-02 07:30:27
Ok so not possible for now
Title: Re: FF7 PC possible program?
Post by: sithlord48 on 2017-04-02 13:16:37
You can look the models up in the file reconstruction project . As for the textures i seam to remember there being an option in aalis driver for this. It was only ever known to Team Avalanche members the option is save_textures = on but BECAREFUL it will write them to your mod_path so be sure to set that to a new folder.
Title: Re: FF7 PC possible program?
Post by: DLPB_ on 2017-04-02 14:41:57
I'll have a look at this also.  But I know sod all about models and what not. I can at least look....
Title: Re: FF7 PC possible program?
Post by: nfitc1 on 2017-04-02 16:45:40
@sithlord48:
The biggest problem is the file names are duplicated a lot. There are probably 6 files like 01.tex or similar. Every time I go into the code with the purpose of figuring these files out I am always astounded that it works at all. Most of the code references poly files or rsd files that somehow get the correct texture/model. It makes more sense on the PSX because all the files to one action are archived together. Some "genius" at Eidos decided to make one master archive (magic.lgp) and save no directory structure in it. While that does make it harder to mod directly, it also makes it a pain to separate these files manually.
Title: Re: FF7 PC possible program?
Post by: halkun on 2017-04-02 23:45:06
I thought there was a directory tree in magic.lgp hmm..
Title: Re: FF7 PC possible program?
Post by: Kaldarasha on 2017-04-03 06:00:00
Sort of. For example summons models are in the main folder while there effects are in the supfolders. Though,summons are easy to spot (mostly), but there are other effects in the main folder which you can't tell how they are connected and if they even use the supfolders.
Title: Re: FF7 PC possible program?
Post by: nfitc1 on 2017-04-03 14:27:29
I thought there was a directory tree in magic.lgp hmm..
Hey, halkun. It's been a while.

There is a listing of folders, but within the internal structure of the magic.lgp there is no link between the files and folders. I've analyzed the archive several times in the past and there just isn't any indication of what belongs with what. The only thing that binds them together is in the exe. The game just knows which file to look for (I think based on the file's position, not offset, in the archive). The folders might be completely ignored too. This is VERY poor programming (as most video games are), but at the time those conventions had not been well established.
Title: Re: FF7 PC possible program?
Post by: Aali on 2017-04-03 15:55:36
Actually the game keeps track of which "directory" it is in and uses this to find the files, name + directory goes into the LGP parser but the directory is only used if there is a conflict. However, with FF7PC being a fairly shoddy port this system is not used in any sort of consistent way. The battle module has its own encoder/decoder for converting PSX filenames into the cryptic 4-letter sequences from the PC version but I guess they couldn't be bothered with that for the magic effects so they were left as-is. At the same time, some modules use the mangled PC names straight up, completely doing away with the PSX names. In short, it is definitely possible to sort out the magic effects into separate directories but it will probably need a bunch of manual work to sort out the odd file where the directory happens to be incorrect.

Either way, the crucial piece of metadata that ties these files together is hardcoded in the .exe, magic effects (which are hardcoded) explicitly load their own models and textures as they execute.