• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 29, 2024, 05:18:22 am

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


Various Questions

Started by Krendall, February 06, 2014, 08:52:32 pm

Lockeadon

Quote from: Krendall on February 11, 2014, 06:55:54 pm
I'm not quite sure how to do this step here. For starters, do I just use FFTactext to name the ability, or are there more steps? Also, was I correct that 01E1 on the Abilities tab in FFTPatcher corresponds to the same blank ability? If not, how do I set it up in a skillset?

for this part just add in in fftpatcher to whichever skillset you assigned to the job, under the skillset editor. and yes you need to name it with fftactext and give it a description/help text if you want it to appear properly in the list. as to which ability it equates to i'm not sure about that. i dont remember numbers well. i'm sure choto will know though :)

Also, I didn't realize that I was basically remapping where Weapon Guard is checked. I thought I would have to clone it as a Support ability that just did the same function. I didn't realize that checking for specific abilities was part of the ASM script like that.

asm is weird at first but you get used to it.

I was thinking of that, too, thanks. The weird thing is, I don't want him to stand out too much, if that makes any sense. I kinda think it's more amusing to have Aglus' ghost show up with no explanation and the characters don't even acknowledge him as anything more than just another enemy to fight. Yeah, I hate the bastard that much.

i hate him too... him and that asshole who raped rafa >.>

Choto

So there are two things. Tactext is for editing the Text of the game only. FFTPatcher is basically a giant hex editor that changes functionality. So you would need to:

-Rename that blank ability to Weapon Guard
-Add that blank ability to the desired skillset via FFTPatcher
-Apply your ASM hack

And you should be good to go. It seems like you're figuring things out correctly, if you keep at it I'm sure you'll get there. Keep reading the wealth of information on the forums and try some editing. We're always happy to help people that help themselves =)

Krendall

I tried it and I've had a couple problems.
First, when I try to name the ability in TacText, I get the error "DTE for OPEN.LZW has failed. The ISO has NOT been modified."
Second, when I tried applying the ability in the game, every physical attack came up with a 0% chance to hit and all physical attacks deal no damage nor do they trigger any kind of reaction (the attacked character just stands there). This happened to everyone, not just people with the new Weapon Guard equipped.

Here is the patch I used:
<Patch name="Support ability 01E1 is Weapon Guard">
<Location file="BATTLE_BIN" offset="11dfac">
90820092
00000000
30420010
</Location>
</Patch>

3lric

Quote from: Krendall on February 12, 2014, 06:28:21 pm
I tried it and I've had a couple problems.
First, when I try to name the ability in TacText, I get the error "DTE for OPEN.LZW has failed. The ISO has NOT been modified."


When you are finished making your edits. Save the Tactext file itself. Close Tactext. Reopen and load the Tactext file, then choose to patch it to your
iso (don't actually load the iso the second time you open it)
  • Modding version: PSX

Krendall

Quote from: Elric on February 12, 2014, 06:39:50 pm
When you are finished making your edits. Save the Tactext file itself. Close Tactext. Reopen and load the Tactext file, then choose to patch it to your
iso (don't actually load the iso the second time you open it)

Thanks, that got TacText to work. So now why does the ASM patch cause all physical attacks to not work? FFTPatcher has a box marked "Ability ID", do I need to change that to match the original Weapon Guard?

Choto

the hex that you have is backwards. The playstation processor uses something called "little endian" byte order. This means that XXYYWWZZ should really be ZZWWYYXX

So each 4 byte string of hex is a command:

92008290 <--> lbu r2,0x0092(r4)
00000000 <--> nop
30420010 <--> andi r2,r2,0x0010

if the byte order isn't reversed, then:

90820092 <--> lbu r0,-0x7d70(r16)
00000000 <--> nop
10004230 <--> beq r0,r0,0x000108cc

Did you use MasshexASM? If so, make sure the little endian box is checked. So the patch should look like this:

<Patch name="Support ability 01E1 is Weapon Guard">
<Location file="BATTLE_BIN" offset="11dfac">
92008290
00000000
10004230
</Location>
</Patch>

*growing pains*. One way to check the hacks that you make and see /where/ it's messing up is by using a debugger. Psxrel has a debugger in it. You set a breakpoint to the address that you're writing to and it will stop the game when it reaches that address and you can take a look at what code was applied. Then you can step through each command individually to see what effect it had. It's actually really useful for learning because you can see exactly what the commands did to the values in the registers. Pokeytax shows how to use a debugger here: http://ffhacktics.com/smf/index.php?topic=7937.0

I'd say about 80% of hacks that I make don't work initially and I have to step through them with the debugger to see where the error is. It's just the nature of the beast.

Krendall

February 13, 2014, 06:59:38 pm #26 Last Edit: February 13, 2014, 07:09:53 pm by Krendall
Ah, okay, I was going to ask what that Little Endian box meant. The good news is the game is functioning normally now. The bad news is the ability doesn't seem to be doing anything. I try a normal physical attack from the front and it's only calculating class and shield evade, but not weapon. So either it's not working or it's not being calculated for the chance-to-hit display.

Also, just to be clear, what I want is to be able to stack Weapon Guard with any other Reaction Skill. Will this patch alone do that or would there be even more I have to do? If not, couldn't I just set Weapon Guard as an innate skill for every class?

Choto

The proper way to diagnose this is with psxrel, a debugger. Here are possible problems i can think of:

-are you sure the support ability is equipped and matches the one we configured the hack for?
-Are there any other conditions in battle that would prevent the target from using weapon guard? (don't act, in water, status?)
-Are you mistaking the weapon guard for another type of evade?

try downloading psxrel and set an execute breakpoing for 0x184f9c. then you can step through each command by pressing F7. If it gets by the beq command, then it should be applying >_> You can reference Pokeytax's ASM tutorial for some debugger info. You can find the debugger here: http://ffhacktics.com/smf/index.php?topic=9608.0

Krendall

Here's what I'm getting from the break point until it hits a beq line each time I press F7. Sorry, but I'm really not sure if it's getting by it or not (I read Pokeytax's thread and it didn't help much here).

00184f9c: lui r4,0x8019           3c048019     ...<
00184fa0: lw r4,0x2d98(r4)        8c842d98     .-..
00184fa4: addiu r29,r29,0xffe8    27bdffe8     ...'
00184fa8: sw r31,0x0010(r29)      afbf0010     ....
00184fac: lbu r2,0x0092(r4)       90820092     ....
00184fb0: nop                     00000000     ....
00184fb4: andi r2,r2,0x0010       30420010     ..B0
00184fb8: beq r2,r0,0x00184fcc    10400004     ..@.

From what I understand, nop usually means it didn't work, but I don't know if passing through it like it did is normal or not.

Choto

I'm just glad you gave it a shot instead of saying "F it". :P

nop doesn't do anything, it's just a blank command that has no effect. It does serve a purpose but you don't need to worry about that now.Here's what the game is doing:

00184fac: lbu r2,0x0092(r4)       90820092   ---- Load active Support abilities
00184fb0: nop                     00000000
00184fb4: andi r2,r2,0x0010       30420010     ---Check if Ability Active
00184fb8: beq r2,r0,0x00184fcc    10400004     ----Branch (skip) if not

If you watch the registers, you can look at r2 and see what's loaded in. If you equipped the correct ability r2 should be 0x00000010 after the load command

Then the and command is a masker. Bytes are made up of 8 bits which are as follows:
0x80        0x08
0x40        0x04
0x20        0x02
0x10        0x01

If you add these together you can produce all the numbers in between. the andi r2, r2, 0x10 command is masking the byte off except for the 0x10 bit. So after the andi command, r2 will be 0x00000010 if that flag was present, or 0x000000000 otherwise. This is how it checks for ONLY weapon guard. The beq command is "branch if equal". Since r0 is always 0, you're really doing "branch if equal to zero".

So it seems like when you hit the beq command, it's jumping to that address, 0x00184fcc? That means the support ability isn't present on the unit that you're attacking. Make sure you equip that 0x1E1 ability on your target.

Does that all make sense? On a positive note your hack was applied nicely :)

Krendall

February 14, 2014, 07:51:21 am #30 Last Edit: February 15, 2014, 11:00:16 am by Krendall
It's definitely equipped on the target and that's definitely the right ability since it shows up in the Support abilities on the job.

Alright, at the break point the r2 value is 80188b64, then when it reaches 0x184fb0: nop it becomes 00000000 and stays there for the rest of the steps.

A slightly off-topic question, but is there a difference between psxrel and psxfin? They seem like the same emulator with the same debugging options.

Choto

I'm not sure, I've never used psxfin.

So when it loads your support abilities, it's not seeing that 0x1E1 is active. I don't think there's any hardcoding associated with that blank support ability, but to be sure I would set the hack up to check for a different support ability and see if it works. Or you could set 0x1E1 innate for whatever job your target is and run the breakpoint again to see what happens. If the ability is equipped idk why it's not storing that the unit has the ability active.

Xifanie

psxrel : pSX release
psxfin : pSX final

I ―think― the rel version is as up to date, but to be safe, you might want to go with the final version.
  • 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

Krendall

Is it possible there's more hard-coding to Weapon Guard that we aren't addressing?

Either way, I think I want to put this on hold for now and look into adding formulas. Do you know which guide(s) talk about that kind of thing?

Choto

Nope, that's the only hardcoding... Can you post a save-state of you with the ability equipped at the world map? Then I can see exactly what's acting dumb...

Glain's tutorial is here: http://ffhacktics.com/smf/index.php?topic=8408.0

He touches on formula hacking. he goes through little code snippets and tells you what the code is doing, which is probably good for you to see just starting out. once you get passed understanding commands you feel alot better.

Krendall

Here's the save state and thanks for the link.

Choto

February 16, 2014, 08:47:50 am #36 Last Edit: February 16, 2014, 08:59:16 am by Choto
Ahh now that clears things up. Check out the picture I posted. In the disassembly you can see at 0x184fac there is the old vanilla code. This means the hack wasn't applied correctly. Post the patch your using and we'll check the offsets. Also be aware that if you patch something and then load a save-state, it will overwrite your patch. So to test you have to load up the game the long way.

If you look at the memory window, I've posted a portion of Ramza's Unit Data corresponding to http://ffhacktics.com/wiki/Battle_Stats

If you start at the top left corner (0x00) and then go down 9 and over 2, you'll be at byte 0x92. Here we can see that it's 0x10 so the support ability is active on the unit. Just gotta get that code patched.

Krendall

Here's the .xml file I used to apply the patch. I used the offsets you told me to use, so I'm not sure why things aren't working.

old school

Hi, Krendall.  There hasn't been any activity in this thread for some time, and I was wondering if you ever had any luck implementing your "Turn Undead" ability.  I was hoping to do something similar (old school FF Dia), but I have no idea how to modify formulas, and was hoping for some direction.
  • Modding version: PSX