Users browsing this thread: 1 Guest(s)
Elemental priorities and ignore damage...

#1
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
1) Ok, this one is quite complicated: i wanted to change elemental weakness/absorb/immunity/resistance priority, but not only that: i also need to rise the priority of the case in which there's no damage modifier to elements at all, which has no priority, at the moment... It should end up into something like this:

Weak > nothing > Resistance > Immunity > Absorb

That's especially required due to multi-elemental attacks that i'll use in my hack.

I searched the related disassembly and i also found how it works, i already know how to change the order of priorities, but there's a big problem:
"No change" don't have any bit combination that allows to recognize if the target has no elem. damage modifier, unless the previous checks don't find any of them... but that means also that they are destined to have a greater priority on "no change" Sad

the related code starts from here, until RTS:
C2/0BD3: AD A1 11 LDA $11A1

I'm breaking my mind in finding a proper check combination that forces to examine the case in which "no change" isn't detected in any of the 8 elements, and only after that, the check of resistance/immunity/absorb.
I'm afraid it's too much difficult to figure it out on my own...


2) This one should be easy:
I found this line in damage formula of disassembly:
C2/0CC9: D0 57 BNE $0D22 (Branch if ignores defense)

Say i replace D0 57 with EA EA...
Will that mean that ALL the possible attacks(including Umaro relics, tools, throw on flying monster weapons, etc...) of FF6 won't be anymore able to ignore defense?

I tried to write some code:

C2/0BE2: 4C 70 65
C2/0BE5: EA EA EA
C2/0BE8: EA EA
C2/0BEA: EA EA
C2/0BEC: EA EA
C2/0BEE: EA EA
C2/0BF0: EA EA
C2/0BF2: B9 CD 3B
C2/0BF5: 2C A1 11
C2/0BF8: F0 14
C2/0BFA: 64 F0
C2/0BFC: 64 F1
C2/0BFE: 80 1E
C2/0C00: B9 E1 3B
C2/0C03: 2C A1 11
C2/0C06: F0 EA
C2/0C08: 46 F1
C2/0C0A: 66 F0
C2/0C0C: 80 10
C2/0C0E: B9 CC 3B
C2/0C11: 2C A1 11
C2/0C14: F0 08
C2/0C16: A5 F2
C2/0C18: 49 01
C2/0C1A: 85 F2
C2/0C1C: 80 2C
C2/0C1E: AD A9 11
C2/0C21: C9 04
C2/0C23: D0 03
C2/0C25: 20 39 0E
C2/0C28: 20 2D 0C
C2/0C2B: 28
C2/0C2C: 60


B9 E0 3B // C2/6570
2C A1 11
F0 0B
A5 F1
30 04
06 F0
26 F1
4C 1E 0C // is weak
DA // not weak
A2 00
B9 CC 3B
2C A1 11
F0 01
E8
B9 CD 3B
2C A1 11
F0 01
E8
B9 E1 3B
2C A1 11
F0 01
E8
E0 03
F0 04
FA
4C 00 0C
FA
4C 1E 0C

Result: "almost" managed to change priorities... but there are 2 problems
1) the last check is for absorbing element, when all the other check fail, and so it starts the one related to absorb, then the game crashes...?
2) "no change" to elements damage won't have an higher priority, but reading better the code it was quite predictable...

Then i tried to change 2 times the piece of code that starts when "weak" check fails:

B9 CC 3B // not weak (2nd try)
19 CD 3B
19 E1 3B
2C A1 11
D0 03
4C 00 0C
4C 1E 0C


// not weak (3rd try)

AD A1 11
39 CC 3B
39 CD 3B
39 E1 3B
c9 00
D0 03
4C 00 0C
4C 1E 0C

Those 2 attempts had the same result: now "no change" has the highest priority, after "weak"... the problem is that now halve/immunity/absorb won't be anymore able to be triggered, because "no change" is always true? I'm not able to figure out the solution at the moment... Sad


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#2
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
I'm still trying like hell to wrap my brain around what your tring to accomplish.
In last line there regarding "no change" always being true. It will be because no other checks have made.
The promblem I have is figuring out why your trying to set a no change before anything else. If you dont want a change then why wouldnt you just remove any elemental flag from your attack for the sake of dmg calculation. Are you trying for a multi element attack that is treated with no change? At that point the game wouldnt need to handle it as ever having elemental dmg from the start.

Still not sure what your looking for (other than treating no change as an element itself) if thats the case, reduce the stregth of the spell and just ignore defense all together to balace is out, maybe?


The only true wisdom is knowing you know nothing.
  Find
Quote  

#3
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Would it be too much to ask to post your ASM code instead of raw hex? I can't read what you coded and I won't disassemble the code just to check what you did. I don't think I'm the only one who doesn't know each opcode by heart. You can use DUDE to easily disassemble the code.
  Find
Quote  

#4
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
@catone: there's an HUGE reason, with this new priority this will happen:

weak > no change > halve > immune > absorb

"No change" is a must, say you leave no change as last in the priority: now some stupid stuff will happen... if you're hit from a 2 element spell... say fire + wind, if you absorb fire and are immune to wind, then the damage will be 0 as planned, because i want that you must absorb both elements for absorb the whole damage.

What if you absorb fire and "no change" to wind? "no change" will be ignored and so you'll absorb the damage... pretty much convenient and stupid, since the result would have been worse, if you were immune to wind(kinda like a paradox)... that's why "no change" must be second only to weak.

The problem of those checks is that they are good only to say if none or all the elements are flagged as halve/immune/absorb... what i believe i need is to make "no change" check true if there's at least one element which is not flagged as halve/immune/absorb
On a side note i might have some new idea, but i cannot guarantee anything.
____________________

@Madsiur: oh, i thought all you were used to hex code... i also thought that you wrote the asm near just to made it more readable to the others.
Could i have been wrong until today, thinking that FF6 hackers directly hack the hex code using raw hex? I always did in this way, but only because i was almost sure that there was no way to use a program that allowed to open the rom as an assembly code(or an higher level language)
Well Abyssonym did the randomizer using Python, so i guess i was definitively wrong Laugh

I'll post the ASM version later, now i cannot do it...


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#5
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
... You don't open the ROM in a disassembler to use ASM. You write .asm files and then apply them to the ROM using an assembly program, like xkas or asar. So, yes, you were definitively wrong.

Disassemblers (like DUDE, which Madsiur mentioned) are used to render the game code as readable assembly, but aren't intended for directly hacking the code. You can modify game code live with debugging emulators, but in my experience that's more useful for working with data rather than code. (I've used it primarily for experimenting with window sizes, personally, and occasionally with live-modifying SRAM values.)


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  

#6
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
That actually makes sense now, or maybe I'm just awake now. Regardless, and I hate to say it but, trying to get that result from the original formula seems about as likely as running oil through a coffee filter and getting gasoline. You said it yourself, its just not really that advanced. And would the required modifications allow normal operation?

What would happen, or is it even possible, to subtract the immunities from the attack elements then branch if empty? Instead of just compare that is.


Of course, its often good when I'm wrong. Now if somebody would just hook me up with that gas making coffee filter it would be even better.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#7
Posts: 52
Threads: 5
Thanks Received: 24
Thanks Given: 0
Joined: Jun 2010
Reputation: 6
Status
None
Your code is crashing because you didn't account for one of the branches. Your code isn't working because your bit logic isn't quite right.

This branch:
Code:
C2/0C1C: 80 2C
Change like so:
Code:
C2/0C1C: EA
C2/0C1D: EA

As for checking for no elemental affinity, you almost had it:
Code:
B9 CC 3B       LDA $3BCC,y
19 CD 3B       ORA $3BCD,y
19 E1 3B       ORA $3BE1,y
49 FF          EOR #$FF    <--Add this
2C A1 11       BIT $11A1
D0 03          BNE $6583
4C 00 0C       JMP $0C00
4C 1E 0C       JMP $0C1E
Quote  

#8
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
C2/0C1C: 80 2C ?!?
Damn, i copied 2 extra byte from the absorb code!! Laugh what a shame...

So XOR FF was the right answer, huh? At the beginning i thought to use OR FF, but i was aware that it would lead to the same result of attempt 2 and 3.
Man, when i don't know what to do, XOR is often the answer, i should learn better when it's required...
So, what did it do anyway? If i understood correctly, all absorb/immune/halve elements were counted as 1 in that moment, the others were 0, with XOR FF they become 0 and the others 1, right? then BIT combines the elements used in the attack with the accumulator, but i don't remember how... could you explain that to me? for the sake of my knowledge, you know...

Anyway i fixed that stuff and added XOR and now it worked perfectly!! you're the man, Drakkhen Wink

@catone: it wasn't so hard as you thought, after all... something crazy would have been doing math with element affinities. (weak + absorb = neutral, halve + weak = + 50% damage, etc...)
I was just one step from the solution this time, the lesson is: never back down... i suggest you the same for your magitek armor hack, which is quite tricky.


______________________________________________________________________
______________________________________________________________________
PS. there was also a little question left unaswered in the OP, which it really needs to be answered: (i'll rewrite it here, maybe it was just forgotten, due to the length of previous posts)

2) This one should be easy:
I found this line in damage formula of disassembly:
C2/0CC9: D0 57 BNE $0D22 (Branch if ignores defense)

Say i replace D0 57 with EA EA...
Will that mean that ALL the possible attacks(including Umaro relics, tools, throw on flying monster weapons, etc...) of FF6 won't be anymore able to ignore defense?
_____________________________________________________________________


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#9
Posts: 52
Threads: 5
Thanks Received: 24
Thanks Given: 0
Joined: Jun 2010
Reputation: 6
Status
None
Quote:So, what did it do anyway? If i understood correctly, all absorb/immune/halve elements were counted as 1 in that moment, the others were 0, with XOR FF they become 0 and the others 1, right? then BIT combines the elements used in the attack with the accumulator, but i don't remember how... could you explain that to me? for the sake of my knowledge, you know...

By combining the elemental resistances and XORing with 0xFF, we get all the elements with no resistances. If we AND(what the BIT opcode does) the elements of the attack with the elements with no resistances, we get 0 unless there were any elements of the attack that had no resistance.

Quote:2) This one should be easy:
I found this line in damage formula of disassembly:
C2/0CC9: D0 57 BNE $0D22 (Branch if ignores defense)

Say i replace D0 57 with EA EA...
Will that mean that ALL the possible attacks(including Umaro relics, tools, throw on flying monster weapons, etc...) of FF6 won't be anymore able to ignore defense?

Yes and no.
Attacks set to ignore defense would no longer do so, but attacks that skip damage modification entirely would still not be subject to defense.
Quote  

#10
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Do you know which ones are the attack that will keep to ignore defense?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite