• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 18, 2024, 12:02:29 pm

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!


Zodiac Compatibility Modify?

Started by stardragoon9, September 24, 2018, 05:48:29 am

stardragoon9

Is there anyway to modify Zodiac Compatibility?Like changing the percentage of Best,Worst,Good,Bad.

I've search the forum and there is a No Zodiac Compatibility Calculation hack.What i seek is a hack that does Calculate but make the effect lesser.
  • Modding version: PSX

Xifanie

Have you tried looking at the routine on the wiki?
  • 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

stardragoon9

September 24, 2018, 07:40:18 am #2 Last Edit: September 24, 2018, 08:58:48 am by stardragoon9
Quote from: Xifanie on September 24, 2018, 07:02:49 am
Have you tried looking at the routine on the wiki?

Do you mean this? http://ffhacktics.com/wiki/Calculate_Zodiac_Symbol

I would like to change Bad/Good from 20% to 10% and Worst/Best from 50% to 20%

Currently ASM hack is beyond my ability,i have no knowledge of programming prior visiting ffHacktics.I did try to learn from the tutorial from the sticky,but having problem even understanding that(i know it might sound stupid :(,but i'm still trying).Main while when i need some feature i would try to search the entire forum inside out to get it,maybe that explains why i've been finding alot of old threads,and if even that doesn't work,i'll post in the help section(I know that you might think hacking it yourself is much easier than finding luck,but that might only apply to those that are capable  :oops:)
  • Modding version: PSX

3lric

Being capable comes from years of practice and dedication...
  • Modding version: PSX

xjamxx

Quote from: stardragoon9 on September 24, 2018, 07:40:18 am
Do you mean this? http://ffhacktics.com/wiki/Calculate_Zodiac_Symbol

I don't think so, may be this one:
http://ffhacktics.com/wiki/Compatibility

I am still learning MIPS, plus I am trying to follow Glain steps... This is my first patch in asm mode, didn't have time to test it so dunno if it will work, but in theory it does what u ask from 25% to 10% as base. Here:
  <Patch name="Zodiac Compatibility Amount Hack">
    <Description>Vanilla does 1/4 for bad and good and doubles it for best and worst. Here it does 1/10.</Description>
    <Location file="BATTLE_BIN" offset="184a30" mode="ASM" offsetMode="RAM">
       sll v1,v0,0x03
       addu v1,v1,v0
       addu a1,v1,v0
       nop
    </Location>
  </Patch>
<!--
(v0 = r2, v1 = r3, a1 = r5)
Original code:
00184a30: 00021840 sll r3,r2,0x01      XA * 2
00184a34: 00621821 addu r3,r3,r2      XA * 3
00184a38: 000318c0 sll r3,r3,0x03      XA * 24
00184a3c: 00622821 addu r5,r3,r2      XA * 25
Current code:
00184a30: sll v1,v0,0x03            XA * 8
00184a34: addu v1,v1,v0            XA * 9
00184a38: addu a1,v1,v0            XA * 10
00184a3c: nop
-->
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

stardragoon9

Quote from: xjamxx on September 24, 2018, 12:00:58 pm
I don't think so, may be this one:
http://ffhacktics.com/wiki/Compatibility

I am still learning MIPS, plus I am trying to follow Glain steps... This is my first patch in asm mode, didn't have time to test it so dunno if it will work, but in theory it does what u ask from 25% to 10% as base. Here:
  <Patch name="Zodiac Compatibility Amount Hack">
    <Description>Vanilla does 1/4 for bad and good and doubles it for best and worst. Here it does 1/10.</Description>
    <Location file="BATTLE_BIN" offset="184a30" mode="ASM" offsetMode="RAM">
       sll v1,v0,0x03
       addu v1,v1,v0
       addu a1,v1,v0
       nop
    </Location>
  </Patch>
<!--
(v0 = r2, v1 = r3, a1 = r5)
Original code:
00184a30: 00021840 sll r3,r2,0x01      XA * 2
00184a34: 00621821 addu r3,r3,r2      XA * 3
00184a38: 000318c0 sll r3,r3,0x03      XA * 24
00184a3c: 00622821 addu r5,r3,r2      XA * 25
Current code:
00184a30: sll v1,v0,0x03            XA * 8
00184a34: addu v1,v1,v0            XA * 9
00184a38: addu a1,v1,v0            XA * 10
00184a3c: nop
-->



Thanks for you hack! BTW may i ask what these value after XA * stand for,and whats the formula behind it(like how exactly does Compatibility calculated in that routine link)?
  • Modding version: PSX

xjamxx

Before i start, just in case if  you see "<!--" in .xml that means it is comment not code or smt that the program will read until "-->". I usually left comments to myself in everything i do (cuz i am lazy and tend to forget things really fast). Sorry if u already knew it.
Vanilla
















AddressInstruction-hexInstruction-asmComment
00184a3000021840sll r3,r2,0x01XA*2, r2 has XA and 'sll' by 0x01 equals multiply by 2, so r3 stores XA*2
00184a3400621821addu r3,r3,r2XA*3, r2 still has XA and 'addu' adds r2 to r3 and save in r3, so now r3 stores XA*3
00184a38000318c0sll r3,r3,0x03XA*24, r3 has XA*3 and 'sll' by 0x03 equals multiply by 8 (2*2*2), so now r3 stores XA*24
00184a3c00622821addu r5,r3,r2XA*25, r2 still has XA and 'addu' adds r2 to r3 and save in r5, so r5 stores XA*25. After this the game engine will keep reading untouched instructions but it will use the value stored in r5 for calculations


Patch
















AddressInstruction-hexInstruction-asmComment
00184a30????????sll v1,v0,0x03 XA*8, v0=r2 has XA and 'sll' by 0x03 equals multiply by 8 (2*2*2), so now v1=r3 stores XA*8
00184a34????????addu v1,v1,v0XA*9, v0=r2 still has XA and 'addu' adds v0=r2 to v1=r3 and save in v1=r3, so now v1=r3 stores XA*9
00184a38????????addu a1,v1,v0XA*10, v0=r2 still has XA and 'addu' adds v0=r2 to v1=r3 and save in a1=r5, so a1=r5 stores XA*10. Remember the game engine will use the value stored in r5 for calculations
00184a3c00000000nopNo operation. Just for filling, to prevent unwanted code.
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

stardragoon9

Quote from: xjamxx on September 24, 2018, 01:53:15 pm
Before i start, just in case if  you see "<!--" in .xml that means it is comment not code or smt that the program will read until "-->". I usually left comments to myself in everything i do (cuz i am lazy and tend to forget things really fast). Sorry if u already knew it.
Vanilla
















AddressInstruction-hexInstruction-asmComment
00184a3000021840sll r3,r2,0x01XA*2, r2 has XA and 'sll' by 0x01 equals multiply by 2, so r3 stores XA*2
00184a3400621821addu r3,r3,r2XA*3, r2 still has XA and 'addu' adds r2 to r3 and save in r3, so now r3 stores XA*3
00184a38000318c0sll r3,r3,0x03XA*24, r3 has XA*3 and 'sll' by 0x03 equals multiply by 8 (2*2*2), so now r3 stores XA*24
00184a3c00622821addu r5,r3,r2XA*25, r2 still has XA and 'addu' adds r2 to r3 and save in r5, so r5 stores XA*25. After this the game engine will keep reading untouched instructions but it will use the value stored in r5 for calculations


Patch
















AddressInstruction-hexInstruction-asmComment
00184a30????????sll v1,v0,0x03 XA*8, v0=r2 has XA and 'sll' by 0x03 equals multiply by 8 (2*2*2), so now v1=r3 stores XA*8
00184a34????????addu v1,v1,v0XA*9, v0=r2 still has XA and 'addu' adds v0=r2 to v1=r3 and save in v1=r3, so now v1=r3 stores XA*9
00184a38????????addu a1,v1,v0XA*10, v0=r2 still has XA and 'addu' adds v0=r2 to v1=r3 and save in a1=r5, so a1=r5 stores XA*10. Remember the game engine will use the value stored in r5 for calculations
00184a3c00000000nopNo operation. Just for filling, to prevent unwanted code.



Yeah,i know these were your notes  :D  I'm Asking out of curiosity because from that routine link i can't understand whats really going on.

So this  "addu a1,v1,v0   XA * 10"  is r5 which used for calculation,Can i assume that the 10 here is 10%(please correct me if i misunderstood)? But what does these two lines do "sll v1,v0,0x03  XA * 8,addu v1,v1,v0  XA * 9"?
  • Modding version: PSX

xjamxx

Yes the final XA*whatever is the percentage, so if whatever is  25 then 25%, if is 13 =13%. For Bad and Good. Worst and Best doubles the percentage, so 25% goes to 50%, 13% goes to 26%, 10% goes to 20%.

"addu a1,v1,v0" doesn't do XA*10 by itself, is more like "addu r5,r3,r2" == "r5=XA*9+XA", that is why previous line was XA*9.

It may be confusing, but is a low level language not like 'python' or 'ruby' or 'c#', what you are searching is this:
mult r5,r2,10 --> r5=r2*10, where r2=XA

Sadly there is no mult like that in MIPS (psx hardware, to put it simple). Before someone shouts, i know, there is a mult instruction in MIPS set but it doesn't behave with that simple syntax. You could use it nonetheless but in this low level language is easier to write this:
"r3=XA*8"
"r3=r3+XA"
"r5=r3+XA"
Than this:
"r5=XA*10"
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

stardragoon9

Quote from: xjamxx on September 24, 2018, 02:23:18 pm
Yes the final XA*whatever is the percentage, so if whatever is  25 then 25%, if is 13 =13%. For Bad and Good. Worst and Best doubles the percentage, so 25% goes to 50%, 13% goes to 26%, 10% goes to 20%.

"addu a1,v1,v0" doesn't do XA*10 by itself, is more like "addu r5,r3,r2" == "r5=XA*9+XA", that is why previous line was XA*9.

It may be confusing, but is a low level language not like 'python' or 'ruby' or 'c#', what you are searching is this:
mult r5,r2,10 --> r5=r2*10, where r2=XA

Sadly there is no mult like that in MIPS (psx hardware, to put it simple). Before someone shouts, i know, there is a mult instruction in MIPS set but it doesn't behave with that simple syntax. You could use it nonetheless but in this low level language is easier to write this:
"r3=XA*8"
"r3=r3+XA"
"r5=r3+XA"
Than this:
"r5=XA*10"


Thank you!I understand it now.This was frustrating to understand without explanation(for a layman like me  :P).
  • Modding version: PSX

Glain

Quote from: xjamxx on September 24, 2018, 02:23:18 pm
Yes the final XA*whatever is the percentage, so if whatever is  25 then 25%, if is 13 =13%. For Bad and Good. Worst and Best doubles the percentage, so 25% goes to 50%, 13% goes to 26%, 10% goes to 20%.

"addu a1,v1,v0" doesn't do XA*10 by itself, is more like "addu r5,r3,r2" == "r5=XA*9+XA", that is why previous line was XA*9.

It may be confusing, but is a low level language not like 'python' or 'ruby' or 'c#', what you are searching is this:
mult r5,r2,10 --> r5=r2*10, where r2=XA

Sadly there is no mult like that in MIPS (psx hardware, to put it simple). Before someone shouts, i know, there is a mult instruction in MIPS set but it doesn't behave with that simple syntax. You could use it nonetheless but in this low level language is easier to write this:
"r3=XA*8"
"r3=r3+XA"
"r5=r3+XA"
Than this:
"r5=XA*10"


It's not that mult or multu is hard to use.  This is how it would look:

li         v1, 10
multu  v0, v1
mflo    a1

You could even use a variable for the first line that defaults to 10 or whatever.

The reason that you often see bit shifts and adds/subtracts instead of mult or div is that they run faster... but in this case you wouldn't notice a difference anyway.  The same can be said about mult being faster than div.
  • Modding version: Other/Unknown