• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 19, 2024, 06:22:23 am

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed! Find out how you can help in the Recruitment section or our Discord!


Recompilation

Started by formerdeathcorps, February 28, 2011, 03:51:15 pm

formerdeathcorps

February 28, 2011, 03:51:15 pm Last Edit: February 28, 2011, 03:51:58 pm by formerdeathcorps
Here's an idea Wasabi got me started on.  I'm just posting here to see how many people would be interested in helping (testing, decompiling/interpretation, ASM hack writing) because it's a massive idea.  Personally, I have my formula/AI hacks to finish first, but I'd still like to gauge the general level of interest and support in this idea.

1) Compare all the primary differences between WoTL's and FFT's code (on the major battle files like WORLD.BIN/SCUS/BATTLE.BIN)  Since most of WoTL's files are smaller than FFT's, the goal is to port WoTL's features into FFT, while simultaneously expanding the free space of each of the three aforementioned files by 2-20 KB in FFT.
2) Figure out how to insert ASM hacks into WoTL (at last) by correctly identifying the Kanji section in BATTLE/WORLD.BIN.
3) Delete the slowdown on PSP by reinserting the recompiled FFT code into the PSP.
4) Delete stupid hard-code features FFT didn't have (Malak/Rafa formulas having a hard-coded max hit of 10, for example).
5) Add in PSP features (not the movies, but the sound novels, extra battles/maps [just find a way to read the PSP's larger TEST.EVT and map folder], minigames [I'm not sure on this one])
6) Bonus feature: Replace Tutorial mode with Debug mode, allowing PvP and PvAI in one game.
7) Bonus feature: Make all maps in both versions selectable (without bugs) in Debug mode, at least.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Pickle Girl Fanboy

This is insane.  Documenting an entire game in ASM?  You might as well rewrite the whole thing in a high-level programming language and make it open source.  That said, this is still an awesome idea.  Impractical, but awesome.

formerdeathcorps

February 28, 2011, 05:00:18 pm #2 Last Edit: February 28, 2011, 05:01:32 pm by formerdeathcorps
Quote from: Pickle Girl Fanboy on February 28, 2011, 04:54:27 pm
This is insane.  Documenting an entire game in ASM?  You might as well rewrite the whole thing in a high-level programming language and make it open source.  That said, this is still an awesome idea.  Impractical, but awesome.


It's only insane if I do all of it.  Hence why I'm gauging interest before I start.
I'm willing to bet most of the sound/sprite/map files are the same, though, so most of the real changes are in WORLD.BIN/SCUS/BATTLE.BIN/ATTACK.OUT/TEST.EVT.  That's only tens of MB put together; if that's split between 3-4 disciplined ASM hackers, that can be done within a year.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Pickle Girl Fanboy

I'm interested, but can't contribute much.  If you can't garner enough interest, maybe you could interest people in investigating individual files, one at a time?

formerdeathcorps

February 28, 2011, 05:58:29 pm #4 Last Edit: February 28, 2011, 07:54:55 pm by formerdeathcorps
All right...FONT.BIN is approximately the same size in both (~0x13000).  Hence, the Kanji table is the same size, just in different places between the PSP ISO and the PSX ISO.

PSX ISO
BATTLE.BIN
0xE7614 is the beginning of FONT.BIN duplicate.
According to the Wiki, 0xE92AC is the start of the Kanji.
0xFA2DC is the end.

PSP ISO
BATTLE.BIN
0xE6CCC is the beginning of FONT.BIN's duplicate.
By extrapolation, 0xE8964 is the start of the Kanji.
0xF998C is the end.

As for why ASM made by Razele/Xif doesn't work in WoTL, it's because offset 0xXXYYZZ in BATTLE.BIN for whatever routine in PSX is probably at 0xXXYYZZ - 0xWWVV on the PSP.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

pokeytax

Not being a WotL player, I just don't see the percentage in it, fdc. All of the hacks ever created still fit in the kanji table, and I can't conceive of a patch so big that it can't cram everything it needs in there. Some SCUS space would be great, but is it worth two years of work?
  • Modding version: PSX

formerdeathcorps

February 28, 2011, 07:11:29 pm #6 Last Edit: February 28, 2011, 07:13:05 pm by formerdeathcorps
Quote from: pokeytax on February 28, 2011, 06:16:49 pm
Not being a WotL player, I just don't see the percentage in it, fdc. All of the hacks ever created still fit in the kanji table, and I can't conceive of a patch so big that it can't cram everything it needs in there. Some SCUS space would be great, but is it worth two years of work?


1) The PSP players (as well as people who play on real PSX machines) are complaining they can't use most ASM hacks.  They also complain of more hard-coding and FPS slowdown.  At the least, the source of this problem should be found, if not resolved.
2) Doing this project would be the first step to learning to how to ROM expand any arbitrary file in FFT.
3) Let's say you wanted to make a whole new class of mechanics (like additional status/weather/terrain effects, generic jobs, or combat paradigm systems).  Similarly, if you want the AI to be smarter, you may need it to store more information about each unit.  Either hack, if made to their full extent, would require many more tables and/or expansion of the unit/AI RAM space (marked as zero in BATTLE.BIN), which would then require the repointing of BATTLE.BIN.  In making it, it would be helpful to at least compare with WoTL, which added more stuff in less space (giving us more space to write PSX hacks in).  Even if we chose instead to save space by making routines more efficient, we'd still need to track down most of BATTLE.BIN to do so (without fear of unintended errors), which doesn't invalidate the argument of having at least having another version to compare with/copy from.
4) Let's say you want a multi-pathed storyline like the kind Tactics Ogre had (or at the least, more units in the formation screen).  If you don't want to compromise, you need to expand TEST.EVT and ATTACK.OUT, which WoTL did.  Learning how to correctly transfer files of different sizes then becomes useful.
5) WoTL's multiplayer had a lot of crude features, but it's still a step up from Debug mode.  If possible, both should be incorporated as one PvP feature (in place of tutorial in FFT and tutorial/co-op in WoTL).
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Pickle Girl Fanboy

It would really help this project is pSX_author would release the source code to pSX.

Remember that guy who wanted to remake FFT using C++ or something?  He asked a lot of questions about AI, and I sent him my idea for subclasses and a bunch of other things.  What FDC proposes will make FFT completely hackable.  I want this to happen, but I doubt it will within the next five years, unless six or seven more ASM hackers pop up, or this project is organized so the casual ASM hacker with a bunch of mods on his hands can contribute.

formerdeathcorps

February 28, 2011, 08:11:04 pm #8 Last Edit: February 28, 2011, 08:29:15 pm by formerdeathcorps
Pickle, that would help, but I also intend to teach more people ASM on here, so we can raise more talent.  In fact, given how conversant you and Vanya are at hex-editing, you two probably should try to learn it.

I'm not sure what you mean by
Quotethis project is organized so the casual ASM hacker with a bunch of mods on his hands can contribute.

What would such a project look like?  I suspect the idea is to divide the work on the basis of skill level without giving any one person/type of person "grunt work", but I'm not sure how to do that fairly.

PSP Formula Offset Table (sadly, it's only the first 0x64...the WoTL exclusive ones are elsewhere)
BATTLE.BIN
0x1265E0 - 0x126770

Just for comparison, the PSX Formula Offset Table is at
BATTLE.BIN
0x128614 - 0x1287A4

EDIT: With just the above two bits of information and some routine tracking patience, it should now be possible to make at least 50% of all current ASM hacks (for the PSX) work for WoTL.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Pride

I really don't support the idea besides figuring out where the Kanji section for wotl players and the last two options. I just don't think the majority of it is worth the time and effort to be honest.
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?

Mega_Tyrant

February 28, 2011, 10:01:02 pm #10 Last Edit: February 28, 2011, 10:09:27 pm by Mega_Tyrant
I support this idea, if only to increase interest in the PSP version.  So many people have abandoned WOTL simply because there is so little that can be done to it.  It doesn't even have full shishi support.  If it were possible to remove the framerate limit, fix the issue with the spitesheets being joined on multiple characters so that ISO can be expanded to allow for more sprite inserts, and more information were available on the structure of its files so that the ARH, ALMA, and FFTorgASM could be applied, it's multiplayer mode could be made so much better.  WOTL has 2 advantages over basic FFT in having multiplayer and the expanded roster already.  However I do think that this may be more than the current staff of ASMers could handle.

If that post on FuSa SD removing the slowdown on WOTL is true, that might be a lead right there on how the get the framerate back to how it should be.
RAWR!

Eternal

I have no idea what this is honestly, but I'm always for more documentation. Even if nobody here will really use it, someone else might be interested in it later on.
  • Modding version: PSX & WotL
"You, no less human than we? Ha! Now there's a beastly thought. You've been less than we from the moment your baseborn father fell upon your mother in whatever gutter saw you sired! You've been chattel since you came into the world drenched in common blood!"
  • Discord username: eternal248#1817

RavenOfRazgriz

Quote from: Eternal248 on February 28, 2011, 10:55:36 pm
I have no idea what this is honestly, but I'm always for more documentation. Even if nobody here will really use it, someone else might be interested in it later on.


It means more space to write hacks and the ability to port over as many of the PSP's changes that are compatible with the PSX's hardware / limitations as possible.  This may or may not include more room on the Formation Screen, expanded Equipment tables (possibly more than even the PSP added), the added maps/Event/Attack.Out space, and a synching up of sorts between PSX and PSP to make hacks more easily compatible with both versions, as well as the removal of WotL exclusive hardcoding like the slowdown, Rafa/Malak, and other shit.  It all depends exactly what changes rely on Square using more competent coding methods and which ones rely on upgraded software or use of a better version of MIPs than the PSX used, which is the point of this thread - finding which changes can be ported onto the PSX hardware/copied or otherwise replicated in the MIPs used by the PSX version.  It's just a task only one person can sanely do, but a coordinated group of say 3-5 competent people could handle depending on dedication.  I know I want the extra Formation Screen space and gear slots, don't know about anyone else.

We all know you'd be little help for this T, because it involves knowing how to code.  :p

Same here, really, because I know fuck all when it comes to MIPs.

Pickle Girl Fanboy

March 01, 2011, 05:26:32 pm #13 Last Edit: March 01, 2011, 05:29:12 pm by Pickle Girl Fanboy
I'm reading some books on Common Lisp.

This language is so painless to learn.  Oh my god, it is, it is.  Compared to C++ (which I tried for two weeks last year), Common Lisp is like a warm shower on a cool spring morning.  This is what Java wishes it was.  Anyone who wants to learn more about it should PM me, and some PDFs will find their way into their inbox.

You should talk to Gemini over at http://www.romhacking.net.  That guy knows his ASM.  He got the SNES Star Ocean to play on PS1 hardware, and he has the source for pSX 1.14, straight from pSX_Author, though he says he won't release it, or a binary, unless pSX_Author tells him to.

Quoteor this project is organized so the casual ASM hacker with a bunch of mods on his hands can contribute.

Organize it so every file you're hacking has it's own topic and wiki page, regularly updated with new discoveries, so if, say, Sentinal Blade is working on something for his mod and it's relevant to your investigations, he can pop into the relevant thread, post it, and go his merry way.  If someone's interested in a particular functionality, they can investigate the relevant file without having to deal with things they're not interested in or equipped to deal with.

Note: If you do make separate wiki pages for PSP and PS1 game files, make sure they're labeled as such.  Ditto on topics/threads.

Why don't you go find DarthPaul and see if he wants to come back?  He might like the way the community is organized now.

Kourama

I would definitely be interested in this being a successful project, but I'm not sure if I could be helpful with this. I know very basic hex editing and don't usually have a lot of time on my hands.

Wasabi

Thanks fdc for making this topic. I'm part of the majority that has zero coding or hexing experience (aside from simple adjustments and/or allocations from playing around with GameShark codes in the past), but I do truly want to see this project progress towards its optimal course so that more flexiblehacks can be applied for either the PSX or PSP version of FFT (or both). I'm all for a larger formation screen and additional gear slots, and would like to see some ASM hacks applicable for both versions of the game. If the framerate lag could be fixed and an upgraded shishi program could be made for the PSP, I'm all for this project to be realized.

I'm willing to beta test whatever is given to me involving this project, within fdc's or any ASMer's convenience. So far I'm able to run ISOs under ePSXe on my netbook, and play patched PSP ISOs and PSX eboots on my PSP. Just throwing that info out there in case anyone wants feedback on how certain changes appear from this project's progression.

Celdia

Quotelike a warm shower on a cool spring morning.


How poetic, PGF. That said, I support the intent behind this idea. It would be great to have the extra space all tagged out and labeled for use. But potentially years of work (depending on contributers) for fuck-all knows what will come of it? I just don't know if I can get behind the actual project. Feels like a big pile of diminishing returns there.
  • Modding version: PSX
  • Discord username: Celdia#0

Pickle Girl Fanboy

March 07, 2011, 03:15:40 pm #17 Last Edit: March 07, 2011, 04:38:56 pm by Pickle Girl Fanboy
Quote from: Celdia
I support the intent behind this idea. It would be great to have the extra space all tagged out and labeled for use. But potentially years of work (depending on contributers) for fuck-all knows what will come of it? I just don't know if I can get behind the actual project. Feels like a big pile of diminishing returns there.

Right now, two months after one hacker started on formulas in BATTLE.BIN, we are about two months away from fully modifiable formulas.  One hacker, that's all it took.  Now, imagine if we brought the full power of social media to bear on this problem?  A hundred small contributers can be as good as one big contributer, if there is no duplication of effort.

Although I'm busy learning something else, this is still interesting, because someone could use the information discovered to make an open source clone of FFT, which uses the same data formats as FFT (though I'd prefer more detailed sprites).

http://www.purezc.com/index.php?page=home&section=history
^This is a site that features spritesheets for a Legend of Zelda clone.

Anyone know what language FFT was written in?  Are there any patterns common to, say, C programs that are sitting in the game?  Is there any uncompiled code sitting in there somewhere?  Can we research the programmers from the credits of FFT and find out more about them, where they went to school, what they studied, what other games they worked on, what development group they were a part of at Square, where they are now?

@fdc: What tools do you use?  pSX 1.13, a hex editor, and renegade64, I assume.

What tools do you need to make your work easier?

http://en.wikipedia.org/wiki/PlayStation_%28console%29#Technical_specifications

crasm
http://crasm.sourceforge.net/crasm.html
Assemble a microprocessor program and produce output file in Intel HEX or Motorola S Code from source for 6800/6801/6803/6502/65C02/Z80 processors. A program listing and a symbol table are also produced on the standard output.
^Could this help you?

I wonder if it's possible to reverse engineer source code, if we know what implementation of which language it was written in and what it was compiled on?  This sort of reverse engineering is fair use, I believe.

Atma

Hmm, very ambitious undertaking... but the results could be phenomenal!  I've been wanting to make a mod for WotL, but there just isn't nearly the same amount of customization that the PSX version has.  This would definitely be something i'd love to see getting more attention.
My name is Atma... I am pure energy... and as ancient as the cosmos.

formerdeathcorps

PGF:

FFT was written in C.  Release date is 1997 (there was nothing better then) and towards the end of BATTLE.BIN, you see non-ASM ASCII comments detailing files (.C) and folders.  I also found stuff about data heaps (which apparently the coder must explicitly mention in C).  I'm sure stuff like this exists in other files too and I'm sure anyone with a hex editor can do this to find out more about the large-scale file organization of any other important file (WORLD.BIN, SCUS...).

As for code that's never checked in FFT?  We already know that DEBUG mode and Sound Novels are in the English ISO, but not called during normal game procedures.  I strongly suspect there's stuff like this in BATTLE.BIN, especially on some of the longer routines I've seen (like knockback).

I use pSXrel, WinHex or HxD (depending on the computer), as well as the tools downloaded from this site.  I didn't need Renegade up to now, but I might get it to type up the hex for my massive formula hack.
At this point, I'm not exactly sure what other tools I need, though a map of PSX data sections would be nice (e.g. 0x80000000 is ROM, 0xA0000000 is something to do with the system [RNG is called there, as is system time?]...)

Reverse Engineering Source Code...you mean turning Hex back into C?  I know there's commercial programs that do stuff like that (I have some freeware on my laptop that converted EXEs to C#/Java), but it's not 100% and in general, there's no perfect re-engineering software algorithm that can work on any piece of ASM, even for hex code that's simply a compilation of a C program (and even if it did, there's no guarantee the resulting program would be readable or efficient).  Considering also that I intend to ASM hack a lot of the resulting code while under space constraints (and most compilers from any language to ASM use space inefficient algorithms because most of those tend to optimize runtime and minimize the chance for variable misuse/error), it'll be likely that any ASM code I write will yield gibberish when fed through a cheap reverse compiler (because I don't follow conventions that restrict "free" register use).

As for the duplication of effort, that's one of the major barriers in this project (the other being not enough ASM hackers).  I don't know how to split the work that doesn't either result in that or someone doing boring grunt work.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.