Author Topic: Final Fantasy VI PC/Steam Modding  (Read 32168 times)

MetaLink

  • *
  • Posts: 42
    • View Profile
Final Fantasy VI PC/Steam Modding
« on: 2015-12-16 19:29:29 »
So ff6 came out on PC today and the game doesn´t look very good with the new sprites aliasing problems etc etc, you can check out this article pointing out most things wrong with this port here (http://www.fortressofdoors.com/doing-an-hd-remake-the-right-way-ffvi-edition/)
 
Unlike FFV all the files, except fonts and controller icons, are stored on one big 700 Mb file, this file format is .obb which is an android file i´m not sure

Someone on the steam forums already tried to decompile the file but to no avail (http://steamcommunity.com/groups/ff-modding/discussions/1/487877107133753844/)

So is anyone here interested in modding this game ?

Covarr

  • Covarr-Let
  • Administrator
  • *
  • Posts: 3941
  • Just Covarr. No "n".
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #1 on: 2015-12-16 19:51:30 »
This is something I was hoping to look into in a month or two when I have the money to do so, if nobody beats me to it. I suspect the Steam forums are more likely to gather the right talent for this job, though.

codecx

  • *
  • Posts: 3
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #2 on: 2015-12-18 16:01:36 »
This is something I was hoping to look into in a month or two when I have the money to do so, if nobody beats me to it.

So, this is a lazy ass port. Its garbage, and various communities are scrambling to make it worth playing.

I am seeing a lot of people who seemingly want to help but don't have the cash to buy the game.

If this sounds like you, then let me know. I haven't done reddit gifts this year, I can afford to gift a few lumps of FF6 coal if someone can help turn it into a diamond.
« Last Edit: 2015-12-18 17:05:41 by codecx »

Covarr

  • Covarr-Let
  • Administrator
  • *
  • Posts: 3941
  • Just Covarr. No "n".
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #3 on: 2015-12-18 16:23:22 »
I'm interested in getting this done sooner than later, I am monitoring the steam community, but no single method has come out.
If you're waiting due to a money factor, how much would this cost to get this done, and how much time does it take?
Christmas has left me too broke to buy the game, that's the only financial factor for me. Time can be difficult to gauge without looking into the game's files first; without seeing the formats things are in and how everything's stored, I can't even begin to estimate how long such a task would take.

I'm probably not the best person for this job anyway. My experience with these sorts of things is fairly limited; I'm far more useful at audio modding than reverse engineering file formats. Not to mention my free time will be fairly limited even when I can afford a copy of it, as I was recently cast in a play and rehearsals start in January.

Edit: From what I have read, the game's data isn't just packaged in a binary blob, but also encrypted. That alone puts it past my purview.
« Last Edit: 2015-12-18 16:35:43 by Covarr »

codecx

  • *
  • Posts: 3
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #4 on: 2015-12-18 16:52:31 »
Well, my offer stands to anyone. I'll also be posting this on reddit /r/FinalFantasy.
« Last Edit: 2015-12-18 17:06:34 by codecx »

MetaLink

  • *
  • Posts: 42
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #5 on: 2015-12-18 21:55:18 »
the main.obb file where all data is stored is password protected, when trying to decrypt/extract the files it asks for a password

Covarr

  • Covarr-Let
  • Administrator
  • *
  • Posts: 3941
  • Just Covarr. No "n".
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #6 on: 2015-12-18 22:20:10 »
Now, the password has to be included somewhere for the archive to be decrypted. I would guess it's stored in the game's exe somewhere, though I can't swear to it.

MetaLink

  • *
  • Posts: 42
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #7 on: 2015-12-18 22:26:35 »
Nice, guess its just a matter of debugging the .exe right ?

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Re: Final Fantasy VI PC/Steam Modding
« Reply #8 on: 2015-12-19 18:32:47 »
I'll take a look - although like Covarr, I won't have much opportunity to do a lot until after Christmas (albeit I'm short on time rather than funds...)


UPDATE: Made some progress; the OBB file, despite the name, isn't actually an obb file. (Probably due to Google's distribution rules; subsidiary data and patches are always named .obb regardless of file type). It's a fairly simple archive file format containing ~4900 data files. The data inside is far too repetitive to be compressed or encrypted (which surprises me, nowadays, if this is the exact same data that was distributed in the Android release - which seems likely - they didn't even apply LZ4 or something similar? Guess they don't care about wasting space on customer's phones.)

The archive doesn't appear to contain filenames: they may be encoded into the exe; or possibly that's the (only!) part of the archive that's obfuscated in some way.

Many of the data files have suspiciously regular file sizes; just over 512KB, you say? Sounds an awful lot like a 256x512x32bit graphic, to me (also not compressed at all - not even PNG?!).

In fact, feeding those files into a raw image viewer gives us data like:



Looks an awful lot like some world map data, doesn't it? Albeit the colours are screwed, so it's not stored in straight RGBA.

Disappointingly it looks like a lot of the game data (all the dialogue?) is encoded into the EXE file, not stored in the OBB archive. That's a little annoying.

More to follow, presumably ;)
« Last Edit: 2015-12-19 19:44:54 by ficedula »

MetaLink

  • *
  • Posts: 42
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #9 on: 2015-12-19 20:10:15 »
Awesome, ive been fiddling around with a debugger and found some strings


« Last Edit: 2015-12-19 20:20:03 by MetaLink »

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Re: Final Fantasy VI PC/Steam Modding
« Reply #10 on: 2015-12-19 20:33:02 »
Interestingly, despite those filenames referencing .gz data, none of the data files in the obb archive (or any data within the exe) appears to have a valid .gz header.

Doesn't mean they haven't used gzip anywhere, but if they have, it's not using standard headers, or is otherwise obfuscated.

nyxojaele

  • *
  • Posts: 6
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #11 on: 2015-12-21 19:29:30 »
Hey guys, just signed up to this forum to talk to you about this, as you guys seem to be the farthest along with this.

A few days ago I was bored and already wrote a program to properly extract the files from the .obb file in the steam version of FFVI. (https://twitter.com/rivernyxx/status/677714786541510656)
To confirm some suspicions earlier in this thread:
* The filenames are hashed in the archive, and have actual filenames hard-coded in the .exe file (which then get hashed at runtime in order to look up the file required in the .obb file).
* The file data is encrypted. No idea if it's a known encryption type or not (as I'm not learned in that sorta thing) but I determined how to decrypt it properly. Once decrypted, there are proper gzip headers on the associated files.

The only things I have left to do are:
* Finish creating a file list for the archive (it seems to have most of the same files as the iOS version, as I understand -- does anybody have a complete file list for that? I've only found partial lists online, mostly graphics..) -- I'm missing filenames for about 300-350 entries.
* The .bmp/.tga files seem to be stored in a strange format (the same format even?), that I've seen somebody online mention the solved "thanks to the information on the Final Fantasy Wiki", however I've not found any such information >_<;; However, other file types that I've checked seem fine, such as .png files.
* Since I know how to hash the filenames and decrypt the data, I can quite possibly repackage any mods as well, I just have to write the code. I'll get to that last.

MetaLink

  • *
  • Posts: 42
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #12 on: 2015-12-21 19:34:10 »
I had a folder with all the extracted files of the android version extracted but i deleted it a few days ago... ill try to find them again on the web

nyxojaele

  • *
  • Posts: 6
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #13 on: 2015-12-21 19:41:04 »
I'm sure that would be super useful! Thanks :)

MetaLink

  • *
  • Posts: 42
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #14 on: 2015-12-21 20:11:05 »
« Last Edit: 2015-12-21 20:13:03 by MetaLink »

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Re: Final Fantasy VI PC/Steam Modding
« Reply #15 on: 2015-12-21 20:16:47 »
Sounds like you already got the most important bits worked out - I won't spend any time trying to decode the archive, then, since you've already managed it!

MetaLink

  • *
  • Posts: 42
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #16 on: 2015-12-21 20:25:47 »
So sprite modding will be possible right ? but what about music modding ?

BTW i didn´t decode anything i got all of that from vg-resources

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Re: Final Fantasy VI PC/Steam Modding
« Reply #17 on: 2015-12-21 20:34:14 »
Yeah, I was talking about nyxojaele - sounds like they've managed to decode pretty much everything important about the obb file.

nyxojaele

  • *
  • Posts: 6
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #18 on: 2015-12-21 20:59:17 »
Yeah, the .obb file is 100% figured out, technically. The filenames that are associated with the hashes in the .obb file aren't all figured out yet tho. However the actual files _inside_ it may or may not be, heh ;p
« Last Edit: 2015-12-21 21:13:27 by nyxojaele »

Covarr

  • Covarr-Let
  • Administrator
  • *
  • Posts: 3941
  • Just Covarr. No "n".
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #19 on: 2015-12-21 21:13:24 »
I'm immensely glad to see progress being made on this. Hopefully repacking the files will be as easy as extracting them was, but as Black Chocobo has shown with its handling of PS3 saves, this is absolutely not always the case.

nyxojaele

  • *
  • Posts: 6
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #20 on: 2015-12-21 21:20:23 »
@MetaLink: It looks like all those links you provided are the same info I had found. While they include a lot of the data, it's limited to only the graphical stuff, so that almost assuredly doesn't help with finding the final filenames.

nyxojaele

  • *
  • Posts: 6
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #21 on: 2015-12-22 02:48:25 »
So I've managed to get all the data properly extracting.. The problem still being that I have an incomplete file list :(
While I take a break from that tho, I'm going to work on seeing if I can get this tool to repackage the archive.

MetaLink

  • *
  • Posts: 42
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #22 on: 2015-12-22 17:00:24 »
Great work nyxojaele i really appreciate it, you said on the steam group FFmodding that about 7% of the files are listed as hashes and are hard to mod, hopefully those are not the music or UI files

MetaLink

  • *
  • Posts: 42
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #23 on: 2015-12-24 01:23:34 »
Nyxojaele managed to remove the filter that was on the character sprites enemies etc.

https://dl.dropboxusercontent.com/u/38150185/FFVI/FFVI_Defilter_903963.zip

nyxojaele

  • *
  • Posts: 6
    • View Profile
Re: Final Fantasy VI PC/Steam Modding
« Reply #24 on: 2015-12-24 21:02:51 »
Yup! Sorry I haven't been updating on here much, it's not one of my normal hangouts.
I've removed the filter from FFVI, check out my tweet about that: https://twitter.com/rivernyxx/status/679845014785003521
I'm also working on that file list still, but the tool is otherwise feature complete -- it can repackage mods into the archive just fine :)