News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Dissecting Game Mechanics from FF1 PSP  (Read 4089 times)

flamefury

  • Newbie
  • *
  • Posts: 2
    • View Profile
Dissecting Game Mechanics from FF1 PSP
« on: September 14, 2014, 04:59:43 am »
Hey all,

So the project I'm doing isn't really so much hacking as it is dissection. I have an FF1 PSP ISO and all I am trying to do is to open it up and see how it works (eg, hit and damage calculations, what each character stat does, find the changes from the NES and GBA versions, etc). I know a small amount about hex editing and relative searching since I used to do a few simple save state hacks on SNES games.

Right now, I'm trying to understand the basic structure of the game. After unpacking the ISO, I get a folder structure like this:
Code: [Select]
PSP_GAME
| -- SYSDIR
      | -- UPDATE
            | -- DATA.BIN
            | -- EBOOT.BIN
            | -- PARAM.SFO
      | -- BOOT.BIN
      | -- EBOOT.BIN
| -- USRDIR
      | -- data
            | -- ff1psp.dpk
      | -- movie
            | -- FF1_OP_MOVIE_MainUS.pmf
| -- ICON0.PNG
| -- PARAM.SFO
| -- PIC1.PNG
| -- SND0.AT3

I made a guess that anything in the SYSDIR wouldn't hold the information I wanted, and everything else looked like it would be for the PSP's system like initial bootup of the game and the images and background it would display when selected on-screen. The only option was to look at ff1psp.dpk.

With the help of some Japanese guy (http://www.geocities.jp/junk2ool/), I could extract the dpk to a slew of npk and pck files. The npk files further extract into AT3 files, which mean all these are going to be either music or sound effects. That leaves the pck ones.

The pck files extract into many different file types (of the random files I've picked, I've seen ANA, EFA, GIM, OTI, AOB...there may be several more). From here is where I don't know where to begin my search to find the mechanics of the game, as none of the PCK files have particularly descriptive titles.

Can anyone point me in the right direction to discovering the calculations used in the game?
« Last Edit: September 14, 2014, 12:19:14 pm by flamefury »

FAST6191

  • Hero Member
  • *****
  • Posts: 2813
    • View Profile
Re: Dissecting Game Mechanics from FF1 PSP
« Reply #1 on: September 14, 2014, 03:56:14 pm »
Short version. You likely have a lot of learning ahead before you can do this via hacking, indeed you are probably better off experimenting with the games themselves and observing effects there. If you are lucky you could be able to fiddle with the engine such that you can try many different values from a single savestate, if not then it is only slightly more long winded.

Anyway I take it you want to make something like http://www.dragonflycave.com/rbycapture.aspx but for Final Fantasy, ultimately doing a compare and contrast between the various ports mentioned?

If you had just wanted weapons stats for a wiki or something then you can probably learn that in fairly short order, it might even be less abstract than some of the graphics and text stuff people usually start off/spend their early days with around here. The actual calculations, this side of something you can decompile, run in a scripting engine or that has its own scripting engine, are likely buried deep in the game's code (most likely one of the eboot.bin files in this case, though probably flanked with something from another file). For that you need assembly skills, and in your case assembly skills in three fairly different systems. If you have a proper debugger (and the NES and GBA at least feature great ones, the PSP does not do so badly either) then you might be able to get some help so you can observe things; assembly is considered the harder part of ROM hacking for a reason but if someone points you at the thing you want to watch and tweak then you can probably watch it add, multiply and do everything else it does fairly easily.

flamefury

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Dissecting Game Mechanics from FF1 PSP
« Reply #2 on: September 15, 2014, 01:45:52 pm »
My goal was to create something like this for the PSP version: http://www.gamefaqs.com/nes/522595-final-fantasy/faqs/57009

Jeff Ludwig's FF1 GBA hacking notes (http://www.jeffludwig.com/finalfantasy/hacking/) also provides memory addresses for most of the data tables, though he doesn't list them out to completion  the way the above FAQ does.

The only one that hasn't really had its game mechanics dissected was the PSP version, hence why I was curious about this project. I actually have some background in MIPS assembly, so I had been looking for some kind of decompiler for a PSP game, but I wasn't sure which files I should be trying to decompile exactly.

At the very least I wanted to get started with data tables like character level ups and equipment as you mentioned.

What kind of PSP debuggers are available right now? Would there happen to be a decent one for an emulator?

FAST6191

  • Hero Member
  • *****
  • Posts: 2813
    • View Profile
Re: Dissecting Game Mechanics from FF1 PSP
« Reply #3 on: September 15, 2014, 02:54:11 pm »
If you are already partway versed in MIPS assembly then we might as well continue.

NES debugging is FCEUX, GBA debugging is no$gba (since gone freeware for the debugger) and vba-sdl-h, some also use BoycottAdvance but it is not really worth it now no$gba is free.

Classically (and still quite useful) is debugging in hardware. Most used it more for making cheats but it can dump memory and do other things. cwcheat was the main cheat tool for any PSP cheating needs I had, however I have not kept up with it and you may also have CoderPR, NitePR, DarkFrost, freecheat and TempAR also doing things here (TempAR probably being the newer but I really am out of touch with PSP cheating).

PSP emulators got something of a boost when the PS3 was found to contain most of the keys, to that end we have seen serious development since those times.
Most will probably look between
http://jpcsp.org/
http://www.ppsspp.org/development.html

Jpcsp has had them for longer, or at least most of the guides I see were written for it. Is slowly getting some stuff though. Neither is a patch on FCEUX or the GBA stuff but it could be doable.

Static disassembly is also popular, however I am not sure what goes as far as IDA plugins for PSP related tasks right now (changelogs says it has some measure of official support) and would not be surprised to see many people still messing with objdump from http://devkitpro.org/wiki/Getting_Started/devkitPSP ( http://manned.org/psp-objdump/57b393a1 ).

Anyway as UMD is nowhere near fast/low latency enough to run code from things get catapulted into normal memory, typically from the eboot.bin and then augmented by other files. However things can quite happily read data from the eboot.bin and though I am not sure how common it is read assembly from other non eboot.bin files.

tryphon

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Dissecting Game Mechanics from FF1 PSP
« Reply #4 on: September 15, 2014, 04:28:47 pm »
PPSSPP seems to have a pretty decent debugger (I didn't use it though).

I used PS2dis as a free disassembler (it's for the PS2 but it runs quite well with PSP too) ; it may have difficulty in interpreting some kind of relocatable code and so give wrong address, but I could work with it. I wouldn't be surprised if there are better alternatives though.