Users browsing this thread: 1 Guest(s)
New Status Effect - Old

#1
Posts: 32
Threads: 5
Thanks Received: 4
Thanks Given: 1
Joined: Feb 2012
Reputation: 4
Status
Sleep
This is a work in progress, it is mostly functional but I was hoping to get some feedback and help on a couple parts of it. This quest started with wanting to improve Dance by removing the "berserk" part of it.  In doing so I realized that the Dance status effect could be freed up and replaced with something new. To do that I just changed the pointer:

Code:
ORIGINAL
C2/19ED: 7D 17     (Dance)
--------------------------
MODIFIED
C2/19ED: 85 17     (Old)

This bypasses the code that toggles on the Dance status which means that Dance no longer causes the dancer to act uncontrollably.  The status effect is still broken though; If you inflict the status the person that gets it will start dancing uncontrollably, which is funny to see but isn't what I was looking for. Next step is stopping that behavior which I did by editing this code:

Code:
ORIGINAL
C2/0959: F4 01 21     PEA $2101      (Dance, Hide, Rage)
C2/07B0: F4 11 03     PEA $0311      (Rage, Freeze, Dance, Stop)
----------------------------------------------------------------
MODIFIED
C2/0959: F4 00 00     PEA $0000      (N/A)
C2/07B0: F4 00 00     PEA $0000      (N/A)

One interesting side effect of this is that it also uncouples Rage from the berserk aspect, allowing you to select a different Rage or whatever else you want to every turn. This may be fixable which is one of my questions. I don't understand the PEA opcode very well, does this work similarly to the BIT opcode? I don't know if I can use a different number so that I can remove Dance without removing Rage. 

Now we have a status effect that is just a blank slate. To give it functionality I'm treating it like the opposite of the Morph status. So when you are inflicted with the status you will deal 50% less damage.  I don't think I want the player to take more damage with this effect so I have opted not to do that, but it is possible, or if someone wanted to create a different status they could do that effect themselves! Now onto the code; I am using some free space for this, I can optimize a bit if I ever make a patch but this is just based on what I am working on: 

Code:
ORIGINAL
C2/336F: AD A2 11     LDA $11A2
-----------------------------------------------------------------
MODIFIED
C2/336F: 4C 69 64     JMP $6469      (New Code)

NEW CODE
C2/6469: A9 01        LDA #$01
C2/646B: 3C F8 3E     BIT $3EF8,X
C2/646E: F0 06        BEQ $6476      (Branch if attacker not Old)
C2/6470: 4E B1 11     LSR $11B1
C2/6473: 6E B0 11     ROR $11B0      (Cut damage in half)
C2/6476: AD A2 11     LDA $11A2
C2/6479: 4C 72 33     JMP $3372

The next step is to do a quick change to the text display so it will show properly in combat: 

Code:
ORIGINAL
C2/AEC7: FF FF FF FF FF FF FF FF FF FF  (" ") (Dance)
-----------------------------------------------------
MODIFIED
C2/AEC7: 8E A5 9D FF FF FF FF FF FF FF  ("Old")  

The main thing left to do is where I am stumped. I was looking through documentation and editors but I cannot find where the data is for the graphical changes to characters that are inflicted with status effects in battle, such as the glow from effects like Haste, Slow, and Stop. I was thinking of taking the small graphical effect from the Rage status since it is no longer a berserk-like effect. Does anyone have anything to point me to so I can switch this around? Thank you for any help or feedback you can provide!  Victory


EDIT: One thing I didn't mention is that if anyone is trying to implement something like this you would need to alter some of the code regarding failing a dance, since if you fail that dance it would un-toggle the status, in the case that you had it set. I didn't have to do that for my work since I was using the Mog Never Fails patch which already addresses that issue.

EDIT 2: Something else to note...because of where the Dance status is in the code(Byte 3), there are some limits to its functionality. An enemy or player can have the status toggled on or off, but only an enemy can be immune to it. You can make an item that cures it or a spell that cures/inflicts it but it cannot be added to any weapon or armor. It may be possible that if a player has Auto-Float they could be immune to it as a monster would be but I have not tested this.
Quote  

#2
Posts: 383
Threads: 34
Thanks Received: 10
Thanks Given: 13
Joined: Dec 2018
Reputation: 18
Status
Moog
PEA is "Push Effective Address".  What it does is place a value onto the stack.  In the instance referenced, those values are then read by a subroutine as bitfields to the status bytes.

So yeah, you need to convert the hexadecimal 16-bit number to a binary list, and compare that to the two status bytes they correspond to.

0x0311 is 0000 0011 0001 0001.
Dance is the lowest significance bit on the lower byte.
So 0x0310 would exclude Dance from the statuses to remove.

The other spot, 0x2101, should use 0x2100 (in theory).  This is because 0x20 on the high byte is "Hidden" and 0x01 on the high byte is "Rage", whereas the lone 0x01 on the low byte is Dance.


With regards to your question on character palette management, the routines are in the C1 bank.

https://raw.githubusercontent.com/everyt...s/ff3u.asm

This is Everything's complete disassembly of the game.  It has comments on many of the routines which will help you navigate the game for your modifications.
You're looking for C1/2DD3.  The way this routine works is that it checks various statuses and then adjusts the palette accordingly.  There are three types of palette adjustments here: total palette replacement (like you would see for things like Petrify or Frozen), Skin Index replacement (wherein only the two specific index colors are swapped), and outline pulsing (like how Haste makes the character's outline glow red).


The second, skin index replacement, goes to a routine at C1/2F0D, which takes the number you send into it x4 as an index into a table starting at C2E3AE.  This replaces two colors in the character's palette with those from the table (colors 7 and 8, which are stored at $7F8C,Y and $7F8E,Y respectively at this point).

For a status like Old, you're probably going to want to change the three hair colors instead (Hair Light, Hair Dark, and Eyes), or possibly the whole palette to grayscales and pale whites since not every character uses the same color indices for their hair like they do in FF5.  As such, you're probably going to have an easier time mirroring the way that Freeze and Petrify change colors instead.
  Find
Quote  
[-] The following 1 user says Thank You to C-Dude for this post:
  • Xontract (01-07-2024)

#3
Posts: 32
Threads: 5
Thanks Received: 4
Thanks Given: 1
Joined: Feb 2012
Reputation: 4
Status
Sleep
(01-06-2024, 05:26 PM)C-Dude Wrote: With regards to your question on character palette management, the routines are in the C1 bank.

https://raw.githubusercontent.com/everyt...s/ff3u.asm

This is Everything's complete disassembly of the game.  It has comments on many of the routines which will help you navigate the game for your modifications.
You're looking for C1/2DD3.  The way this routine works is that it checks various statuses and then adjusts the palette accordingly.  There are three types of palette adjustments here: total palette replacement (like you would see for things like Petrify or Frozen), Skin Index replacement (wherein only the two specific index colors are swapped), and outline pulsing (like how Haste makes the character's outline glow red).


The second, skin index replacement, goes to a routine at C1/2F0D, which takes the number you send into it x4 as an index into a table starting at C2E3AE.  This replaces two colors in the character's palette with those from the table (colors 7 and 8, which are stored at $7F8C,Y and $7F8E,Y respectively at this point).

For a status like Old, you're probably going to want to change the three hair colors instead (Hair Light, Hair Dark, and Eyes), or possibly the whole palette to grayscales and pale whites since not every character uses the same color indices for their hair like they do in FF5.  As such, you're probably going to have an easier time mirroring the way that Freeze and Petrify change colors instead.

This is really informative and helpful, thank you!  I am going to look into this more and see what I can come up with.

EDIT: I was able to make this work!  There is an unused space for a glowing effect so it made the most sense to use that.  I ended up moving some colors around and adding in a new one, I may change this later but this is what I came up with:

Code:
ORIGINAL
---------------------------------
C1/2E02: 4C B4 2E     JMP $2EB4
C1/2E2A: 4C B4 2E     JMP $2EB4
C1/2E4F: 80 63        BRA $2EB4
C1/2E5C: 80 56        BRA $2EB4
C1/2E69: 80 49        BRA $2EB4
C1/2E73: 80 3F        BRA $2EB4
C1/2E7E: 80 34        BRA $2EB4
C1/2E8B: 80 27        BRA $2EB4
C1/2E98: 80 1A        BRA $2EB4
C1/2E9E: F0 07        BEQ $2EA7

C1/2EA5: 80 0D        BRA $2EB4
C1/2EA7: A5 38        LDA $38         ; return if character doesn't have slow status
C1/2EA9: 29 04        AND #$04
C1/2EAB: F0 07        BEQ $2EB4
C1/2EAD: A9 04        LDA #$04
C1/2EAF: 20 C3 2E     JSR $2EC3       ; update glowing border (white/slow)
C1/2EB2: 80 00        BRA $2EB4
C1/2EB4: 60           RTS

C2/E3BA: 60 6A        .DW $6A60       ; glowing border color (blue/reflect)
C2/E3C2: FF 7F        .DW $7FFF       ; glowing border color (white/slow)
C2/E3C6: 1A 00        .DW $001A       ; glowing border color (red/unused)

MODIFIED
--------------------------------
C1/2E02: 4C B1 2E     JMP $2EB1
C1/2E2A: 4C B1 2E     JMP $2EB1
C1/2E4F: 80 60        BRA $2EB1
C1/2E5C: 80 53        BRA $2EB1
C1/2E69: 80 46        BRA $2EB1
C1/2E73: 80 3C        BRA $2EB1
C1/2E7E: 80 31        BRA $2EB1
C1/2E8B: 80 24        BRA $2EB1
C1/2E98: 80 17        BRA $2EB1

C1/2E9E: F0 06        BEQ $2EA6
C1/2EA5: 60           RTS
C1/2EA6: A5 38        LDA $38         ; branch if character doesn't have slow status
C1/2EA8: 29 04        AND #$04
C1/2EAA: F0 06        BEQ $2EB2
C1/2EAC: A9 04        LDA #$04
C1/2EAE: 20 C3 2E     JSR $2EC3       ; update glowing border (blue/slow)
C1/2EB1: 60           RTS        
C1/2EB2: 4C 98 4B     JMP $4B98       ; new subroutine

C2/E3C6: FF 7F        .DW $7FFF       ; glowing border color (white/old)
C2/E3BA: F0 0F        .DW $0FF0       ; glowing border color (purple/reflect)
C2/E3C2: 6A 60        .DW $6A60       ; glowing border color (blue/slow)

NEW SUBROUTINE
-----------------------------------
C1/4B98: A5 38        LDA $38         ; return if character doesn't have old status
C1/4B9A: 29 01        AND #$01
C1/4B9C: F0 07        BEQ $4BA5
C1/4B9E: A9 06        LDA #$06
C1/4BA1: 20 C3 2E     JSR $2EC3       ; update glowing border (white/old)
C1/4BA3: 80 00        BRA $4BA5
C1/4BA5: 60           RTS

Thanks again!
Quote  
[-] The following 1 user says Thank You to Xontract for this post:
  • Gi Nattak (01-07-2024)

#4
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
(01-06-2024, 05:26 PM)C-Dude Wrote: https://raw.githubusercontent.com/everyt...s/ff3u.asm

I wasn't aware of that file, thanks for that link!



  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite