• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 26, 2024, 01:38:44 pm

Question on programing FFT

Started by Asakawa, June 13, 2015, 02:16:36 pm

Asakawa

Hi Guys,

I've been wondering what kind of computer programing languages you would need to learn to program/edit fft? This would exclude working with AI since from what I have been told it is the most difficult part of programming. Strictly speaking more of a PvP approach unless AI would still be necessary? Since you guys work with FFT doing edits and modifications what programing languages do you feel are required to be able to do this?

Choto

the only programming language you need to learn is MIPS IV Assembly. It's a low-level language that is used in the psx processor. As far as assembly languages go, it's absolutely the easiest to use that I've seen. In addition to that you have a metric shit-ton of resources on our wiki and in tutorials and in IRC/Help forum.

Most edits we make are small... especially when learning ASM. The more you learn though, the more you can accomplish. Xifanie and Pokeytax have made monstrous hacks that are more custom-programming... but most of the time you're just adding little snippets of code to modify the original code. That kind of stuff is much easier.

Asakawa

Hi Choto,

Thank you for replying. So with MIPS IV Assembly you can pretty much do anything you want within the FFT code? Was this the language that was used back then to create the game itself? I am sorry but I am so naive when it comes down to code and programming. I always thought the creators used more than a single language code to create the game. Was is that back then only MIPS IV Assembly was available? Sorry again for my lack of knowledge on the subject.... I think the game was produced around 1996?

Pride

FFT was not written in an assembly language, no one knows what language it was originally written in (since we don't have the source code, on the dev team, etc) but yes, you could do whatever you want in fft with time and effort.
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?

Asakawa

Hi Pride,

Thank you for dropping by :). I see, then would you say that it is considerably more difficult to 'edit' the game by using MIPS IV Assembly than if we could, for example, use the source code and coding language the developers used?

Even if we did know the coding language it was used it would not be much help since we do not have the source code? Is that right? I just want to understand this clearly sorry!

Choto

What Pride means is that it was written in something like C, and then (as with any high level language) it was compiled into ASM commands. Machines don't recognize high level languages, so eventually all high level language code is converted into ASM to communicate with the machines it's programming.

Ya, getting the original high-level code is pretty much out of the question, so we're relegated to ASM anyway. But it's not so bad. It's easy enough to work with. Just takes alot of time and effort as Pride mentioned

Xifanie

Just saying but:

- FFT was written in C.
- Doesn't matter because the source code is permanently gone (otherwise Square's ports wouldn't be so bad).

They just destroy the source code after releasing any of their games, and no one knows why. :/
Although that's probably more a thing of the past since they released FFXIII/FFXIII-2 on PC.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Asakawa

Thanks so much :)

Just to be sure: It would be easier to work with the code if it was in C, am I right? ASM is harder to work with than C? Would that be accurate? Also, I guess reverse engineering is out of the question? ASM into C? :P

Xifanie

Some people prefer C. Nobody here does though. At least with ASM you will know immediately if your hack is going to fit in your limited amount of space of not.

Go ahead and do it if you want to reverse-engineer the game. Nobody here has done that because of all the work it involves, and well, most of us are not all that familiar with C.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Asakawa

One  last question. Since square used to destroy all of their code after releasing the game does this mean they had to re-write the whole thing for the War of the Lions Release????

Xifanie

No. No. No. No, they hacked around to implement the new things and pretty much buildt an emulator around the game.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Asakawa

Wow! So they basically used ASM? to do the hacking? I always wondered why the animations were so slow in combat. Was that supposed to be part of the game play? Or perhaps a bug?

3lric

The slowdown? No, that was not intentional, they just weren't smart enough to fix it like Archaemic did.
  • Modding version: PSX

Asakawa

I see, strange that they would not fix it having so much staff on their side and what not lol. So do you think they used ASM to create the War of the LIons since the source code was no longer available for use?

Xifanie

Maybe you should ask squareenix directly

And they kinda created the bug to start with. It looks like they accidentally overwrote some bytes (possibly while looking at the hex data of the game), started typing, oops wrong window. Didn't notice they typed something into the game's hex, went to edit other stuff, and saved. They didn't know wtf was going on, and created a patch to try to compensate for the speed drop, but IMO, failed horribly.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Asakawa

Thank you Xefani :),

Do you think it would be possible to add a whole set of stats, like in tactics Ogre for PSX (STR, DEX, AGI, LUCK, ETC), and have them work in a similar fashion to the stats in Tactics Ogre? Could this be done by using ASM? I see your quote on what is possible in ASM "Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)" do you think something like that is possible taking into consideration the hardware limits? (Because I honestly don't know what the limits would be). I just want to get an idea of what could be possible... (Meaning to what degree the game could be altered).

-Edit- Sorry for asking so many questions :(

Glain

I believe the PSX processor (R3000A) actually is MIPS I, whereas the PSP's (Allegrex) is MIPS32R2.

Trying to get C that works out of ASM isn't an easy task. I'd looked into it a bit way back when, but even if you could get some kind of decompilation going, you end up with names like func_84bc2 and var_3940, and getting anything readable out of that mess is pretty ridiculous. The fact that the code is split into multiple files here makes it even more complicated.

The PSP code certainly seems to have been recompiled from something. IIRC, the code for both battles and the world map in the PSP version is all inside boot.bin. That code uses a bunch of ASM instructions that didn't exist in MIPS I, makes use of the FPU in a few places, and has some different compiler conventions than the PSX code. The PSP has enough RAM to load all the code at once so it doesn't need to be split into multiple files like battle.bin/world.bin.

I believe it keeps around some of the PSX-version binaries and loads data from a few of them, but I'm not sure how much code it actually references in them. I'd think the PSX code could be run on the PSP natively except for the GTE commands.
  • Modding version: Other/Unknown

Asakawa

Ah, I see. That sounds interesting. Would it be easier to work with the original C code instead of trying to do things through ASM? Do you think it would be possible to edit things like the stats in Tactics Ogre (STR, DEX, LUK, ETC) into FFT through ASM? It makes me wonder just how much can be edit?

3lric

Quote from: Asakawa on June 20, 2015, 09:40:36 pm
Ah, I see. That sounds interesting. Would it be easier to work with the original C code instead of trying to do things through ASM?


You already asked this up above...  no more going in circles.

What you intend to do with all the answers you are getting for these questions???
  • Modding version: PSX

Asakawa

I asked but have not received the answer so I wanted to ask you :(. I want to know to get an idea of what can be done with the ASM in the game. I don't know of the  limits so I wondered if you guys new if it was possible. All the answers just let me get an idea of where to go.