Author Topic: Chillyfeez's Mods, hacks, research notes, etc.  (Read 17621 times)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Chillyfeez's Mods, hacks, research notes, etc.
« on: June 02, 2014, 02:30:21 PM »
In an effort to limit the amount of new topics I start, I'm creating this thread.

An index of all of the stuff I've posted in this forum that might be of use to other FFIV hackers,
or of interest to FFIV fans who might want to see some changes/updates to the game

Please note this is not complete yet

1) My hack - Final Fantasy II: A Threat from Within
This is a work in progress, but there is a playable demo attached to the first post

2) Other Mods These may not patch cleanly into already-altered ROMs, so beware!
Random Chocobo Encounters - Meet chocobos on the field in the Overworld in order to catch and ride them!
Summon Phoenix - Turns Odin into Phoenix (fire damage to enemies, revives fallen party members). Will patch cleanly, but overwrites some Odin Graphics, so the Odin battle will have to be changed somehow.
Shadow Mod - This is a mod that allows you to add and remove characters at will without losing their stats, experience, and equipment. All characters, pretty much whenever you want. But please read the whole post linked here, as there are some weird things that happen sometimes.
Scroll Through Targets with Y - Allows the player to scroll through all available targets in a battle by pressing the Y button

3) Patches Mods that will patch cleanly into already-edited ROMs
Monsters Level Up as You Do
A Pet Black Chocobo - This will let you keep your Black Chocobo, and not fly back to its home every time.
Press L to toggle running - Does exactly what it says
Press X to defer to the next ready character in battle - Ditto
ATB Meter - allows you to switch between viewing Max HP and Battle readiness during battle (option available in the Custom menu, replaces stereo/mono). WILL NOT PATCH CLEANLY WITH "Press X to Defer!"
Enhanced ATB - combines the two previous patches(without crashing)
User Options - Combines L-to-run, X-to-defer, and ATB meter
Break Damage Limit - allows attacks to register as high as 16383 per target instead of capping damage at 9999

4) How-Tos
Alter Summoned Monsters
Alter "Special" Monster Sizes
Hacking the Music
Change which Overworld Landscape features change with Flags (such as the mountains that appear outside of Mist when Rydia calls Titan)
Same as above, but faster!
Determine Overworld Monster Encounters by Event Flag (instead of by location on the map)
Make a fully functional, any item Salve command!
Change "Call" into a five character label in the Magic Menu
Change Charging and Action stances for battle commands
More to come!
« Last Edit: April 10, 2016, 01:58:56 PM by chillyfeez »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #1 on: June 02, 2014, 02:34:50 PM »
So anyway, I've been playing ffviii,and was inspired to create a mod that makes monsters level up as the player does. It's a massive amount of code, and has required a lot of debugging as I go, but I'm almost there. Of course I'll put up a patch when it's ready.
Unlike the chocobo encounters mod, this will be a patch that can be applied to any FFIIUS ROM,even if it's already been edited.

koala_knight

  • Tunnel Armor
  • *
  • Posts: 166
  • Gender: Male
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #2 on: June 03, 2014, 06:05:08 PM »
That's a pretty neat mod. It would definitely extend the usefulness of weaker monsters allowing for the various color swaps to be different instead of mostly just stronger versions of the same enemy.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #3 on: June 03, 2014, 07:07:01 PM »
Yeah, you know, I hadn't even thought of that. It was more of an anti-grinding mechanism in my mind, but you're absolutely right.
I finally got it working late last night. Will have the patch up soon.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #4 on: June 03, 2014, 11:39:55 PM »
So here's the patch. It should work when applied to any FFIIUS v1.1 ROM, even if it's been edited already (as long as you haven't messed with the part of the ROM that loads monster stats at the beginning of battle).

I'll eventually post a disassembly, but it is a huge amount of code.
To simplify what it does:
1) loads base monster stats as normal
2) finds the average level of the party (henceforth referred to as APL) - well, sort of. I don't know how to make SNES divide by any number but 2, so when there are 5 or 3 party members, first the game subtracts the level of the party member in the latest slot, then divides by 4 or 2 respectively. Of course, that means that if you place your highest level character in slot 5, you can minimize the amount that monsters level up (but unless your party has drastically uneven levels, you won't notice much difference).
3) determines if the monster is a boss - if so, skips the process
4) determines if the monster is a higher level than your APL - if so skips the process
5) multiplies the following stats by 1.5: Level, HP/MAX, Attack Multiplier, Attack Base, Defense Multiplier, Defense Base, M-Defense Multiplier, M-Defense Base, Speed
6) halves the determined APL
7) jumps back to step 4 and repeats until the Monster's level is higher than the APL

As in FFVIII, early monsters will still be pushovers, but more powerful monsters will get really difficult when you are at high levels.
It'll be pretty easy to alter how much more powerful the monsters get, so really, if you try this out, let me know what you think - if I should make them get even stronger, or if they get too strong. I can make adjustments.

 :edit: Created a new patch using a new formula (thanks, assassin, for the assist), available a few posts down from here
« Last Edit: June 09, 2014, 10:23:10 AM by chillyfeez »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #5 on: June 05, 2014, 12:46:45 AM »
Oh man! This is a legendary patch! I love when games take the effort to balance themselves alongside the player! This just might be the best bit of hacking ever done for FFIV! A job truly well done Chillyfeez!

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #6 on: June 05, 2014, 03:32:29 AM »
Re #2: see how Square does it in FF3us function C2/4792 in the C2 disassembly:
http://home.comcast.net/~assassin17/guides.htm

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #7 on: June 05, 2014, 08:49:44 AM »
Oh, wow.
It seems like a simple set of instructions, but I'm not quite sure I understand by looking at the code how the division is actually happening there. Would this theoretically work in ffiv, too?

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #8 on: June 05, 2014, 10:35:24 AM »
Those $0042nn variables are custom SNES math registers.  Just set them, and it knows what to do. ;)  It takes several cycles, which is why the NOPs are there.  Mode-7 registers are another option for math, though I'm less familiar with those.  Yes, both of these should work on FF4.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #9 on: June 05, 2014, 10:40:44 AM »
Well, if you're interested, here's a commented disassembly of the code used to level-up monsters.

Code: [Select]
$03/90F5 5C 60 DE 01 JMP $01DE60      ;Jump to custom code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$01/DE60 9D 24 20    STA $2024,x[$7E:22A4]   ;Performs the action that was skipped in original code
$01/DE63 8E 80 22    STX $2280  [$7E:2280]   ;Temporarily store Registers X and Y in space that will always be free (monsters don't use 2000-2001,x and 2010-2011,x)
$01/DE66 8C 90 22    STY $2290  [$7E:2290]   ; originally, I just wrote PHX and PHY, but oddly, when I pulled them back, the x value got pulled into y and the y into x... weird
$01/DE69 C2 20       REP #$20               
$01/DE6B 7B          TDC                     
$01/DE6C AA          TAX                     
$01/DE6D A8          TAY                     ;Clear A, X and Y (and set A to 16-bit status)
$01/DE6E AD 02 20    LDA $2002  [$7E:2002]   
$01/DE71 29 FF 00    AND #$00FF             
$01/DE74 F0 02       BEQ $02    [$DE78]      ;Check for a character in slot 1, if none, skip to next check
$01/DE76 AA          TAX                     ;If one is there, store its level into X
$01/DE77 C8          INY                     ;and +1 to Y
$01/DE78 AD 82 20    LDA $2082  [$7E:2082]   
$01/DE7B 29 FF 00    AND #$00FF             
$01/DE7E F0 09       BEQ $09    [$DE89]      ;Check for a character in slot 2, if none, skip to next check
$01/DE80 85 A9       STA $A9    [$00:00A9]   ;If one is there, store its level into A9 (A9-AA seems to be used regularly for temporary storage)
$01/DE82 8A          TXA                     ;Move value in X to A
$01/DE83 18          CLC                     
$01/DE84 6D A9 00    ADC $00A9  [$7E:00A9]   ;Add the (recently stored) value in A9 to accumulator
$01/DE87 AA          TAX                     ;Move sum back to register X
$01/DE88 C8          INY                     ;and +1 to Y
$01/DE89 AD 02 21    LDA $2102  [$7E:2102]   
$01/DE8C 29 FF 00    AND #$00FF             
$01/DE8F F0 09       BEQ $09    [$DE9A]     
$01/DE91 85 A9       STA $A9    [$00:00A9]   
$01/DE93 8A          TXA                     
$01/DE94 18          CLC                     
$01/DE95 6D A9 00    ADC $00A9  [$7E:00A9]   
$01/DE98 AA          TAX                     
$01/DE99 C8          INY                     ;Same exact process for Slot 3
$01/DE9A AD 82 21    LDA $2182  [$7E:2182]   
$01/DE9D 29 FF 00    AND #$00FF             
$01/DEA0 F0 09       BEQ $09    [$DEAB]     
$01/DEA2 85 A9       STA $A9    [$00:00A9]   
$01/DEA4 8A          TXA                     
$01/DEA5 18          CLC                     
$01/DEA6 6D A9 00    ADC $00A9  [$7E:00A9]   
$01/DEA9 AA          TAX                     
$01/DEAA C8          INY                     ;...And slot 4
$01/DEAB AD 02 22    LDA $2202  [$7E:2202]   
$01/DEAE 29 FF 00    AND #$00FF             
$01/DEB1 F0 09       BEQ $09    [$DEBC]     
$01/DEB3 85 A9       STA $A9    [$00:00A9]   
$01/DEB5 8A          TXA                     
$01/DEB6 18          CLC                     
$01/DEB7 6D A9 00    ADC $00A9  [$7E:00A9]   
$01/DEBA AA          TAX                     
$01/DEBB C8          INY                     ;...And slot 5
$01/DEBC 8A          TXA                     ;Move final total into A
$01/DEBD C0 05 00    CPY #$0005             
$01/DEC0 D0 06       BNE $06    [$DEC8]      ;Check if Y = 5, if not skip to next check
$01/DEC2 38          SEC                     
$01/DEC3 ED A9 00    SBC $00A9  [$7E:00A9]   ;Subtract last character's level
$01/DEC6 4A          LSR A                   ;Divide by 2
$01/DEC7 4A          LSR A                   ;Divide by 2
$01/DEC8 C0 04 00    CPY #$0004             
$01/DECB D0 02       BNE $02    [$DECF]      ;Check if Y = 4, if not, skip to next check
$01/DECD 4A          LSR A                   ;Divide by 2
$01/DECE 4A          LSR A                   ;Divide by 2
$01/DECF C0 03 00    CPY #$0003             
$01/DED2 D0 05       BNE $05    [$DED9]      ;Check if Y = 3, if not, skip to next check
$01/DED4 38          SEC                     
$01/DED5 ED A9 00    SBC $00A9  [$7E:00A9]   ;Subtract last character's level
$01/DED8 4A          LSR A                   ;Divide by 2
$01/DED9 C0 02 00    CPY #$0002             
$01/DEDC D0 01       BNE $01    [$DEDF]      ;Check if Y = 2, if not, skip the next Operation
$01/DEDE 4A          LSR A                   ;Divide by 2... Phew! Now we've got out APL. There are definitely inefficiencies here, but it works.
$01/DEDF AE 80 22    LDX $2280  [$7E:2280]   
$01/DEE2 AC 90 22    LDY $2290  [$7E:2290]   
$01/DEE5 9C 80 22    STZ $2280  [$7E:2280]   
$01/DEE8 9C 90 22    STZ $2290  [$7E:2290]   ;Restore X and Y and clear the space in RAM used to store them
$01/DEEB EA          NOP                     
$01/DEEC EA          NOP                     
$01/DEED EA          NOP                     
$01/DEEE EA          NOP                     
$01/DEEF EA          NOP                     
$01/DEF0 85 A9       STA $A9    [$00:00A9]   ;Store APL in A9
$01/DEF2 7B          TDC                     
$01/DEF3 E2 20       SEP #$20                ;Clear A and set 8-bit status
$01/DEF5 BD 70 20    LDA $2070,x[$7E:22F0]   ;Load Monster's "Level plus boss bit"
$01/DEF8 10 07       BPL $07    [$DF01]      ;If not a boss, skip ahead (Probably could have led off with this, but oh well)
$01/DEFA AD A5 28    LDA $28A5  [$7E:28A5]   ;Perform action that we wrote over for the purpose of this process
$01/DEFD 5C FB 90 03 JMP $0390FB[$03:90FB]   ;Jump back to the regular monster loading routine
$01/DF01 A5 A9       LDA $A9    [$00:00A9]   
$01/DF03 DD 02 20    CMP $2002,x[$7E:2282]   
$01/DF06 B0 07       BCS $07    [$DF0F]      ;Compare APL to Monster's level, if APL is higher, keep going
$01/DF08 AD A5 28    LDA $28A5  [$7E:28A5]   ;if APL is lower, preform overwritten operation
$01/DF0B 5C FB 90 03 JMP $0390FB[$03:90FB]   ;And return to regular monster loading routine
$01/DF0F BD 02 20    LDA $2002,x[$7E:2282]   ;Load Monster's level
$01/DF12 C9 54       CMP #$54               
$01/DF14 90 04       BCC $04    [$DF1A]      ;Check if it is 84 (dec) or higher
$01/DF16 A9 7F       LDA #$7F               
$01/DF18 80 05       BRA $05    [$DF1F]      ;If so, then load 127 (dec) into A (this is the highest a monster's level can be, beyond this the monster will set the Boss bit) and skip ahead
$01/DF1A 4A          LSR A                   
$01/DF1B 18          CLC                     
$01/DF1C 7D 02 20    ADC $2002,x[$7E:2282]   ;Multiply level by 1.5
$01/DF1F 9D 02 20    STA $2002,x[$7E:2282]   ;Store monster's new level
$01/DF22 9D 70 20    STA $2070,x[$7E:22F0]   ;Store monster's new "level plus boss bit"
$01/DF25 69 0A       ADC #$0A                ;add 10 (dec)
$01/DF27 9D 2F 20    STA $202F,x[$7E:22AF]   ;Store monster's new "level plus 10"
$01/DF2A BD 1B 20    LDA $201B,x[$7E:229B]   ;Load monster's P-Attack multiplier
$01/DF2D C9 AA       CMP #$AA               
$01/DF2F 90 04       BCC $04    [$DF35]      ;Check if it is 170 (dec) or higher (because otherwise multiplying by 1.5 yields a result higher than FF)
$01/DF31 A9 FF       LDA #$FF               
$01/DF33 80 05       BRA $05    [$DF3A]      ;If so, then load 255 (dec) into A and skip ahead
$01/DF35 4A          LSR A                   
$01/DF36 18          CLC                     
$01/DF37 7D 1B 20    ADC $201B,x[$7E:229B]   ;Multiply by 1.5
$01/DF3A 9D 1B 20    STA $201B,x[$7E:229B]   ;Store monster's new P-Attack Multiplier
$01/DF3D BD 1D 20    LDA $201D,x[$7E:229D]   
$01/DF40 C9 AA       CMP #$AA               
$01/DF42 90 04       BCC $04    [$DF48]     
$01/DF44 A9 FF       LDA #$FF               
$01/DF46 80 05       BRA $05    [$DF4D]     
$01/DF48 4A          LSR A                   
$01/DF49 18          CLC                     
$01/DF4A 7D 1D 20    ADC $201D,x[$7E:229D]   
$01/DF4D 9D 1D 20    STA $201D,x[$7E:229D]   ;Same process for P-Attack Base
$01/DF50 BD 28 20    LDA $2028,x[$7E:22A8]   
$01/DF53 C9 AA       CMP #$AA               
$01/DF55 90 04       BCC $04    [$DF5B]     
$01/DF57 A9 FF       LDA #$FF               
$01/DF59 80 05       BRA $05    [$DF60]     
$01/DF5B 4A          LSR A                   
$01/DF5C 18          CLC                     
$01/DF5D 7D 28 20    ADC $2028,x[$7E:22A8]   
$01/DF60 9D 28 20    STA $2028,x[$7E:22A8]   ;... And P-Defense Multiplier
$01/DF63 BD 2A 20    LDA $202A,x[$7E:22AA]   
$01/DF66 C9 AA       CMP #$AA               
$01/DF68 90 04       BCC $04    [$DF6E]     
$01/DF6A A9 FF       LDA #$FF               
$01/DF6C 80 05       BRA $05    [$DF73]     
$01/DF6E 4A          LSR A                   
$01/DF6F 18          CLC                     
$01/DF70 7D 2A 20    ADC $202A,x[$7E:22AA]   
$01/DF73 9D 2A 20    STA $202A,x[$7E:22AA]   ;... And P-Defense Base
$01/DF76 BD 22 20    LDA $2022,x[$7E:22A2]   
$01/DF79 C9 AA       CMP #$AA               
$01/DF7B 90 04       BCC $04    [$DF81]     
$01/DF7D A9 FF       LDA #$FF               
$01/DF7F 80 05       BRA $05    [$DF86]     
$01/DF81 4A          LSR A                   
$01/DF82 18          CLC                     
$01/DF83 7D 22 20    ADC $2022,x[$7E:22A2]   
$01/DF86 9D 22 20    STA $2022,x[$7E:22A2]   ;... And M-Defense Multiplier
$01/DF89 BD 24 20    LDA $2024,x[$7E:22A4]   
$01/DF8C C9 AA       CMP #$AA               
$01/DF8E 90 04       BCC $04    [$DF94]     
$01/DF90 A9 FF       LDA #$FF               
$01/DF92 80 05       BRA $05    [$DF99]     
$01/DF94 4A          LSR A                   
$01/DF95 18          CLC                     
$01/DF96 7D 24 20    ADC $2024,x[$7E:22A4]   
$01/DF99 9D 24 20    STA $2024,x[$7E:22A4]   ;... And M-Defense Base
$01/DF9C C2 20       REP #$20                ;Set Accumulator 16-bit status
$01/DF9E BD 09 20    LDA $2009,x[$7E:2289]   ;Load Monster's Max HP into A
$01/DFA1 C9 AA AA    CMP #$AAAA             
$01/DFA4 90 05       BCC $05    [$DFAB]      ;Check if it is 43690 (dec) or higher (again, to avoid rolling over)
$01/DFA6 A9 FF FF    LDA #$FFFF             
$01/DFA9 80 05       BRA $05    [$DFB0]      ;If so, load 65535 (dec) into A and skip ahead
$01/DFAB 4A          LSR A                   
$01/DFAC 18          CLC                     
$01/DFAD 7D 09 20    ADC $2009,x[$7E:2289]   ;Multiply by 1.5
$01/DFB0 9D 09 20    STA $2009,x[$7E:2289]   ;Store new Max HP
$01/DFB3 9D 07 20    STA $2007,x[$7E:2287]   ;And store it in Current HP
$01/DFB6 7B          TDC                     
$01/DFB7 E2 20       SEP #$20                ;Clear A and reset 8-bit status
$01/DFB9 A5 A9       LDA $A9    [$00:00A9]   ;Load APL
$01/DFBB 4A          LSR A                   ;Divide by 2
$01/DFBC 85 A9       STA $A9    [$00:00A9]   ;store new APL
$01/DFBE 4C 03 DF    JMP $DF03  [$01:DF03]   ;Jump all the way back to DF03 ("compare APL with monster's level")

Turns out I didn't put in code that increases the monsters' base agility. I think this is OK, though. I'm not sure how modified agility is calculated, but it must take the monster's level into account, because leveled-up BlackLiz'es were definitely faster than normal (they kinda kicked my ass).

This is surely not the cleanest code I've written, but once I had it all working, it was so much that I didn't feel like going back to tidy it up. At any rate, the empty space at 01/DE60 is so huge, even this only takes up about a third of it, so it seemed unnecessary anyway.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #10 on: June 05, 2014, 10:42:08 AM »
Those $0042nn variables are custom SNES math registers.  Just set them, and it knows what to do. ;)  It takes several cycles, which is why the NOPs are there.  Mode-7 registers are another option for math, though I'm less familiar with those.  Yes, both of these should work on FF4.

Rock'n'roll. Thanks, assassin! (And, yes, I was wondering about the NOPs)

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #11 on: June 05, 2014, 05:09:52 PM »
you're welcome.

it's an intriguing patch, though one problem i'm seeing with the algorithm is the potential for "leapfrogging".  suppose Average Party Level is 60, and a given monster also has a level of 60; it won't be levelled up.  but if a monster has a level of 59, it gets levelled up all the way to 88.

one way to avoid this is to not level up or boost any monster whose level * 1.5 would exceed adjusted APL, though this will lower difficulty a bit.

a more involved way would be to lower the level/stat multiplier from 1.5, depending on how far the enemy's current level is below adjusted APL.  so you'd do something like:

1) if monster's adjusted level >= adjusted Average Party Level, then exit.
2) tempLevel = monster adjusted level * 1.5
3) if tempLevel <= adjusted APL, then goto step 12.
4) find adjusted APL / monster adjusted level, giving quotient and remainder.
5) multiplier = (monster adjusted level * quotient) + remainder.
6) oldLevel = monster adjusted level
7) monster adjusted level = monster adjusted level * multiplier
8) each of monster other adjusted stats = each of monster other adjusted stats * multiplier
9) monster adjusted level = monster adjusted level / oldLevel
10) each of monster other adjusted stats = each of monster other adjusted stats / oldLevel
11) exit.
12) monster adjusted level = monster adjusted level * 1.5
13) each of monster other adjusted stats = each of monster's other adjusted stats * 1.5

(so Steps #2-13 are replacing your Step 5.)

this is a bit complicated.  and because you're multiplying before dividing (as that's needed to multiply by a mixed number of (multiplier / oldLevel)), you'll need a temporary 16-bit word to store the product.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #12 on: June 05, 2014, 06:19:17 PM »
Finding a good balance is kind of a tricky proposition. Near as I can tell, only a handful of non-boss monsters have a level higher than 35, and they're all in the Giant of Bab-il and Lunar Subterrane.

I'm not against the idea of rewriting the formula to make it return more appropriate results - there are obviously more possibilities now that you've shown me the trick to complex multiplication and division - but I think figuring out what is right may require an actual playthrough.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #13 on: June 06, 2014, 05:18:03 AM »
So I took a long look at those multiplication functions, and I've got an idea.
I'm going to try:
1) set A to 16-bit
2) load APL into A
3) AND #$FF00
4) load monster level into X
5) divide, 16-bit A becomes the multiplier(ignore remainder)
6) load stat to raise into 8-bit X
7) STX $E8
8) Multiply 16-bit A by E8, the result will be a 16-bit A where the lower byte is the modified stat
9) TAX
10) Store X in appropriate stat location

This should serve to raise stats in a ratio very close to APL:Monster level

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #14 on: June 06, 2014, 12:41:54 PM »
3) AND #$FF00

AND #$00FF ?

Quote
This should serve to raise stats in a ratio very close to APL:Monster level

an interesting idea.. it depends on what you're aiming for.  this is vastly different than your initial algorithm.  if a level 40 party met a level 10 monster on that, the monster's level would become 22.  now, such an encounter would make the monster level 40.  which do you prefer?

another idea yet: if you have space, add an extra ROM field for each enemy: Level_Should_Be_Met_At .  this is subjective, but based on your and other players' experiences, you could come up with something.  if your party average is above that level, multiply the monster's level and stats by APL, then divide by Level_Should_Be_Met_At .

of course, if any of the stats are treated as squared in the damage formulae (e.g. Level in FF6 for physicals; i'm unfamiliar with FF4's equations), you'll get your head knocked off.  maybe temper it by lowering the ratio some..  i was gonna suggest square root of the ratio, but that'd be inhuman to code. :P  another way is to halve the part of the ratio that exceeds 100%: e.g. 1.60 becomes 1.30, 2.20 becomes 1.60, etc.  wouldn't be a picnic to program that either, but it's more feasible, and would limit how overpowered monsters get.
« Last Edit: June 06, 2014, 12:49:35 PM by assassin »