øA slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=printpage;topic=1940.0 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexdfc7.html slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1940.0 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexdfc7.html.z x |g^ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ ð2 ÍÖ OK text/html ISO-8859-1 gzip @øÕ ÍÖ ÿÿÿÿÿÿÿÿ Tue, 10 Mar 2020 03:41:05 GMT 0ó° °® 0® P® €§² ð® yg^ ÿÿÿÿÿÿÿÿhâ ÍÖ
Print Page - Chillyfeez's Mods, hacks, research notes, etc.
Board of Slick
Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: chillyfeez on June 02, 2014, 02:30:21 PM
Title: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez 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 (http://slickproductions.org/forum/index.php?topic=1922.0) 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 (http://slickproductions.org/forum/index.php?topic=1939.msg20827#msg20827) - Meet chocobos on the field in the Overworld in order to catch and ride them! Summon Phoenix (http://slickproductions.org/forum/index.php?topic=1890.msg19641#msg19641) - 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 (http://slickproductions.org/forum/index.php?topic=1873.msg21133#msg21133) - 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 (http://slickproductions.org/forum/index.php?topic=1940.msg24912#msg24912) - 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 (http://slickproductions.org/forum/index.php?topic=1940.msg20858#msg20858) A Pet Black Chocobo (http://slickproductions.org/forum/index.php?topic=1867.msg18926#msg18926) - This will let you keep your Black Chocobo, and not fly back to its home every time. Press L to toggle running (http://slickproductions.org/forum/index.php?topic=1940.msg20863#msg20863) - Does exactly what it says Press X to defer to the next ready character in battle (http://slickproductions.org/forum/index.php?topic=1940.msg20864#msg20864) - Ditto ATB Meter (http://slickproductions.org/forum/index.php?topic=1940.msg20882#msg20882) - 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 (http://slickproductions.org/forum/index.php?topic=1940.msg20885#msg20885) - combines the two previous patches(without crashing) User Options (http://slickproductions.org/forum/index.php?topic=1940.msg20892#msg20892) - Combines L-to-run, X-to-defer, and ATB meter Break Damage Limit (http://slickproductions.org/forum/index.php?topic=1940.msg22626#msg22626) - allows attacks to register as high as 16383 per target instead of capping damage at 9999
4) How-Tos Alter Summoned Monsters (http://slickproductions.org/forum/index.php?topic=1890.msg19481#msg19481) Alter "Special" Monster Sizes (http://slickproductions.org/forum/index.php?topic=1890.msg19384#msg19384) Hacking the Music (http://slickproductions.org/forum/index.php?topic=1801.msg18134#msg18134) Change which Overworld Landscape features change with Flags (http://slickproductions.org/forum/index.php?topic=1930.msg20787#msg20787) (such as the mountains that appear outside of Mist when Rydia calls Titan) Same as above, but faster! (http://slickproductions.org/forum/index.php?topic=1930.msg20797#msg20797) Determine Overworld Monster Encounters by Event Flag (http://slickproductions.org/forum/index.php?topic=1930.msg20814#msg20814) (instead of by location on the map) Make a fully functional, any item Salve command (http://slickproductions.org/forum/index.php?topic=1940.msg22203#msg22203)! Change "Call" into a five character label in the Magic Menu (http://slickproductions.org/forum/index.php?topic=1940.msg22466#new) Change Charging and Action stances for battle commands (http://slickproductions.org/forum/index.php?topic=2009.0) More to come!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez 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.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: koala_knight 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.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez 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.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez 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
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD 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!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: assassin 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
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez 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?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: assassin 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.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez 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.
$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.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez 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)
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: assassin 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.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez 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.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez 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
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: assassin on June 06, 2014, 12:41:54 PM
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.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 06, 2014, 03:11:42 PM
No... AND #$FF00. The idea is to create a ratio, using the lower byte as the fraction. The formula would make, for instance, a level 50 monster that meets a level 99 party level up to 98.
Here's that example (all in hex) (APL) 63 * 100 = 6300 [this will be achieved by loading the byte before APL and performing AND #$FF00 - it's a few bytes quicker than 8 ASLs] :edit: I'm writing it now... no ASLs are quicker because APL is already in the lower byte of A 6300 / (Monster level) 32 = (ratio) 1FA 1FA * 32 = (adjusted monster level) 62
It's absolutely nothing like my original formula. It's much simpler, and hopefully better. If I end up with monster stats that are way too high, I can try slashing the ratio before applying it to non-level stats.
I guess the same formula could be applied to weaken higher-level monsters, but I'm not sure I want to do that...
:edit: Gotta break to make dinner. Seems to be working so far. I'm debugging as I go, so the coding is slow, but no crashes so far...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: assassin on June 06, 2014, 07:02:54 PM
or you can do: AND #$00FF , XBA. if you know the top half of A was already zero (e.g. a TDC right before the loading of APL), then just the XBA is needed.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 06, 2014, 07:12:09 PM
Ah... Was not aware of that op. Good to know.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 07, 2014, 05:13:30 PM
Well, I got the new formula up and running, but it may need an adjustment... High level Imps become godlike death bringers, because their level starts off so low. I have a couple of ideas for solving this: Possibility 1) cut the ratio in half before applying to attack and defense multipliers Possibility 2) skip modifying multipliers altogether Possibility 3) raise the starting level of low level monsters (I don't think a monster's level really does anything anyway), thus naturally lowering the level up ratio (this would be the easiest fix, but would also impact the universality of the patch...)
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on June 08, 2014, 05:40:03 AM
Hmm, how "death bringer" are these high level imps? Recall that FFVIII also had this "issue" as well. I think an interesting way to combat this might be able to assign different Item Drop Tables depending on the level of said foe. Level 1-20 Imp has the chance to drop the normal Cure1, Cure2, Tent, Imp whereas Level 20-50 can drop Cure3, Cabin, Imp, Sleep Sword, Imp 50-100 could drop Cure3, Imp, Elixir, Silver Apple, that sort of dealing. That way it would be worth the player's time to fight them at higher's level.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 08, 2014, 10:10:46 AM
Him, that's an interesting route to take... I think, though, that I've figured out a good plan. I'll hopefully have an updated patch up later today (or else tomorrow for sure) and will explain it then.
Now that I think about it, I could still work in the item change portion in addition... Maybe won't do that all at once, though.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 09, 2014, 10:20:15 AM
OK, here's the re-worked Monster Level Adjusting patch.
The new process (In English) 1) Determine APL (true APL this time) 2) Multiply APL by 2/3 to determine Modified APL 3) Modified APL * 100(hex) / Monster's Level = Adjustment Ratio 4) Adjust Monster level according to Adjustment Ratio (skip if boss) 5) Adjust Attack Multiplier according to Adjustment Ratio (skip if boss) 6) Adjust Attack Base according to Adjustment Ratio (skip if boss) 7) Adjust Physical Defense Multiplier according to Adjustment Ratio 8) Adjust Physical Defense Base according to Adjustment Ratio 9) Adjust Magic Defense Multiplier according to Adjustment Ratio 10) Adjust Magic Defense Base according to Adjustment Ratio 11) Adjust Speed according to Adjustment Ratio 12) Adjust Current HP and Max HP according to Adjustment Ratio (skip if boss)
Here's a commented disassembly (comments are simplified, as many operations are the same as before):
$03/90F5 5C 60 DE 01 JMP $01DE60 ;Jump to custom code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$01/DE60 9D 24 20 STA $2024,x[$7E:22A4] $01/DE63 8E 80 22 STX $2280 [$7E:2280] $01/DE66 8C 90 22 STY $2290 [$7E:2290] $01/DE69 C2 20 REP #$20 $01/DE6B 7B TDC $01/DE6C AA TAX $01/DE6D A8 TAY $01/DE6E AD 02 20 LDA $2002 [$7E:2002] $01/DE71 29 FF 00 AND #$00FF $01/DE74 F0 02 BEQ $02 [$DE78] $01/DE76 AA TAX $01/DE77 C8 INY $01/DE78 AD 82 20 LDA $2082 [$7E:2082] $01/DE7B 29 FF 00 AND #$00FF $01/DE7E F0 09 BEQ $09 [$DE89] $01/DE80 85 A9 STA $A9 [$00:00A9] $01/DE82 8A TXA $01/DE83 18 CLC $01/DE84 6D A9 00 ADC $00A9 [$7E:00A9] $01/DE87 AA TAX $01/DE88 C8 INY $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 $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 $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 $01/DEBC 8A TXA $01/DEBD BB TYX $01/DEBE 20 00 E1 JSR $E100 [$01:E100] ;Determine APL, by adding all party members' levels and dividing by the amount of party members (01/E100 is the division function) $01/DEC1 A2 03 00 LDX #$0003 $01/DEC4 20 00 E1 JSR $E100 [$01:E100] $01/DEC7 0A ASL A ;Multiply APL by 2/3 to obtain Adjusted APL $01/DEC8 48 PHA $01/DEC9 AC 80 22 LDY $2280 [$7E:2280] $01/DECC 68 PLA $01/DECD 0A ASL A $01/DECE 0A ASL A $01/DECF 0A ASL A $01/DED0 0A ASL A $01/DED1 0A ASL A $01/DED2 0A ASL A $01/DED3 0A ASL A $01/DED4 0A ASL A $01/DED5 BE 02 20 LDX $2002,y[$7E:2282] $01/DED8 20 00 E1 JSR $E100 [$01:E100] ;Determine Adjustment Ratio using the formula: Adj-APL * 100(h) / Monst-Lvl $01/DEDB 48 PHA $01/DEDC 7B TDC $01/DEDD E2 20 SEP #$20 $01/DEDF B9 70 20 LDA $2070,y[$7E:22F0] $01/DEE2 30 52 BMI $52 [$DF36] ;Skip Level, Attack Multiplier and Attack Base adjustments if monster is a Boss $01/DEE4 C2 20 REP #$20 $01/DEE6 68 PLA $01/DEE7 BE 02 20 LDX $2002,y[$7E:2282] $01/DEEA 86 E8 STX $E8 [$00:00E8] $01/DEEC 48 PHA $01/DEED 20 70 E1 JSR $E170 [$01:E170] $01/DEF0 E2 20 SEP #$20 $01/DEF2 99 02 20 STA $2002,y[$7E:2282] $01/DEF5 99 70 20 STA $2070,y[$7E:22F0] $01/DEF8 69 0A ADC #$0A $01/DEFA 99 2F 20 STA $202F,y[$7E:22AF] ;Adjust Level (and Level+Boss Bit, and Level+0A) according to Adjustment Ratio $01/DEFD C2 20 REP #$20 $01/DEFF B9 1B 20 LDA $201B,y[$7E:229B] $01/DF02 29 FF 00 AND #$00FF $01/DF05 85 E8 STA $E8 [$00:00E8] $01/DF07 68 PLA $01/DF08 48 PHA $01/DF09 20 70 E1 JSR $E170 [$01:E170] $01/DF0C C9 0E 00 CMP #$000E $01/DF0F 90 03 BCC $03 [$DF14] $01/DF11 A9 0D 00 LDA #$000D $01/DF14 E2 20 SEP #$20 $01/DF16 99 1B 20 STA $201B,y[$7E:229B] ;Adjust Attack Multiplier according to Adjustment Ratio (Max value 0E) $01/DF19 EA NOP $01/DF1A C2 20 REP #$20 $01/DF1C B9 1D 20 LDA $201D,y[$7E:229D] $01/DF1F 29 FF 00 AND #$00FF $01/DF22 85 E8 STA $E8 [$00:00E8] $01/DF24 68 PLA $01/DF25 48 PHA $01/DF26 20 70 E1 JSR $E170 [$01:E170] $01/DF29 C9 AF 00 CMP #$00AF $01/DF2C 90 03 BCC $03 [$DF31] $01/DF2E A9 AE 00 LDA #$00AE $01/DF31 E2 20 SEP #$20 $01/DF33 99 1D 20 STA $201D,y[$7E:229D] ;Adjust Attack Base according to Adjustment Ratio (Max value AE) $01/DF36 C2 20 REP #$20 $01/DF38 B9 28 20 LDA $2028,y[$7E:22A8] $01/DF3B 29 FF 00 AND #$00FF $01/DF3E 85 E8 STA $E8 [$00:00E8] $01/DF40 68 PLA $01/DF41 48 PHA $01/DF42 EA NOP $01/DF43 20 70 E1 JSR $E170 [$01:E170] $01/DF46 C9 00 01 CMP #$0100 $01/DF49 90 03 BCC $03 [$DF4E] $01/DF4B A9 FF 00 LDA #$00FF $01/DF4E E2 20 SEP #$20 $01/DF50 99 28 20 STA $2028,y[$7E:22A8] ;Adjust P-Defense Multiplier according to Adjustment Ratio $01/DF53 C2 20 REP #$20 $01/DF55 B9 2A 20 LDA $202A,y[$7E:22AA] $01/DF58 29 FF 00 AND #$00FF $01/DF5B 85 E8 STA $E8 [$00:00E8] $01/DF5D 68 PLA $01/DF5E 48 PHA $01/DF5F 20 70 E1 JSR $E170 [$01:E170] $01/DF62 C9 00 01 CMP #$0100 $01/DF65 90 03 BCC $03 [$DF6A] $01/DF67 A9 FF 00 LDA #$00FF $01/DF6A E2 20 SEP #$20 $01/DF6C 99 2A 20 STA $202A,y[$7E:22AA] ;Adjust P-Defense Base according to Adjustment Ratio $01/DF6F C2 20 REP #$20 $01/DF71 B9 22 20 LDA $2022,y[$7E:22A2] $01/DF74 29 FF 00 AND #$00FF $01/DF77 85 E8 STA $E8 [$00:00E8] $01/DF79 68 PLA $01/DF7A 48 PHA $01/DF7B 20 70 E1 JSR $E170 [$01:E170] $01/DF7E C9 00 01 CMP #$0100 $01/DF81 90 03 BCC $03 [$DF86] $01/DF83 A9 FF 00 LDA #$00FF $01/DF86 E2 20 SEP #$20 $01/DF88 99 22 20 STA $2022,y[$7E:22A2] ;Adjust M-Defense Multiplier according to Adjustment Ratio $01/DF8B EA NOP $01/DF8C C2 20 REP #$20 $01/DF8E B9 24 20 LDA $2024,y[$7E:22A4] $01/DF91 29 FF 00 AND #$00FF $01/DF94 85 E8 STA $E8 [$00:00E8] $01/DF96 68 PLA $01/DF97 48 PHA $01/DF98 20 70 E1 JSR $E170 [$01:E170] $01/DF9B C9 00 01 CMP #$0100 $01/DF9E 90 03 BCC $03 [$DFA3] $01/DFA0 A9 FF 00 LDA #$00FF $01/DFA3 E2 20 SEP #$20 $01/DFA5 99 24 20 STA $2024,y[$7E:22A4] ;Adjust M-Defense Base according to Adjustment Ratio $01/DFA8 C2 20 REP #$20 $01/DFAA B9 15 20 LDA $2015,y[$7E:2295] $01/DFAD 29 FF 00 AND #$00FF $01/DFB0 85 E8 STA $E8 [$00:00E8] $01/DFB2 68 PLA $01/DFB3 48 PHA $01/DFB4 20 70 E1 JSR $E170 [$01:E170] $01/DFB7 C9 00 01 CMP #$0100 $01/DFBA 90 03 BCC $03 [$DFBF] $01/DFBC A9 FF 00 LDA #$00FF $01/DFBF E2 20 SEP #$20 $01/DFC1 99 15 20 STA $2015,y[$7E:2295] ;Adjust Agility according to Adjustment Ratio $01/DFC4 C2 20 REP #$20 $01/DFC6 BB TYX $01/DFC7 BD 6F 20 LDA $206F,x[$7E:22EF] $01/DFCA 30 36 BMI $36 [$E002] ;Skip HP/Max Adjustment if Monster is a Boss $01/DFCC 9E 09 20 STZ $2009,x[$7E:2289] $01/DFCF B9 07 20 LDA $2007,y[$7E:2287] $01/DFD2 AA TAX $01/DFD3 29 FF 00 AND #$00FF $01/DFD6 85 E8 STA $E8 [$00:00E8] $01/DFD8 68 PLA $01/DFD9 48 PHA $01/DFDA 20 70 E1 JSR $E170 [$01:E170] $01/DFDD 99 07 20 STA $2007,y[$7E:2287] $01/DFE0 8A TXA $01/DFE1 29 00 FF AND #$FF00 $01/DFE4 EB XBA $01/DFE5 85 E8 STA $E8 [$00:00E8] $01/DFE7 68 PLA $01/DFE8 20 70 E1 JSR $E170 [$01:E170] $01/DFEB 18 CLC $01/DFEC 79 08 20 ADC $2008,y[$7E:2288] $01/DFEF C9 00 01 CMP #$0100 $01/DFF2 90 03 BCC $03 [$DFF7] $01/DFF4 A9 FF 00 LDA #$00FF $01/DFF7 99 08 20 STA $2008,y[$7E:2288] $01/DFFA B9 07 20 LDA $2007,y[$7E:2287] $01/DFFD 99 09 20 STA $2009,y[$7E:2289] ;Adjust Current HP and Max HP according to Adjustment Ratio $01/E000 80 01 BRA $01 [$E003] $01/E002 68 PLA $01/E003 7B TDC $01/E004 AA TAX $01/E005 A8 TAY $01/E006 AE 80 22 LDX $2280 [$7E:2280] $01/E009 AC 90 22 LDY $2290 [$7E:2290] $01/E00C 9C 80 22 STZ $2280 [$7E:2280] $01/E00F 9C 90 22 STZ $2290 [$7E:2290] $01/E012 E2 20 SEP #$20 ;Clean/Restore Registers $01/E014 AD A5 28 LDA $28A5 [$7E:28A5] $01/E017 5C FB 90 03 JMP $0390FB[$03:90FB] ;Back to our regularly scheduled program This will patch cleanly.
High level Imps will still be tough, but not nearly the Death Bringers they were in the working stages.
Aso, normally higher-level monsters will level down if the ratio calls for it... I figured, what the hell, might as well. You'll level up soon enough fighting weak flamedogs and blacklizzes anyway...
I think I'm done with this patch for now.
:edit: The link to this patch was broken. Unfortunately, I do not have a backup of the patch at this time. I will remake one at some point. Sorry.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 22, 2014, 12:49:58 AM
So I've been researching joypad input...
For those of you reading who actually know a thing or two about programming, the way I talk about this may expose my novice a bit. But my ideas and ambitions for what I plan to do with this knowledge are topnotch.
So, from what I've read on the subject, SNES's joypad registers are $4200 (determines if the pad is active), $4212 (determines if the pad is ready to transmit data) and $4218-4219 (a,x,l,r,1,1,1,1 - b,y,s,t,u,d,r,l buttons. Those 1s represent data that simply identify the joypad to the SNES as an actual joypad (and not a mouse or a super scope)
Anyway, this on its own is not particularly useful. If you open ffiv in Geiger's and watch the $4200 block of RAM, you won't see anything interesting. Apparently, part of the initialization at the beginning of a SNES game involves pointing to a place in RAM where controller input will be copied in (essentially) real time. So, by setting a breakpoint to read $4218 at the very start of running the ROM, I was able to find where FFIV copies controller input: $0108-0109. Go ahead and see for yourself. Open your ffiv ROM in Geiger's and view 7E:0108-0109 in RAM. Watch what happens there when you push (and also hold down) some buttons.
Yay!
I haven't had a whole lot of time to actually do anything with this, but here's what I want to try (in ascending order of difficulty)
1. Implement a "hold B to run" function on the field, a la FFV
2. Revamp the Limit Break in my hack so that the break is truly random (instead of being determined by the lowest two bits of your HP) but the execution is controlled by the player (giving you the option to not execute)
3. Implement a "press X to switch to the next ready character" function in battle, a la ffvii - ix (and possibly others?)
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Pinkpuff on June 22, 2014, 05:34:31 AM
Would definitely love to see 1 and 3 as independent patches!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 22, 2014, 08:19:13 AM
I actually think 3 will end up being easier than 2 now... Or at least, I have an idea how I might make it work and if it does work it'll be pretty simple.
I'm 99% sure that Press B to Run will be super simple and ready by the end of the day.
And yes, I definitely will post patches to share them with the world!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 22, 2014, 01:08:35 PM
OK, well, it ended up being "Press L to toggle running" instead of "Press B to run." some issues came up with pressing B and a direction button simultaneously, that I could only solve by making it impossible to start or stop running while moving (which necessitated a toggle instead of being able to just hold the button).
As a little bonus, this patch allows you to press L to toggle "slow flying" while in an airship or The Whale, thus solving the difficulty involved in landing near Toroia.
The patch is below. Here's the disassembly of the changes I made:
$00/80C2 20 59 FF JSR $FF59;Jump to custom ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $00/FF59 AD 0C 01 LDA $010C [$00:010C] ;7E:010C logs whether a button at 7E:0108 is being held down. It is 18 by default, and counts down as a button is held (jumps back to 03 when it gets to zero) $00/FF5C C9 18 CMP #$18 $00/FF5E D0 39 BNE $39 [$FF99] ;Skip the process if any button at 0108 (including L) is being held (this will avoid multiple toggles on a single button push) $00/FF60 AD 08 01 LDA $0108 [$00:0108] $00/FF63 29 20 AND #$20 ;Check if L is being pushed at all $00/FF65 F0 32 BEQ $32 [$FF99] ;If not, skip the process $00/FF67 AD 09 01 LDA $0109 [$00:0109] $00/FF6A 29 0F AND #$0F ;Check if any d-pad button is being pressed or held $00/FF6C D0 2B BNE $2B [$FF99] ;If so, skip the process $00/FF6E AD 04 17 LDA $1704 [$00:1704] $00/FF71 D0 0F BNE $0F [$FF82] ;If NOT on foot, skip to the vehicle portion $00/FF73 AD AC 06 LDA $06AC [$00:06AC] ;If on foot, observe current speed setting $00/FF76 D0 05 BNE $05 [$FF7D] $00/FF78 EE AC 06 INC $06AC [$00:06AC] ;If Zero, increase to 01 $00/FF7B 80 03 BRA $03 [$FF80] ;And skip to the end $00/FF7D 9C AC 06 STZ $06AC [$00:06AC] ;If not zero, set to zero $00/FF80 80 17 BRA $17 [$FF99] ;And skip to the end $00/FF82 C9 04 CMP #$04 $00/FF84 90 13 BCC $13 [$FF99] $00/FF86 C9 07 CMP #$07 ;Check if current vehicle is Enterprise, Falcon or Whale $00/FF88 B0 0F BCS $0F [$FF99] ;If not, Skip the process $00/FF8A AD AC 06 LDA $06AC [$00:06AC] ;If so, observe current speed setting $00/FF8D D0 07 BNE $07 [$FF96] $00/FF8F A9 03 LDA #$03 $00/FF91 8D AC 06 STA $06AC [$00:06AC] ;If speed is Zero, change to 03 $00/FF94 80 03 BRA $03 [$FF99] ;And skip to the end $00/FF96 9C AC 06 STZ $06AC [$00:06AC] ;If speed is not zero, set to zero $00/FF99 AD 00 17 LDA $1700 [$00:1700] ;(the command that was replaced at $00/80c2) $00/FF9C 60 RTS
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 22, 2014, 04:26:15 PM
Turn Deferring with X turned out to be the super easy one, as a matter of fact! Major assist to Grimoire LD for his Auto-Hide research here, which was essential to making this one possible.
So this works almost exactly like pressing Triangle during battle in FFIV, VIII and XI (can you defer in VI with X? I don't remember).
The only thing is, if another character or monster is taking an action at the time, you have to wait until that action is over to defer, but you CAN hold X so that the turn is deferred as soon as possible.
$03/A400 5C D0 BB 04 JMP $04BBD0[$04:BBD0] ;Jump to custom ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $04/BBD0 AD 08 01 LDA $0108 [$7E:0108] $04/BBD3 29 40 AND #$40 ;Check if X is being pressed or held $04/BBD5 F0 14 BEQ $14 [$BBEB] ;If not, skip this process $04/BBD7 AE 30 35 LDX $3530 [$7E:3530] ;Load current character's wait time pointer into X $04/BBDA 9E 08 2A STZ $2A08,x[$7E:2B35] ;Store zero in upper byte of character's wait time $04/BBDD 9E 09 2A STZ $2A09,x[$7E:2B36] ;Store zero ("waiting for next turn") in character's wait/ready status byte $04/BBE0 A9 00 LDA #$00 $04/BBE2 9D 07 2A STA $2A07,x[$7E:2B34] ;store zero in character's wait time (I originally stored a 1 here because I doubted zero would work, but it does, and it was just easier to keep it this way) $04/BBE5 A6 A6 LDX $A6 [$00:00A6] ;load character's stats slot into X $04/BBE7 5C 39 A4 03 JMP $03A439[$03:A439] ;Jump to Menu erasing routine (the one used for Edward's auto-hide) $04/BBEB A6 A6 LDX $A6 [$00:00A6] ;(this is where we jump to if X is not being pressed) $04/BBED BD 00 20 LDA $2000,x[$7E:212D] ;reapeat skipped actions at $03/A400 $04/BBF0 5C 05 A4 03 JMP $03A405[$03:A405] ;back to our regularly scheduled programming
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Pinkpuff on June 23, 2014, 06:12:32 PM
Awesome!
Although getting into a battle or changing maps resets the dashing to walking... is that the intended behaviour?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 23, 2014, 07:53:03 PM
No, that's not intentional, but I am aware of it. Oddly enough, it doesn't happen when you exit a location map to the world map. There must be a STZ $06AC somewhere in the map loading routine. I can probably find and erase it...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 24, 2014, 11:18:28 AM
In keeping with my recent kick of non-direct gameplay mods, I've been working this morning on a mod that changes the "Stereo/Mono" option into a "Display Max HP/Display Wait Time (in battle)" option.
I've got the functional part of the coding done, just need to do some purely cosmetic cleanup before I can put this one out. It's a little weird looking, since wait time is rarely ever more than 10 seconds, but there is space for four digit numbers (because normally Max HP is in that space), but on the whole this is a cool little thing.
I have to get ready for work now, and I don't know if I'll get to the finishing touches for a couple of days, so sorry if this is just a teaser.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 25, 2014, 10:02:15 AM
Well, I've re-worked my ATB counter so that it registers as a percentage of wait time (starts at 0 and reads 100 when you're ready to act).
It works perfectly. The slightly weird thing, which one will never experience under normal circumstances, is that if your wait time is over 255 (or FF), the ATB counter will simply read 0 until wait time gets to 255. I can't force this to happen on its own unless a character's AGI is 1.
I am much happier with this than I was yesterday, but there are still some cleanup tasks before I can post the patch. I'm off work tomorrow, so will likely finish then.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on June 26, 2014, 12:01:59 AM
Whoa ho! I leave for a couple of days and several new hacks show up? Wow, these are fantastic Chillyfeez! While yes, they still have a few bugs here and there the idea of putting these into FFIV is absolutely wonderful!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 26, 2014, 01:59:48 AM
Glad you like.
Yeah, the running with L is definitely not as cool as I'd hoped it would be. I'm still gonna fix the fact that running gets zeroed out when you change maps, but there's still a clear feeling that you're making the game behave in a way it wasn't meant to.
I'm pretty proud of Skip with X. That one came out about as well as I could have hoped.
The ATB counter really will be the crown jewel of this set. I'm pretty sure I can have it done by tomorrow, but I don't wanna rush it.
THEN maybe I can get back to my hack. All of the stuff I've been putting out lately has primarily been the byproduct of my procrastination of setting up NPCs and events in the next town. On the bright side, I've been able to take some of what I've been doing and modify it for some unique features in my own game. I've got encounter sets that are determined by terrain - so within the same section of the world map, you face different enemies depending on if you're on desert, dark grass, light grass (and beach), or in forest. I also spun the chocobo encounters in a new direction - the Fat Chocobo resides in Eblan Castle and asks for your help in finding and taming his kin. If you catch 100 chocobos, you get a special prize. Chocobos will show up anywhere on the world map, but are more plentiful in the forest, and they travel with terrain-appropriate monsters. When you catch them, they have the ability to walk a bit further out on beaches, giving them access to some places that would be inaccessible on foot (as in, secret treasure caves). Anyway, it's all very cool and exciting if you're me, but I've got a lot of balls in the air right now and I have to stop coming up with new ideas that I want to try. Yeah, we'll see how that goes...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 26, 2014, 04:28:03 PM
Here it is! I can't put up any disassembly because I don't even remember everything I had to edit to make this work, but it works! I'm not 100% positive it will patch cleanly with the previous two patches, but it should be fine with, say something that's been edited with FF4kster.
To see what it does, go into Custom in the menu. You'll see that "Sound Stereo Mono" has changed to "Show MaxHP ATB." Select ATB and give it a whirl!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Pinkpuff on June 26, 2014, 06:58:00 PM
I patched it to a clean rom and it works perfectly!
When I patched it to the rom I had with the other two already applied, the game bugged out and froze during battle. Not sure which it's conflicting with, but I would assume it's the X button defer turn patch since it also has to do with battle while the L button dash patch doesn't. A shame too, because those two would have synergy together. Knowing the ATB situation makes turn deferring a more useful ability; likewise, being able to defer turns makes the ATB information more useful.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 26, 2014, 08:23:14 PM
I'd wager you're right, Pinkpuff. The empty bank I used for x-deferring is probably among the several banks used for ATB. It should be easy enough to write a patch that combines the two. Looks like I used a long jump in x-def, so I can point to pretty much anywhere.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 27, 2014, 05:10:31 AM
Here we are. "Enhanced ATB" combines the functionality of X-Def and ATB Meters. Seems to work flawlessly.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on June 28, 2014, 10:12:11 AM
"User Options" incorporates the three patches: -Push L to toggle running* -Push X in battle to defer your turn -Choose between viewing Max HP and ATB meter in battle (from the Custom menu)
*I also worked in a fix so the game doesn't cancel running when you enter a new map (but still resets the speed when you enter a forest on a black chocobo, which is the only reason I can think of for that instruction having existed in the first place)
Onward and upward...
:edit: The link on this site was broken and has been removed, but the full (and more recently updated) User Options patch is now hosted on romhacking.net. Click Here to Download (http://www.romhacking.net/hacks/2232/)!
:edit: 2 I've developed a patch to make User Options compatible with my Shadow Party mod. go here (http://slickproductions.org/forum/index.php?topic=1873.msg21133#msg21133) for the patch and instructions.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on June 28, 2014, 04:22:07 PM
Three-in-one, eh? It sounds like something like this would become staples in any future hacking endeavors! Incredible work Chillyfeez!
EDIT: All three in one are positively amazing. Apart, they were good, but all three together just feels so natural and intended!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on December 30, 2014, 08:55:38 PM
Hmm, I noticed a gamecrashing bug that happens when you combine the Monster LevelUp Patch and your Cache patch, when you go into battle the fat chocobo screen comes up or the game just crashes and once you leave the menu the game just crashes anyhow.
I wonder if it's something dealing with overlapping hacking code?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on December 30, 2014, 09:03:25 PM
Bummer.
I'm sure that's what it is. Cache was designed to work with User Options, but aside from that it was built intona clean ROM. Funny, because I plan to use it in TfW, which uses Level Up.
I should start keeping a log of all of the empty spaces I invade with my hacks in the interest of keeping them compatible with each other. Or, more appropriately, I should have done that a long time ago.
No matter, Cache is actually a pretty simple hack, so it should be pretty easy to fix.
:edit: I presume you made this discovery while putting together the base for your Random AI side project. Assuming all of the other patches play nicely with each other, send me a copy (sans Cache) just before you're ready to put it out and I'll pop Cache in, in a nonconflicting location.
A word or several about the monster level up patch: balancing enemies out can be a little counterintuitive once this patch is applied. That is, if you are noticing the monsters in an are are too easy for a natural-leveled party, lowering the monsters' levels in FF4kster - even by just a couple of levels - can usually fix the problem (because the level up code will make them level up more).
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on December 30, 2014, 10:31:28 PM
I'm sure that's what it is. Cache was designed to work with User Options, but aside from that it was built intona clean ROM. Funny, because I plan to use it in TfW, which uses Level Up.
I should start keeping a log of all of the empty spaces I invade with my hacks in the interest of keeping them compatible with each other. Or, more appropriately, I should have done that a long time ago.
No matter, Cache is actually a pretty simple hack, so it should be pretty easy to fix.
:edit: I presume you made this discovery while putting together the base for your Random AI side project. Assuming all of the other patches play nicely with each other, send me a copy (sans Cache) just before you're ready to put it out and I'll pop Cache in, in a nonconflicting location.
A word or several about the monster level up patch: balancing enemies out can be a little counterintuitive once this patch is applied. That is, if you are noticing the monsters in an are are too easy for a natural-leveled party, lowering the monsters' levels in FF4kster - even by just a couple of levels - can usually fix the problem (because the level up code will make them level up more).
Yep, that's when I noticed it, it seems as if everything else works great together, I'll send a copy when the time comes then.
FFIV's default levels are pretty low so I don't think I'll need to worry about that too much. It's not until Mt. Hobbs that you even run into Level 10 Monsters, hehe.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on December 30, 2014, 11:46:20 PM
Well, as far as I know, monster levels don't really do anything in FFIV, but they're pretty instrumental in my level up hack. They act as the basis for all stat increases. The game will compare the monster's level against the party's average level, then creates a ratio based on that comparison by which all other stats are adjusted. So for instance, the following happens to an (unmodified) imp against a level 10 party: starting stats (some of them, just for example) Lv: 3 HP: 6 Atk: 13 Atk*: 1
The game will bring the imp's level up to 2/3 the party's level - 6 , since the party is lv 10. Since 6 is 2x the original level, all of the imp's stats will be doubled...
Lv: 6 HP: 12 Atk: 26 Atk*: 2
Though the imp will still be a wimp, the difference is noticeable. The easiest fix is to just adjust the imp's level up to 6 to begin with. That way, it'll have normal stats at the beginning of the game, and won't be quite such a behemoth when you're at lv 99.
... Did I explain that clearly?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on December 30, 2014, 11:55:44 PM
Well, as far as I know, monster levels don't really do anything in FFIV, but they're pretty instrumental in my level up hack. They act as the basis for all stat increases. The game will compare the monster's level against the party's average level, then creates a ratio based on that comparison by which all other stats are adjusted. So for instance, the following happens to an (unmodified) imp against a level 10 party: starting stats (some of them, just for example) Lv: 3 HP: 6 Atk: 13 Atk*: 1
The game will bring the imp's level up to 2/3 the party's level - 6 , since the party is lv 10. Since 6 is 2x the original level, all of the imp's stats will be doubled...
Lv: 6 HP: 12 Atk: 26 Atk*: 2
Though the imp will still be a wimp, the difference is noticeable. The easiest fix is to just adjust the imp's level up to 6 to begin with. That way, it'll have normal stats at the beginning of the game, and won't be quite such a behemoth when you're at lv 99.
... Did I explain that clearly?
Oh! I see what you mean now, yes that is an interesting way to go about it I will try to balance enemy levels so they aren't too insane then. Enemy Level is used... for a really pointless function. "Steal Defense/Status Resistance" Byte (Byte 2F)is Level +10 for all enemies. This is what Cry decreases. Yet due to the length of Status Ailments in the first place they become so worthless so quickly because of this screwed up setup. They are also used in deciding whether the party gets a Pre-emptive Strike, is Ambushed or Back-Attacked.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on December 31, 2014, 12:06:45 AM
Ah... I forgot about steal prevention. I think that is among the stats that is adjusted, too, though not by the ratio. The level is adjusted, then 10 is added. I was not aware of its factor in preemptive/back attack... I wonder what kind of effect that will have when it starts making monsters lv 66...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on December 31, 2014, 12:13:51 AM
Ah... I forgot about steal prevention. I think that is among the stats that is adjusted, too, though not by the ratio. The level is adjusted, then 10 is added. I was not aware of its factor in preemptive/back attack... I wonder what kind of effect that will have when it starts making monsters lv 66...
I should have rephrased that Level is used in calculating the starting status of the battle. The 2F byte is used for the the other matters that I mentioned.
These experiments seem like they could be fun, I rather liked what FFVIII and FFT's random battles did so including that into FFIV is a wonderful thought.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on January 06, 2015, 11:15:42 PM
So I have a week off starting today. I'm going to visit family over the weekend, but I have big plans about actually finishing up the second chapter of A Threat from Within.
So naturally, today I worked on it for about 45 minutes then got distracted by some far more complicated hacking research.
You'll love this one, Grimoire - I am very close to devising a method by which other commands (besides Item, Dart and magics) can open a sub-menu. This is actually a potentially productive diversion, because I use Grimoire's custom Salve command in my hack, and if I can get this to work then I can modify it so that the player actually gets to choose which item is used (instead of it being the first item in the inventory every time). It's kind of a minor thing in the end, but it'll give the custom command a more polished feel.
And of course, if it can be done with Salve, then it can also be done with Coat Hammer, though I'm not completely positive about how well it'll work, because I believe that one has its own set of valid choices (separate from what is a valid choice for Item), and this little trick I plan to devise involves a trip through the same routine Item uses to select an item. And I don't know how to conditionally gray-out items in the menu.
Anyway I'm turning in for the night, but there's what I hope to get done tomorrow.
And maybe finally finish the bosses at the end of chapter 2.
Maybe.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on January 06, 2015, 11:39:36 PM
So I have a week off starting today. I'm going to visit family over the weekend, but I have big plans about actually finishing up the second chapter of A Threat from Within.
So naturally, today I worked on it for about 45 minutes then got distracted by some far more complicated hacking research.
You'll love this one, Grimoire - I am very close to devising a method by which other commands (besides Item, Dart and magics) can open a sub-menu. This is actually a potentially productive diversion, because I use Grimoire's custom Salve command in my hack, and if I can get this to work then I can modify it so that the player actually gets to choose which item is used (instead of it being the first item in the inventory every time). It's kind of a minor thing in the end, but it'll give the custom command a more polished feel.
And of course, if it can be done with Salve, then it can also be done with Coat Hammer, though I'm not completely positive about how well it'll work, because I believe that one has its own set of valid choices (separate from what is a valid choice for Item), and this little trick I plan to devise involves a trip through the same routine Item uses to select an item. And I don't know how to conditionally gray-out items in the menu.
Anyway I'm turning in for the night, but there's what I hope to get done tomorrow.
And maybe finally finish the bosses at the end of chapter 2.
Maybe.
Ah that does sound awesome! Opening menus from commands was something I looked into a long time ago, but it was so confusing that I couldn't progress very far into it. As for Coat Hammer, it does have it's very specific choices, no indexing going on there just plain; "Is it This item? If not, branch". But nothing happens when the item up front is incorrect, so there's no fear of breaking anything should the incorrect choice be made.
This would really make them feel official though; I was never happy with the "if at top of list" but I had no better way to design it at the time. Though can you prevent strangeness like being able to access left-right hands? That might throw something off, then again, it might not. Best of luck with this though!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on January 07, 2015, 12:17:58 AM
Ooh, I hadn't thought about left and right hands. Well, I'll stick with the original plan and see what happens. I'm thinking that choosing a weapon would just do nothing, but we'll see I guess...
Re: Coat Hammer... It would probably be OK, then, with the exception of the homing wrench. It's not a "usable" item, right? So then it would be grayed out by the method I'm employing.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on January 07, 2015, 05:58:14 AM
Ooh, I hadn't thought about left and right hands. Well, I'll stick with the original plan and see what happens. I'm thinking that choosing a weapon would just do nothing, but we'll see I guess...
Re: Coat Hammer... It would probably be OK, then, with the exception of the homing wrench. It's not a "usable" item, right? So then it would be grayed out by the method I'm employing.
...Right, forgot all about the Homing Wrench. Hmm, not sure how I would make that work with such a plan.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on January 07, 2015, 03:48:45 PM
SUCCESS! So here's what we're looking at in terms of functionality... Salve is now a command that, when selected, opens the item menu. All of the same items will be available as if you had selected Item. If you choose an attack item (anything that by default targets one or all enemies), the targeting will be All Enemies. If you choose a healing/support item (anything that by default targets one or all allies), the targeting will be All Allies. If you choose a weapon from your left or right hand, there will be no difference than if you had selected it from item (no idea why, but I consider this among the best-case scenarios, so I'm not going to look into it)
In the end, not a whole lot of complicated changes had to be made, but it's all custom. I am 99% sure that it doesn't use any of the same space as any of my other stuff, but I'm only posting code here and no patch.
The original block of code that makes the game open a sub-menu is here:
$02/B9BA 20 C3 9A JSR $9AC3 [$02:9AC3];JUMP TO SUBROUTINE AT $02/9AC3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $02/9AC3 22 80 8D 14 JSL $148D80[$14:8D80];JUMP TO SUBROUTINE AT $14/8D80 (BECAUSE THERE REALLY ISN'T ENOUGH ROOM IN THE 28000 BLOCK FOR THIS) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $14/8D80 BD 03 33 LDA $3303,x[$00:342F];LOAD COMMAND SELECTED FROM MAIN COMMAND MENU $14/8D83 C9 01 CMP #$01 $14/8D85 F0 04 BEQ $04 [$8D8B] $14/8D87 C9 0A CMP #$0A $14/8D89 D0 04 BNE $04 [$8D8F] ;IF IT'S NOT SALVE OR ITEM, THEN LEAVE THIS ROUTINE $14/8D8B 85 F0 STA $F0 [$00:06F0];IF IT IS SALVE OR ITEM, STORE WHICH ONE INTO (NORMALLY UNUSED BYTE) 00F0 IN RAM - THIS WILL BE IMPORTANT LATER $14/8D8D A9 01 LDA #$01 ;IF IT IS SALVE OR ITEM, CAUSE THE GAME TO BEGIN ACTING LIKE ITEM $14/8D8F 6B RTL ;RETURN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $02/9AC7 60 RTS ;BACK TO OUR REGULARLY SCHEDULED PROGRAM
So that makes it so selecting Salve is like selecting Item... except that makes it so selecting Salve is exactly like selecting Item. That's where storing that command into 00F0 comes into play...
For targeting: Normally, item targeting is generated from the op code at $02/B606 - BD 1A 32 LDA $321A,x[$7E:321A] Well, we need the game to act differently if Salve is the active command, so, enter more custom code: ***
$02/B606 20 B7 9A JSR $9AB7 [$02:9AB7];JUMP TO SUBROUTINE AT $02/9AB7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $02/9AB7 22 90 8D 14 JSL $148D90[$14:8D90];JUMP TO SUBROUTINE AT $14/8D90 (STILL NO ROOM IN THE 28000 BLOCK) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $14/8D90 A5 F0 LDA $F0 [$00:00F0];LOAD WHETHER THIS IS ITEM OR SALVE $14/8D92 C9 0A CMP #$0A $14/8D94 D0 0D BNE $0D [$8DA3] ;IF NOT SALVE (AND THEREFORE ITEM) THEN LEAVE THIS ROUTINE $14/8D96 BD 1A 32 LDA $321A,x[$7E:321A];OTHERWISE, LOAD ITEM'S TARGETING $14/8D99 C9 40 CMP #$40 $14/8D9B B0 03 BCS $03 [$8DA0] ;IF IT'S AN ATTACK ITEM, SKIP AHEAD $14/8D9D A9 20 LDA #$20 ;IF IT'S A HEALING/SUPPORT ITEM, LOAD 20 (ALL ALLIES) INTO TARGETING $14/8D9F 6B RTL ;AND RETURN $14/8DA0 A9 60 LDA #$60 ;IF IT'S AN ATTACK ITEM, LOAD 60 (ALL ENEMIES) INTO TARGETING $14/8DA2 6B RTL ;AND RETURN $14/8DA3 BD 1A 32 LDA $321A,x[$7E:321A];IF IT'S ITEM (COMMAND), LOAD ITEM'S NORMAL TARGETING INTO TARGETING $14/8DA6 6B RTL ;AND RETURN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $02/9ABB 60 RTS ;BACK TO OUR REGULARLY SCHEDULED PROGRAM The truth of the matter is that all of that targeting stuff is just for show. The Salve code is what actually assigns targeting to the command, but I needed to do this to make it look natural.
So now we have selected our item and targeting. Somewhere along the lines here, the game takes care of subtracting 1 from the item quantity, so we can remove that from the regular Salve code entirely. Now, however, the game will still proceed as though the command was Item, meaning the Life item won't be split properly, so we still need whatever the Salve code does to make things work properly, and in order to do that, we need to tell the game to execute Salve if we chose Salve.
So, a bit of background code that normally takes place shortly after this is here:
$03/A6AD A9 01 LDA #$01This 01 will get loaded into the character's "next action," even if the action selected was Salve. So, we're gonna use that 00F0 value again here: ***
$03/E2E4 A6 A6 LDX $A6 ;LOAD CHARACTER SLOT INTO X $03/E2E6 BD 52 20 LDA $2052,x;LOAD ITEM SELECTED INTO A $03/E2E9 85 FE STA $FE ;STORE A INTO 00FE $03/E2EB 4C 24 E3 JMP $E324 ;JUMP TO $03/E324 (SKIPPING OVER THE NO-LONGER-RELEVANT QTY REDUCTION ROUTINE, SINCE ITEM SELECTION TAKES CARE OF THIS. REPLACED WITH EMPTY SPACE... PERHAPS FOR LATER USE!) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $03/E324 98 TYA $03/E325 85 01 STA $01 $03/E327 A9 06 LDA #$06 $03/E329 20 85 80 JSR $8085 $03/E32C A9 F8 LDA #$F8 $03/E32E 8D D4 26 STA $26D4 ;TARGETING STUFF, SINCE WHAT WE DID DURING ITEM SELECTION WAS REALLY JUST FOR SHOW $03/E331 A5 FE LDA $FE $03/E333 8D D2 26 STA $26D2 ;LOAD ITEM INTO NEXT ACTION TO TAKE $03/E336 EE 2A 35 INC $352A $03/E339 20 3E CD JSR $CD3E ;MAGIC CALL $03/E33C A5 FE LDA $FE $03/E33E 8D C5 33 STA $33C5 ;MAGIC GRAPHIC $03/E341 A9 0A LDA #$0A $03/E343 8D C8 34 STA $34C8 ;LOAD "SALVE" INTO SMALL COMMAND DISPLAY WINDOW $03/E346 A9 10 LDA #$10 $03/E348 8D C7 34 STA $34C7 ;(DON'T KNOW) $03/E34B 60 RTS ;RETURN And there you have it! I can't really make a patch of this, because I don't have a clean base to work from for reference, but if you want this new Salve in your ROM, just write in the sections of code in this post that are preceded by three asterisks (***).
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on January 07, 2015, 04:13:18 PM
This is fantastic! What a way to fix all of those ugly problems that my custom Salve had, including the pointlessness of hitting one enemy with an "All Enemies" spell, I'll see if I can get this working for the next Combat Boost patch, not to mention a lot of clever hacking at work here.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on January 07, 2015, 10:22:06 PM
I was just looking through my files and I came across this patch I made back in early November when Slick was down. It's another thing I developed for use in my own hack, but it could be used by anyone who wants this feature. I call it "Unique Steals." What it does is, when Stealing is successful against a boss monster, it changes the monster's item byte to 00 (Cure1,Cure1,Cure1,Cure1). This allows you to have boss monsters that can hold unique items to steal, without the pitfall of infinite acquisitions that normally comes with steal-able items.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on January 07, 2015, 11:26:54 PM
I was just looking through my files and I came across this patch I made back in early November when Slick was down. It's another thing I developed for use in my own hack, but it could be used by anyone who wants this feature. I call it "Unique Steals." What it does is, when Stealing is successful against a boss monster, it changes the monster's item byte to 00 (Cure1,Cure1,Cure1,Cure1). This allows you to have boss monsters that can hold unique items to steal, without the pitfall of infinite acquisitions that normally comes with steal-able items.
Wow, that is a Neat idea! I tried to get that to work, but I couldn't figure out the problems with Why the Item Byte wasn't being saved. Please tell me how you did it. Because of that Stealing isn't as useful as I would like it to be and this FFV-esque patch would set the groundwork for a more indepth Stealing system all around.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on January 08, 2015, 12:17:18 AM
Well, it wasn't simple. The problem with Sneak is that it doesn't ever have a chance to affect the target, so the data from 7E:2700 is never copied back to the monster's primary data entry (2000,x). The primary data entry will keep any changes you make to it, but there is no easy way (like "A6 A6") to get an X value to index to the right monster. So, I had to devise a long and arduous method based on the stealing character's "enemy target" byte - which wasn't easy, because for some silly reason, higher target values correspond to lower X values. Unfortunately, this is another one where I didn't really keep track of where I put all the custom stuff, but if you were to put a breakpoint on the steal routine and watch a live disassembly against a boss, it would all come out. There's nothing going on in the background like in some of my other mods.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on January 08, 2015, 12:41:42 AM
That was my hangup right there; the lack of targeting really threw me off and trying to force the mirror to load back into the original data did not go well as you can imagine. I'll have to take a look and see how you went about this soon then.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 08, 2015, 09:08:57 PM
Just posted this on the Project II thread on RHDN, but it deserves to be on slick as well...
All offsets are ROM with header.
How to Turn "Call" into a Five Characer Word in the Magic Menu: 1) Open ROM with a hex editor 2) Jump to $00/B1A3 (this is the pointer into the list of magic names to "Call") 3) Change the two bytes at B1A3 from "FC B1" to "0B B2" (This will point to the first of the three blank spaces instead) 4) Jump to $00/B40C 5) Change it from "00" to "01" (Skipping this step will cause your new label to overwrite Child Rydia's "White" label) 6) Fill in your five character label beginning at B40D
That'll do it.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: LordGarmonde on February 08, 2015, 09:18:27 PM
Oh that's Neat-O; ver' good to know.
Has anyone ever run into trouble mixing and matching magic? I'm thinking that I might like (someday) to give everyone just one magic command, possibly named for them, which is what made me think of it now. FuSoYa, for example, would just have one command for his magic: "Lunar"...and it has all the high level white and black spells...he doesn't need the level 1 spells, etc.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on February 08, 2015, 09:25:49 PM
Has anyone ever run into trouble mixing and matching magic?
Yes. See: White on Dark Knight Cecil in Combat Boost.
I had originally planned to have it (obviously) be called Black or (Sword)Tech (replacing Ninja) but.... when the spell levels were reached they weren't learned because they were in the wrong spell book...
This is done purely for Rydia at the start of the game. She is the only character that learns Black and White Magic, when this is nullified learned spells are put in Every spellbook that the character has. This is the problem.
Apparently Phoenix made a spell patch... but that uses the characters of the Black, White, and Summon Magic which the Sword Skills were not, so it couldn't help me at all and I never really looked into it again, I'll eventually do something with it though, it's just not a pertinent concern.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: LordGarmonde on February 08, 2015, 09:35:29 PM
Gotcha - yet another curve-ball, eh FF4? Don't worry we'll have the last laugh: :laugh:
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on February 11, 2015, 05:32:36 PM
Hmm, Chillyfeez, I've been looking for what depends on what the sprite displayed is (there Has to be a way to free up class slots 0E,0F,10 to not display mini,pig,toad!) and while doing so I stumbled upon the character length of Jobs
There is loads of free space, a lot more than the game ever seems to use so 8 characters instead of 7 won't break the bank.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 11, 2015, 10:03:15 PM
That is pretty nifty. So changing that to a LDA $#08 would be the key, then? I'm not sure I have immediate use for it , but I just might down the road. I bet the fellas working on Project II would be interested in hearing this...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on February 11, 2015, 10:28:10 PM
That is pretty nifty. So changing that to a LDA $#08 would be the key, then? I'm not sure I have immediate use for it , but I just might down the road. I bet the fellas working on Project II would be interested in hearing this...
Forgot to explain that,, yeah. All you'd have to do is change that to a 08. I was wondering as well, does each character have their own separate animation calls for their actions in battle? For instance Cecil doesn't glow Yellow when he uses his Dark Wave ability, but Rydia's special stance causes her to do just that. I was wondering if there was some set of animation bytes which tells each character what specific set of animation they should do?
This is sort of notable because Golbez by default lacks a Low HP Sprite which means it can't be a universal call which says "load this sprite in this position".
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 11, 2015, 10:55:49 PM
The yellow is just part of Rydia's special pose. It's part of her battle palette that just isn't prevalent in any other pose. There isn't a different arrangement for each character - they just worked each character's sprites in such a way that each pose fits into those arrangements. Because Golbez doesn't have the full complement of sprites, I imagine if you forced him into your party and he got into critical HP range, he would start to show some of Anna's sprites, but likely mixed up (as she also doesn't have a crouched pose) and with Golbez's palette.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on February 11, 2015, 11:25:18 PM
The yellow is just part of Rydia's special pose. It's part of her battle palette that just isn't prevalent in any other pose. There isn't a different arrangement for each character - they just worked each character's sprites in such a way that each pose fits into those arrangements. Because Golbez doesn't have the full complement of sprites, I imagine if you forced him into your party and he got into critical HP range, he would start to show some of Anna's sprites, but likely mixed up (as she also doesn't have a crouched pose) and with Golbez's palette.
I thought that would be the case as well, but no, he simply does not crouch when weakened. Nor does he use any animation for attacking or using a Special command. Only for Spell casting and item use are any of his animations used (and running, funnily enough.)
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 11, 2015, 11:48:43 PM
Well, he has running because he has walking (needed to move forward to cast spells). I'm surprised about the rest of that, though. Does he simply stand still when those other actions are performed?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on February 11, 2015, 11:58:52 PM
Well, he has running because he has walking (needed to move forward to cast spells). I'm surprised about the rest of that, though. Does he simply stand still when those other actions are performed?
That he does, I expected to see something odd occur when he was petrified (since it forces you into the weakened stance) but he just still stands in his default positioning. Casting, Item Use, and Walking appear to be the only animations used for Golbez, he was purely created Just for that single Auto-Battle, thanks Square...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 12, 2015, 12:28:32 AM
And dying, don't forget that one! I wonder what forces are at work there... There must be some special case set for Golbez's sprites to prevent those other poses. Maybe I'll look into that on my next day off (Friday). As you've seen, I've resolved to attempt "hold B to dash" one last time. I kind of hate that I'm getting into that again, but the truth is, Dash is the one User Option I've purposely left out of TfW because I don't like what events look like when they begin with Dash toggled on... And If I can get it to work the way it does in other FF games, then I can use it in my own hack. But anyway, whether this new plan I have will work or not I'll be able to tell pretty quickly, so I may be able to finish that little venture - for better or for worse - with a good deal of time to spare. If so, then looking into this Golbez thing (that is, comparing what happens with him against my notes for the rest of my pose/stance research) would be pretty high on the list now simply as a curiosity.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 19, 2015, 03:48:35 PM
I figured out how to widen a bunch of menus. not a whole lot of use for this beyond expanding class names. I should put together a how-to on the whole process for that, but until I can find the time to do so...
Here's a list of menu windows, with the LoROM addresses for each of their widths:
Main Menu Background Window: 1d820 Item Selection Menu: 1d8e2 Item Description Winow: 1d8ea Item Target Window: 1d950 Cannot Use Window: 1d954 Menu Menu Window: 1d82c Magic Selection Window: 1d965 Magic Target Window: 1d981 "Whom?" Window: 1d985 Selected Spell Window: 1d989 Current Equipment Menu: 1d9bd "Status" Window: 1da1d Window With actual Stats: 1da19 Custom Menu: 1dd5a "Customizer" Menu: 1dd49 Save Slot Windows: 1dbd8 "Save" Window: 1dbdc Time Window in Save Confirmation: 1dbfe Save Yes/No Window: 1dbfa GP Window in save confimation: 1dc02 "Done!" in Save Confirmation: 1dc63 Caster's Stats Windows: 1d969 1d96d 1d971 1d975 1d979 (yes, there are five separate widths, one for each party slot)
In most cases, there's only room on the screen to widen these menus by one or two tiles, but one is all you need for eight-letter class names!
Maybe someone will have some use for the other windows' widths...
:edit: I did the same for battle windows today... The first step (hopefully) in creating six-character command names. I can get the command window to be wide enough, and doing so doesn't block anything more than a window that accommodates five letters, but I'm hitting a roadblock in getting the commands to display as six characters. The way they are loaded into RAM may be prohibitive. I might have to rewrite the routine to make this work...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on February 21, 2015, 11:01:05 AM
Oy, menu expansion... it always seemed like a bit of a quagmire, but it would reveal quite a bit of useful information going forward so good work on this Chillyfeez! I would love to see some pictures of its applications.
You're probably aware of this by now, but just in case you aren't...
http://rb.thundaga.com/data/window_data.txt
It would save you a Lot of time, but I somewhat imagine this is what you're working off of.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 21, 2015, 12:55:31 PM
heh... no, I had no idea that existed.
I'm not sure I'm going to pursue this any more right now. I've spent a lot of time trying to do things with battle windows, and I think they might be alittle out of my scope at the moment.
I think I'm putting this pursuit on the back burner for now. Thanks, though...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 25, 2015, 10:30:38 AM
Not much to report on this, but I'm looking into the possibility of breaking the damage limit. I know someone (Maybe JCE300GT?) worked on this before and got the actual damage limit to break, but never got the displayed damage to break. This picture shows that it is possible for the game to display an extra digit. It will require some routine rewriting, but I can also confirm that the section of RAM that is used to convert the hex damage into decimal does have enough space to use an extra digit. That's all I can say at the moment, and I have no idea how difficult this task will be, whether I am capable of actually doing it, and if so how long it will take, but there you have it... (http://memberfiles.freewebs.com/22/01/115500122/photos/five%20digits.jpg)
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on February 26, 2015, 02:15:41 PM
While that is Really neat, FFIV is... not the best game to break the damage limit on further thought. All enemies (unless they have a special script) only have 65,535 HP max. Granted I was always curious to know how much damage a 99 Wisdom Bahamut was Actually doing...
So while it may have limited use, it is still quite neat to see that you managed it in the first place.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 26, 2015, 03:08:32 PM
If I can get it to work, my plan would be to use it conditionally upon certain late-inning equipment... Either "ultimate weapons" or maybe a "break damage limit" relic. The limit would still be only around 16,000 anyway, because the top two bits of the upper "damage" byte represent healing and MP, so you're limited to what can be expressed in 14 bits. So you still wouldn't be able to one-shot monsters with 65,000 HP.
Anyway, the big thing is to get it to work at all first, and I think the biggest part of that for me will be figuring out how exactly the game converts the hex values into decimal, because I really am clueless about that, and the first thing I noticed was one of those routines that stores the value into RAM and does a whole lot of ROL-ing... So I have that kind of headache to look forward to :childish:
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Digitsie on February 26, 2015, 03:14:48 PM
Are you doing that more for the '40 years later' thing?
I'm actually kinda curious how the plot/script is breaking down.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 26, 2015, 04:54:29 PM
I am indeed, digitsie. It's slow going, because I'm easily distracted with side-hacking ventures, but I am very close to finishing the next chapter. Once that's set, I plan to start a thread on RHDN to try to get some feedback.
I have the basic plotline planned out, as well as a bunch (but not all) of fine details. The limit system has evolved quite a bit since my first demo. It now works much like that of ffviii. I've also built in a chocobo catching sidequest - the chocobo forests are gone and you now encounter them randomly in the field - which will be part of the larger sidequest to get Mog.
The next chapter has also taken extra time because it involves the first "epic choice" (as I've come to call them). At one point, you have to make a decision to do one thing or another, and the subsequent events play out differently (including who joins your party and which boss(es) you fight) depending on that choice.
So, yeah, still working on it, but there's a lot to do and I'm taking my time. I want it, above all, to be something that people play and while it will be recognizable as a sequel and something that is built off of the original, still definitely a fully unique and rewarding experience.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Digitsie on February 26, 2015, 05:06:07 PM
Does it also take in account 'The After Years' or is it some sort of alternative universe? I'm kinda really curious about this, I admit, to see what the plot/script itself is like.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 26, 2015, 05:33:54 PM
It does take TAY into account. Admittedly, I started dreaming up the plot before I knew TAY existed, so some changes had to be made here and there. Some characters will be there - Ceodore and Ursula are both main party characters. Some are gone completely with no real rexplanation I've thought of - the Eblan Five are nonentities, as will be I think the little girl maenad Rydia adopts in the end of TAY. Some will be there but not playable, like Edward's girlfriend (you know... Whatsername). Some will be gone, but for reasons that are fully explained, like Leonora (sorry... Spoilers, dearie).
Also, I started really working on this after I learned the basic plot of TAY but before I had seen the ending, so as it stands there are references to the crystals having shattered, as though they never came back. So now that I know they did come back, I guess I have to rework it so that they are back but no longer have their power. That Cid had been drawing on the power of the wind crystal to make the airships go is kind of an immutable plot point, as is the loss of the power of the fire crystal for the Damcyan hovercraft.
Have you played the original demo yet? It'll take less than an hour of your time, and if you play through, you will get to a sort-of developer's room that will divulge a lot of plot details if you want them.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on February 26, 2015, 05:42:47 PM
the first thing I noticed was one of those routines that stores the value into RAM and does a whole lot of ROL-ing... So I have that kind of headache to look forward to :childish:
Are they bank 3 routines? I have some thoughts what a few of those do in that bank. For example, one that uses ROLs, 03:8407 I think is a 16-bit division, which produces a 16-bit integer division result and possibly a modulo or remainder.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Digitsie on February 26, 2015, 05:49:39 PM
It does take TAY into account. Admittedly, I started dreaming up the plot before I knew TAY existed, so some changes had to be made here and there. Some characters will be there - Ceodore and Ursula are both main party characters. Some are gone completely with no real rexplanation I've thought of - the Eblan Five are nonentities, as will be I think the little girl maenad Rydia adopts in the end of TAY. Some will be there but not playable, like Edward's girlfriend (you know... Whatsername). Some will be gone, but for reasons that are fully explained, like Leonora (sorry... Spoilers, dearie).
Also, I started really working on this after I learned the basic plot of TAY but before I had seen the ending, so as it stands there are references to the crystals having shattered, as though they never came back. So now that I know they did come back, I guess I have to rework it so that they are back but no longer have their power. That Cid had been drawing on the power of the wind crystal to make the airships go is kind of an immutable plot point, as is the loss of the power of the fire crystal for the Damcyan hovercraft.
Have you played the original demo yet? It'll take less than an hour of your time, and if you play through, you will get to a sort-of developer's room that will divulge a lot of plot details if you want them.
I can think of ways to explain the Eblana ninjas (i.e. they went off to spy on other villages, and if you make NPCs in other villages, there's your 'shhhhh, busy'. Unless Edge's in the party, in which case...
Curore, I think, would have gone off to explore the world on her own or taken over as summoner of Mist or something.
And no, I got stuck around Agast with four keys. What did I miss?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 26, 2015, 07:12:02 PM
If you got all four keys, then you can open the door to the well in Agart, but you have to use them in the right order.
The names of the keys are a reference to FFVIII. Specifically, the sorceress's theme music, "Liberi Fatali." The phrase that is repeated constantly in the song is "Fithos Lusec Wecos Vinosec." So, there you have it.
I clearly thought that was more well known than it actually is because you're not the first person to tell me they got stuck there.
No, Edge is not a playable character, so that wouldn't be an issue. I may include various nods to the Eblan Four, but they'll never really be in the spotlight. Cuore is a bit more of a problem... Rydia HAS to be the last of the summoners. It is among the most essential plot points. Maybe Cuore lost her power or something... I guess I can't just ignore it completely. I'll figure it out once the game gets up to the point where the player travels to Mist (which is part of the next chapter, so sooner rather than later).
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 26, 2015, 07:28:00 PM
the first thing I noticed was one of those routines that stores the value into RAM and does a whole lot of ROL-ing... So I have that kind of headache to look forward to :childish:
Are they bank 3 routines? I have some thoughts what a few of those do in that bank. For example, one that uses ROLs, 03:8407 I think is a 16-bit division, which produces a 16-bit integer division result and possibly a modulo or remainder.
I (on some level) figured that the ROLs had something to do with generating the proper integers. I think what I have to do is take care of everything else first, then just spend a bunch of time studying the inputs and outputs of these routines to see how they can be manipulated to serve my needs. If you're keeping an eye turned in this direction, avalanche, I may bend your ear when I get to that point, since you seem to know more about this kind of thing than I.
The good news here - it's actually quite easy to make the game display five digits. Only requires changing three bytes in ROM that essentially were there to set the upper limit to four digits. It's almost as if their original plan was to use five digits but then was scrapped - most likely because other workings of the game made 99,999 impossible and/or impractical. So anyway, I've got that part taken care of, and I was originally pretty worried about that.
I know the info about how to change the actual damage limit is out there somewhere, so that'll be next (as I recall, it needs to be changed for several different routines... One for fight, one for magic, etc, but just taking care of one should be enough for the testing phase of this project).
Probably won't get to work on that too much more today, but this is coming along better than I expected so far!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Digitsie on February 26, 2015, 07:48:30 PM
The names of the keys are a reference to FFVIII. Specifically, the sorceress's theme music, "Liberi Fatali." The phrase that is repeated constantly in the song is "Fithos Lusec Wecos Vinosec." So, there you have it.
I clearly thought that was more well known than it actually is because you're not the first person to tell me they got stuck there.
Considering I'm deaf, no, the music means less than nothing to me.
I'd consider setting up an NPC that sings Liberi Fatali with that phrase.
Quote
No, Edge is not a playable character, so that wouldn't be an issue. I may include various nods to the Eblan Four, but they'll never really be in the spotlight.
That's fine, though the oldest one probably should be dead - just say 'I took over for Grandpa (name), when he died.'
Quote
Cuore is a bit more of a problem... Rydia HAS to be the last of the summoners. It is among the most essential plot points. Maybe Cuore lost her power or something... I guess I can't just ignore it completely. I'll figure it out once the game gets up to the point where the player travels to Mist (which is part of the next chapter, so sooner rather than later).
Easy answer - a Maenad isn't a summoner - they had to basically 'steal' Rydia's Eidolons. With Rydia in full control of her summons and probably holding on to it, Curore can't access it unless Rydia wills it... and she probably didn't will it for -some- reason that might be useful to your story.
See (from the After Years wikia): 'The Maenads are powerful sorceresses able to teleport, use telekinesis, cast high-level Black Magic including Meteor, and summon Eidolons. Their capacity to summon Eidolons consists of petrifying their material forms and corrupting the Eidolon's mind, but Fusoya says this is not simply petrification, but a casting of the Eidolon's spirit into another dimension. This process can be disrupted by evoking an emotional response from the Eidolon. When this "awakening" occurs the Maenads lose the ability to summon that Eidolon. '
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on February 26, 2015, 08:07:43 PM
If I can get it to work, my plan would be to use it conditionally upon certain late-inning equipment... Either "ultimate weapons" or maybe a "break damage limit" relic. The limit would still be only around 16,000 anyway, because the top two bits of the upper "damage" byte represent healing and MP, so you're limited to what can be expressed in 14 bits. So you still wouldn't be able to one-shot monsters with 65,000 HP.
Anyway, the big thing is to get it to work at all first, and I think the biggest part of that for me will be figuring out how exactly the game converts the hex values into decimal, because I really am clueless about that, and the first thing I noticed was one of those routines that stores the value into RAM and does a whole lot of ROL-ing... So I have that kind of headache to look forward to :childish:
I sort of forgot about that. Yes, that seems the preferable way to go about it. I'm looking forward to the results then.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 26, 2015, 08:25:23 PM
Ah, yes, that certainly would have kept you from ever having known how to use those keys... Sorry bout that :blush: I was just thinking that same thing about having an NPC sing the song. I think the next demo release will have a training room accessible from the Eblan Barracks, anyway, so that would be a good place for that. The other option would be to rename the keys to something that would be obvious to anyone who's played FFIV, which would probably be a better idea, except I can't think of anything that would specify a particular order. I am open to suggestions on this front.
That settles the maenad problem, too, though I can't have Cuore joining the party either, so I'll have to say she and Rydia decided not to develop her magical abilities at all... Perhaps for her own safety or something.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Digitsie on February 27, 2015, 12:53:29 AM
Well these keys then: Eenie Meenie Miney Moe.
And given the context that Curore would be what, about 45? Just have her focus on magic because if she tries to control creatures, she takes away Rydia's connection to the Eidolons, and she wouldn't want to do that to her 'mother', so to speak. She could stand guard somewhere, using her magic to protect something until Rydia asks her to let the party in, and then... she opens it up, lets them in, then stands guard against... whatever it is. sorta like what Fu So Ya did on the moon.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 27, 2015, 07:53:19 AM
It's 40 years after the original ffiv, so ~20 years after The After Years. Cuore would be around 25. I'm leaning towards the idea that she didn't develop her magical abilities at all. Like maybe she's sort of the mayor of Mist, but entirely because of administrative prowess and not magical ability. After all, Rydia is the last summoner (and by the way, having spent lots of time in the Feymarch, she's very old - she is quite notably the Tellah of this game). Mist will need a new identity for itself beyond being the haven of summoners.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on February 27, 2015, 09:09:55 AM
Ah, the ROLler you are talking about is 02:852B which oddly enough is the same division routine I mentioned from bank 3, but for some reason coded slightly differently. In any case, it divides and produces an integer division in $2A and remainder/modulo in $2C. The former is used as the next digit, while the latter is used for calculating the next digit on the way down. Interestingly that does indeed work for 5 digits.
I would bet that the routine at 02:86BF is probably used for any decimal conversion for display, at least in battle, including the party battle window HPs, and perhaps the monster HP in a Peep result, which actually needs 5 digits.
I tried setting the damage to 12345 and while this routine did calculate 5 digits properly, only 2345 displayed in bouncy numbers, thus whatever 3 changed bytes you mentioned must be needed to setup the bouncy sprites. You're already past this part, but I was curious how they performed the decimal conversion, so I popped in to take a look.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 27, 2015, 09:11:39 AM
Hmm... it seems I've missed something. five-digit display works fine for one monster, but for multiple monsters (and presumably party members) I get results like this: (http://memberfiles.freewebs.com/22/01/115500122/photos/undefined/Messed%20up%20multi.jpg)
The damage readouts should say "12345," "67890," "54321" and, "98760." Only the first one shows up correctly (the top imp, with 12345). Looking at the data just before it's loaded for visual processing, I can see (inasmuch as I understand everything) that, for certain pieces of data, it's still assuming that it's counting four digits per target. So hopefully it's just a matter of finding those instances of multiplication and changing them to five instead... which will in fact require some extra code, since x4 is only two bytes (ASL A, ASL A) and x5 is at least seven bytes (STA [dp##], ASL A, ASL A, CLC, ADC [dp##]). :bah:
Oh well, I'll get there eventually, it's just gonna take some time...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 27, 2015, 09:13:44 AM
Ah, the ROLler you are talking about is 02:852B which oddly enough is the same division routine I mentioned from bank 3, but for some reason coded slightly differently. In any case, it divides and produces an integer division in $2A and remainder/modulo in $2C. The former is used as the next digit, while the latter is used for calculating the next digit on the way down. Interestingly that does indeed work for 5 digits.
I would bet that the routine at 02:86BF is probably used for any decimal conversion for display, at least in battle, including the party battle window HPs, and perhaps the monster HP in a Peep result, which actually needs 5 digits.
I tried setting the damage to 12345 and while this routine did calculate 5 digits properly, only 2345 displayed in bouncy numbers, thus whatever 3 changed bytes you mentioned must be needed to setup the bouncy sprites. You're already past this part, but I was curious how they performed the decimal conversion, so I popped in to take a look.
Well that's good to know... so assuming I can get the bouncy number display routine to properly display for multiple monsters - and of course re-set the damage limits - the decimal conversion shouldn't be an issue?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on February 27, 2015, 09:28:16 AM
That looks to be the case. Are values above 14 bits valid in the place you inserted those damages?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 27, 2015, 11:26:33 AM
Sorry, which places I inserted those damages? Are you referring to the problems related to the picture I posted?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on February 27, 2015, 11:35:18 AM
Yep. As you mentioned earlier, 16383 is going to be the largest number valid in many parts of code because of the flag bits. So if you forced damage numbers like 54321 pretty late in the pipeline, it might work okay, but earlier parts might misbehave because of those flags. I'm sure it wouldn't be the only problem though, so this is a minor thing.
The 321K damage is pretty rad though : )
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 27, 2015, 03:05:49 PM
Oh, I see what you're saying. No, it's entirely about how things are being counted per monster. See, the 20 digits that are being displayed here are set up all in a row. Each one has four values - x-pos, y-pos (which changes several times for the bouncy effect), actual displayed digit pointer (equal to the digit's value plus 70), and "31" (I have no idea what this one does). The reason things aren't displaying properly has everything to do with the fact that it's only assuming four digits per monster when it assigns the x and y positions to each digit.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on February 27, 2015, 03:45:46 PM
Excellent, those 4-byte records are the hardware sprite format. FYI the 4th byte format is
vhoopppc v: vertical flip h: horizontal flip oo: priority ppp: palette c: 9th bit of sprite index (aka character)
Another thing is that there are only so many sprites available for the digits, but I don't know how many that is. Is the most that can be displayed at once 8 monsters * 5 digits, or are there some spells that need all 13 actors * 5?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 27, 2015, 09:09:11 PM
vhoopppc v: vertical flip h: horizontal flip oo: priority ppp: palette c: 9th bit of sprite index (aka character)
"Priority" means, essentially, layer, I presume... Whether it appears over or under existing sprites? And what's character?
Quote
Another thing is that there are only so many sprites available for the digits, but I don't know how many that is. Is the most that can be displayed at once 8 monsters * 5 digits, or are there some spells that need all 13 actors * 5?
AFAIK, 8*5 would be the most. Ffiv doesn't have a merton-style spell that hits all monsters and all party members. The area of RAM the sprites are loaded from certainly has enough space to accommodate 40 digits, so here's hoping that won't be a problem for the hardware to display...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 27, 2015, 11:18:53 PM
Ha-ha! brilliant!
Turns out I was doing too much. I didn't need to change three bytes. I only need to change one byte!
Ah, the ROLler you are talking about is 02:852B which oddly enough is the same division routine I mentioned from bank 3, but for some reason coded slightly differently. In any case, it divides and produces an integer division in $2A and remainder/modulo in $2C. The former is used as the next digit, while the latter is used for calculating the next digit on the way down. Interestingly that does indeed work for 5 digits.
I would bet that the routine at 02:86BF is probably used for any decimal conversion for display, at least in battle, including the party battle window HPs, and perhaps the monster HP in a Peep result, which actually needs 5 digits.
I tried setting the damage to 12345 and while this routine did calculate 5 digits properly, only 2345 displayed in bouncy numbers, thus whatever 3 changed bytes you mentioned must be needed to setup the bouncy sprites. You're already past this part, but I was curious how they performed the decimal conversion, so I popped in to take a look.
Hmm, even though I've activated display of the 10000ths place digit, it's still not showing up in bouncy numbers, so the routine at 2852B must be throwing out the remainder after four digits instead of storing it in the place that was already set aside for a 5th digit. Silly. So I'll have to zero in on the place where that digit exists and tell the code to use it instead of disposing of it...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on February 28, 2015, 12:16:51 PM
Yes, priority is like the Z index, and is the order of sprites but also between sprites and bg layers too. It's nontrivial though when comparing bg's and sprites.
Character is what the SNES docs call it. It is the index into the sprite graphics loaded elsewhere in video memory. Sprite index makes better sense to me though.
As for your latest post, I came across some relevant 4-assuming code where it takes the 5, then ignores the first, before it gets to the sprite code you found. I am not home to post exactly where right now though. But I should be able to do that tonight or tomorrow if you are still on the problem. But the low level decimal conversion itself keeps all 5 for sure. It's somewhere else that discards it.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 28, 2015, 02:04:40 PM
I actually got it working, but it did require a bit of custom code, since I still don't fully grasp how the conversion is working. I can alter that routine so that it acknowledges values above 9999, but it still stores one digit above 9 in the 1000s place, so to work around this I wrote a 0x13 byte routine that basically says: If [digit] is >9, then store 1 in the next digit up, subtract 10 from [digit] and store. I was hoping I could do it all without any custom code (which still might be possible), but this works flawlessly, so I am satisfied with it. If you want to look into making that routine account for the 5th digit, though, I would still be interested in seeing that happen.
The only step left is to "turn off" the 9999 damage limit(s) and this will be a working hack!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on February 28, 2015, 09:51:12 PM
Cool, glad you got it!
Can I ask where it was that you modified, or where it had the larger-than-9 digit? I'm pretty sure that 02:852B (division) and 02:86BF (generic binary-to-decimal conversion) are okay. The latter should put 5 good digits into $180C-$1810. Code at 02:8716, however, discards the first digit dropping it to 4. But I'm not sure where the code is that calls the decimal conversion and ultimately finds its way to the sprite setup.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on February 28, 2015, 10:57:34 PM
Yeah, I've been keeping notes on a notepad file as I go, and was intending on posting it all once I had the patch up and running, but I can put up what I've got so far... Except I'm already in bed for the night, so I will do tomorrow morning when I get up.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 01, 2015, 09:46:19 AM
OK, let me try to explain everything I've done so far...
So, the place in RAM where the digits are stored immediately before they're loaded for visual processing is 00:0340. As previously mentioned, it's four bytes per digit: x,y,(digit+70),(vhoopppc). It should be noted that the game does, by default, assign five digits per target, even though five digits are normally never used.
Now, byte 2 of those entries (the digit) is loaded into the table at 0340 from a table at 7E:DBE6. This table also assigns five digits per target, but the uppermost digit is never loaded into 340. Instead, the game loads 1000s, 100s, 10s, 1s and the 10000s of the next entry (which is always FF, or blank) into the entry for each target.
$02/E5AA BD E5 DB LDA $DBE5,x[$7E:DC18] So now the game is accounting for the correct five digits for each target. As a result, the damage digits display one sprite to the right from where they normally would, but I personally find that completely inoffensive. It can probably be shifted, but I say why bother? It looks fine.
So now we're at the point where the problem at hand is the fact that nothing is being loaded into the 10000s place digit. You can cheat the damage up to 16383, but only "6383" will show up. This has to do with the decimal conversion process, and more specifically what the game is doing (or not doing) with the last remainder.
The conversion routine loads the digits into 180C-180F, and they are loaded from there into the table at DBE6. As far as I can see, the 10000s place digit is never loaded into 180B. So I spent a while watching a live disassembly of the conversion routine. I still don't get what is happening or how it happens. My understanding of the ROL opcode is that it essentially works like ASL, except that it can be performed on two bytes at once... and sometimes if you ROL 00 00, you get 01 00, and I have no idea where that bit comes from. anyway... from what I can see, the storing of digits into 180C-180F is pretty hardcoded. the game doesn't do a STA $180C,x op that is performed four times as X increases. it's STA $180C, STA $180D, STA $180E and STA $180F. What I did notice was, right before the jump into this subroutine, the game does this:
$02/86C1 A2 10 27 LDX #$2710 Well, 0x270F is equal to 9999, so it occurred to me that this op might be setting the upper limit of what numbers are considered in the decimal conversion process. So since we want the game to accept damage as high as 0x3FFF, I changed this op to:
$02/86C1 A2 00 40 LDX #$4000 I then cheated 0x3000 damage into A4 and watched what happened... 0x3000 is equal to 12288. The output I got on screen was "[random incorrect sprite]288" So I looked at what was in the table at DBE6... Bear in mind that the format for digits is (actual digit + 70), so correct would be 71 72 72 78 78 What I had was FF 7C 72 78 78 Well, A + 2 = C, which means what the game was doing was now accounting for the value over 9999, but instead of separating that 7C into two usable digits, it was just going with it. So I found the op that stores 7C into DBE7:
$12/EFE0 C9 7A CMP #$7A ;compare the digit about to be stored into the table with 7A $12/EFE2 90 0A BCC $0A [$EFEE] ;if it is lower than 7A, skip to the end of this routine (and proceed as normal) $12/EFE4 48 PHA ;if it is 7A or higher (which will only happen with the digit in the 1000s place, then stack it $12/EFE5 A9 71 LDA #$71 $12/EFE7 99 E6 DB STA $DBE6,y[$7E:DBED];load 71 into the 10000s place $12/EFEA 68 PLA ;pull the digit back off the stack $12/EFEB 38 SEC $12/EFEC E9 0A SBC #$0A ;subtract 0A $12/EFEE 99 E7 DB STA $DBE7,y[$7E:DBEE];then proceed as normal $12/EFF1 C8 INY ;(this is a replacement of that INY we cannibalized at 02/CA38 $12/EFF2 6B RTL And there you have it! Five digits now display properly... as long as you cheat in damage over 9999. I still haven't gotten to the point of turning off those limits. For the most part, this will just be a matter of finding them (there are several, different ones for damage routines of different commands) and changing them from 270F to 3FFF. The Multi-Target damage routines may require a little figuring out, because I think the game does something weird where if the total calculated damage is over 9999, the first target gets 9999 and the rest of the damage is distributed among the remaining targets... or something like that. Oh well, we'll see.
I'm off work today, but I have some chores to do, so I'm not positive I'll be able to get a lot of work in on this. Here's hoping.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on March 01, 2015, 10:40:28 AM
Well, I still think the division and decimal conversion routines are okay. The decimal conversion writes 5 digits to $180C,180D,180E,180F and 1810. 180B is not related. I also don't think DBE5 is part of it, so I suppose that could result in reading a bogus value.
The reason that the 10K digit is missing is because they discard it. Excerpt:
02:CA08 20 BF 86 JSR $86BF decimal conversion routine 02:CA0B 20 16 87 JSR $8716 discard first digit, blank out leading zeros, set X to first digit to display First it calls the decimal conversion, so 180C-1810 have all 5 correct digits. But the next routine called shifts all the digits over, discarding the 10K digit, then does some other things like writing an FF over leading zeros (so they don't show), and leaves X pointing to the index of the first digit to show.
That second routine is the problem, and it called in multiple places, so we may not be able to totally change it without breaking other things.
Here's what I tried, just two bytes changed so far:
FROM 02:CA0B 20 16 87 JSR $8716 TO 02:CA0B 20 25 87 JSR $8725
FROM 02:CA3A E0 04 00 CPX #$0004 TO 02:CA3A E0 05 00 CPX #$0005 The first change skips over the digit-discarding part but performs the rest of that subroutine. And the second causes it to copy 5 digits to the DBE7 area. You're right and it's cool that the game otherwise allowed for 5 digits. Attached is an example running with those changes.
Unfortunately, there is one part not perfect about this. Above I mentioned that the routine leaves X pointing to the first index to show. Well with this hack, if you do a single digit worth of damage it will have a leading zero like "06". If we change it to fix that, then some of the callers of that routine will get messed up because they assume it discards the leading digit. I would hope that's fixable by tweaking the various callers, but I have not tried that yet. Hehe it also says "Miss!0" or similar the next time because they don't clear everything properly.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 01, 2015, 11:20:27 AM
That 5 in the ones place also looks like it's bouncing a bit oddly. From what it looks like, you're drawing your digits from DBE7-DBEB. If you use DBE6-DBEA instead, I think it will follow the wave pattern of the upper four digits more closely. It it possible that might also solve the "miss!0" issue, since "miss!" is loaded into DBE7-DBEA? ... On second thought, it might not affect the bounce at all, but it should fix "miss!0"
So far, I still prefer the result of my method, but you may be on to something here.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on March 01, 2015, 02:59:39 PM
I think the bounce looks okay, perhaps the screenshot was taken at an awkward moment.
If your results are working, then that's good. I'd be concerned about introduced bugs by changing the decimal conversion routine as you did, because there are perhaps 4 callers in the bank, but I could only discern what two of them were (party HP window and damage), and that greater-than-9 first digit -- and maybe semantically different other digits -- could in theory cause problems with the other callers. The fact that the original decimal conversion routine already did 5 digits makes me want to use it unmodified, but what you did could certainly be an ingenuitive hack to only write 4 (albeit special) digits, so long as no other caller got tripped up by it.
I fixed the "06" problem by making a few more 1-byte tweaks, but at least the "Miss!0" remains to be fixed. For my hack attempt, I am actually using all 5 digits (oddly yours is not...), so I think I actually need an FF written into the 5th byte to blank out any remnant digit. Like you, I wanted to avoid jumping to an unused section for additional assembly due to the conflict with other patches, but I was not able so far to fit a code change in place that sets the Miss sprites to also put a proper FF in there.
I forgot to touch on the ROL vs ASL topic before. ROL indeed works similarly to ASL, but where as ASL always puts a 0 for the new bottom bit and the top bit is discarded, ROL moves the carry flag into the bottom bit and then puts the top bit into the carry flag. That way the carry flag can be used as temporary memory, and that is why it is often combined into a 2-byte operation. i.e. during the first use, the top bit moves into the carry flag, and during the second use, the carry flag moves into the bottom bit. You can see how this mimics a single 16-bit operation. You'll also see that all uses of ROL or ROR probably have a SEC or CLC beforehand to ensure they know what the value of the carry flag is upon the first use.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on March 01, 2015, 07:11:31 PM
Arg. I tried to use the MVN instruction combined with finding a few places in ROM that happened to have the needed bytes for the "Miss!" sprites (6C 6D 6E 6F). But that instruction takes SO many other instructions to setup, plus I found that it has the side effect of changing the data bank register, so that has to be restored or the game hangs, and by the time all that is added, it was still 1 byte too long.
By the way, if you ever go to use the MVN or MVP instructions, the description at http://wiki.superfamicom.org/snes/show/65816+Reference (http://wiki.superfamicom.org/snes/show/65816+Reference) is completely wrong. It appears reasonable, but don't trust a single word of it... This PDF is a much more thorough and accurate document, but much less handy: http://wiki.superfamicom.org/snes/files/assembly-programming-manual-for-w65c816.pdf (http://wiki.superfamicom.org/snes/files/assembly-programming-manual-for-w65c816.pdf)
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 02, 2015, 04:50:18 PM
Well, it works! Props to JCE3000GT for finding and posting the location of the damage limits... I was having a bit of trouble finding them on my own.
As for other calls to the decimal conversion routine that I've butchered... The game is constantly calling the routine during battle, which leads me to believe it is used for the party HP window (which is constantly updated), but that won't matter because party members' HP never rate higher than 9999. I tried casting the Peep spell and using the Peep ability on monsters with 65535 HP and it displayed just fine, so I'm operating under the belief that there is no collateral damage from what I did.
Don't get me wrong, I still like the idea of being able to do this without any custom-written assembly, but I'm satisfied with these results.
These images show actual damage outputs (of course, with lv. 99 characters and maxed out stats)
I do intend to put a patch together to submit to RHDN. There's quite a bit of FFIV hacking going on there at the moment, and I think some of those folks might be interested in this. I plan to list avalanche and JCE3000GT as hackers on this project, as well as myself.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on March 02, 2015, 08:14:44 PM
Quite an impressive piece of work! Meteo would be worth the 10 Charge Time if it deals That much damage! Did you also plan on character's having more than 9999 HP then?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 02, 2015, 09:30:20 PM
No. There are several reasons why I wouldn't do that, the biggest one being the lack of space in the party HP window. After the brief (and ultimately failed) foray I took into trying to expand command and/or spell names, the one thing I know for sure is that what is going on in those windows is really complicated. Even if I was able to properly resize the battle windows to accommodate two extra characters, I'm not sure I'd be able to make an extra digit display there, or if the work it'd take would be worth the reward.
I dunno, maybe I'll look into it someday, but it's not high on the list of priorities.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 04, 2015, 09:57:29 PM
The patch is up on RHDN. http://www.romhacking.net/hacks/2343/ (as of 3/4, credits are pending, because the site doesn't let you add credits until the main submission has been approved)
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on March 05, 2015, 08:46:15 AM
The patch is up on RHDN. http://www.romhacking.net/hacks/2343/ (as of 3/4, credits are pending, because the site doesn't let you add credits until the main submission has been approved)
I love the tagline you used for it. But won't Bahamut also break the Damage Limit, or does it not deal much more than 9999 damage?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 05, 2015, 10:40:45 AM
Meteo ends up being significantly more powerful than bahamut. The difference is more noticeable the larger the enemy party. Test around the group of eight imps/imp caps that can be found around Fabul to see.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: JCE3000GT on March 05, 2015, 12:01:17 PM
Great work chillyfeez and avalanche! I'm so glad someone made use of that data. I always wanted to see the 5th digit possible.
And if memory serves me Meteo had a 200 power vs 99 power for Bahamut..? So Bahamut would break the limit but only barely and only assuming max Wisdom.
I tinkered with the character stat caps too but the lack of assembly knowledge prevented me from doing more. The stats (Str, Vit, etc) are easily functional past 99 but the HP is tricky and may break some spells that base on HP...not sure. I can say having STR higher than 99 will make the HP damage cap removal even better. :)
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on March 05, 2015, 12:05:13 PM
I plan to list avalanche and JCE3000GT as hackers on this project, as well as myself.
Very kind of you, though I don't think I really helped any. I was amused to see the difference between my new (large) identifier on that site and JCE3000GT's. (Deservedly so)
The need for some unused space for assembly got me thinking. Is there a tool that can detect whether a set of patches conflict with each other? Detecting logical problems would not be doable, but it should be possible to check if they modify the same existing code or reuse the same unused space. I suppose it would just be detecting an overlap in the range of bytes an IPS modifies.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on March 05, 2015, 01:12:49 PM
Yes, I have a feeling Chillyfeez and I have ran into this problem already when I've tried to apply patches that he has made to already heavily modified files like Combat Boost. Having a tool that would be able to tell if there's a code conflict would be wonderful.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 05, 2015, 04:25:31 PM
I plan to list avalanche and JCE3000GT as hackers on this project, as well as myself.
Very kind of you, though I don't think I really helped any.
Nonsense. Having a person off of whom to bounce ideas is extraordinarily important, IMHO (which is why Grimoire LD makes it into the credits of almost all of my ROM Hacking endeavors). And I'm sure some of the things you posted here helped me focus what I was doing.
Quote
The need for some unused space for assembly got me thinking. Is there a tool that can detect whether a set of patches conflict with each other? Detecting logical problems would not be doable, but it should be possible to check if they modify the same existing code or reuse the same unused space. I suppose it would just be detecting an overlap in the range of bytes an IPS modifies.
I would use a tool like that all the time. So many of my mods end up being incompatible with each other. I have a bad habit of using the same "free" space over and over again.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: assassin on March 05, 2015, 04:36:10 PM
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on March 05, 2015, 05:13:54 PM
Well I whipped this up before I saw the wayback machine link. Maybe somebody will enjoy it. I don't have an account on RHDN, so I'll try to upload it here.
It's a command line tool for Windows, no GUI. Takes any number of IPS paths as arguments, and displays the file offset ranges and filenames for any conflicts.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: JCE3000GT on March 05, 2015, 07:34:01 PM
Ok, so I have something to inject in the 5-digit HP discussion. I played around with this myself a bit and I believe it is quite possible to successfully do this with only minor menu modifications. I created some mock-ups a while ago for me to visually see what these extra digits may look like. I'll put them below. I know I'm missing the battle magic menu, but, I seriously doubt anyone would even want more than 9,999 MP. Also, the max HP can be removed from battle. I think 5-digit displays for HP would really add a certain level of interest in the game.
The other thing I was working on was increasing the HP of the monsters from 2 bytes to 3 bytes (24-bit in other words), but I didn't get very far on that since I retired shortly afterwards. I may poke around on that since I've got a new workstation setup in my office at home and this interests me at the moment.
Thoughts?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 05, 2015, 08:56:12 PM
While I'd love to see it happen, how feasible it it really?
Near as I can figure, monster HP can't be expanded to 24 bits unless party HP is as well, since damage routines are the same for both. There's plenty of unused bytes in monster stat records, but not so many in party stat records. Then there's rewriting all of the monster data in ROM (ugh). It just seems like such a massive undertaking.
I mean, don't let me discourage you if it's something you want to tackle... I'll help if I can, but the thought of trying to make it all work makes my head spin a little bit.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on March 05, 2015, 09:29:11 PM
That is some fantastic proof-of-concept JCE! It looks so clean, and if we forget about including max HP values in battle as you show there it looks perfectly fine. I'm sure you're aware though that stats only reach up to 255 normally, but as a proof of concept it is a wonderful idea.
Now increasing monster's HP past 65,535 will not be easy, every byte of a monster's ROM data is used when fully optimized (as in when the Evades are properly reconfigured) if the evades are taken out of the picture there are four more bytes to use for the enemy's data, now this is possible, and it could work this way...
(Using Magic Evasion byte)
Write custom code into the "Is HP 0?" check that then looks at the ID "Is it an enemy?" then finally "Does Magic Evade = 0?" If so, move on to the rest of routine. If not, "Add FFFF HP to enemy" and finally "Subtract 1 from Magic Evade".
Is it clean? No, not really, past 65,535 HP value you only have x2, x3, x4, etc. But it will work for those big enemies. Granted any damage done after HP reaches 00 will reset to 65,535. Now you could utilize more of those unused evade bytes to set more variety, like "IF Magic Evade Multiplier = 3 divide 65,535 by 3 for next life bar"
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: JCE3000GT on March 05, 2015, 10:08:30 PM
While I'd love to see it happen, how feasible it it really?
Near as I can figure, monster HP can't be expanded to 24 bits unless party HP is as well, since damage routines are the same for both. There's plenty of unused bytes in monster stat records, but not so many in party stat records. Then there's rewriting all of the monster data in ROM (ugh). It just seems like such a massive undertaking.
I mean, don't let me discourage you if it's something you want to tackle... I'll help if I can, but the thought of trying to make it all work makes my head spin a little bit.
In regards to the monster HP it would be an undertaking. The result if achieved would be an outstanding one as seen with Final Fantasy 3us. I'm still on the fence on this one. Higher defense for monsters and lower physical attack for characters would probably be much less work.
That is some fantastic proof-of-concept JCE! It looks so clean, and if we forget about including max HP values in battle as you show there it looks perfectly fine. I'm sure you're aware though that stats only reach up to 255 normally, but as a proof of concept it is a wonderful idea.
Now increasing monster's HP past 65,535 will not be easy, every byte of a monster's ROM data is used when fully optimized (as in when the Evades are properly reconfigured) if the evades are taken out of the picture there are four more bytes to use for the enemy's data, now this is possible, and it could work this way...
(Using Magic Evasion byte)
Write custom code into the "Is HP 0?" check that then looks at the ID "Is it an enemy?" then finally "Does Magic Evade = 0?" If so, move on to the rest of routine. If not, "Add FFFF HP to enemy" and finally "Subtract 1 from Magic Evade".
Is it clean? No, not really, past 65,535 HP value you only have x2, x3, x4, etc. But it will work for those big enemies. Granted any damage done after HP reaches 00 will reset to 65,535. Now you could utilize more of those unused evade bytes to set more variety, like "IF Magic Evade Multiplier = 3 divide 65,535 by 3 for next life bar"
That is a very interesting take on the monster HP subject. I'd be interested to see if this is something that could be done. Maybe relocating the entirety of the monster data in an expanded ROM data block would give more space to then allow all monsters the same byte length. I tried and failed at that last bit...
On the example images I posted I only used 9's just to fill up the 8x8 space. :) I do know you could probably increase the stat cap display length too. I made only partial progress on it but lost that ROM and document in a HDD crash.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on March 05, 2015, 11:52:32 PM
Hmm, inklings of an idea are starting to appear, something I should be able to use in Combat Boost as well, down the line...
Here's the line of thought.
Here's an example...
Zeromus
Level 65.
Item Drop Byte 01
That's all that has to be done with the ROM data.
Now here's what the plan would be...
HP Drops to 00.
Is it a monster? (Yes)
Is its Item byte below 40? (Yes) (What this does will make it look to see if the enemy has the no drops set to not drop an item. If it does it will go to the next bit of data.)
Is it 00? (If so, jump out of this routine)
Subtract 1 from the Drop Table.
Load Enemy's Level into X. (65 in this case)
Add 1000 into Accumulator
Place Level into X.
Add 1000 into Enemy's HP.
Subtract 1 from X
Loop until X reads 00.
Through just configuring two bytes in Zeromus' ROM data (Level and Item Drop) he would gain 65,000 more HP.
The increments of 1000 lets it to be used fairly openly (just don't go over Level 65 for obvious reason!) and you can set how many "life bars" you want by utilizing the amount in the Item Drop table.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 06, 2015, 08:51:34 AM
OK, I had a thought about the feasibility of the five-digit party HP display. It's related to something that's been on my mind for a while.
Whereas there wouldn't be enough room in the battle window to display [current HP]/[max HP], there is enough room to display [current HP][space][something three characters wide]. Meaning you could do [current HP][space][percentage of full HP]. I could also rework User Options to accommodate the change, so the percentage would display %max HP or %ready depending on the selected option.
... Now here's where the brainstorm really gets good... Instead of [current HP][space][three space wide percentage], we could do [current HP][four space wide meter]. Using the wealth of empty space for numbers and letters leftover from the Japanese editions, we could make 8 new "letters" - a single, right-aligned vertical line (one pixel wide), two pixels wide... All the way up to an 8-pixel full box. Stack four of those side by side, then create an algorithm that tells the game: 1) calculate the appropriate percentage (either Max HP or Readiness). you'd only need a one-byte value, but two bytes would yield more accuracy, of course. User Options is already doing this for readiness. 2) If the percentage is FF (100%, FFFF if using two bytes), then display [full box][full box][full box][full box] 3) for every 0x06 the percentage decreases (or 0x0666 for two bytes), decrease the meter, so if the percentage (one byte) is F9, then display [7-box][full box][full box][full box]
There's probably a more numerically efficient way to make those meter bars decrease (similar to how the game displays numbers, I'd imagine), but this would certainly work.
I'm not sure I could fully get behind a five digit HP value without a way to display max HP, and this could be the answer.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on March 06, 2015, 09:09:58 AM
... Now here's where the brainstorm really gets good... Instead of [current HP][space][three space wide percentage], we could do [current HP][four space wide meter]. Using the wealth of empty space for numbers and letters leftover from the Japanese editions, we could make 8 new "letters" - a single, right-aligned vertical line (one pixel wide), two pixels wide... All the way up to an 8-pixel full box.
I was just going to suggest an ATB bar too! Would this use the 2nd control timer .. what I call the "master control timer"? That value technically decreases to zero over time starting from a varying value; how would you calculate an increasing percentage from it?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on March 06, 2015, 09:23:43 AM
Oh ho! An HP bar, eh? I really like that idea, as it still gives a numerical amount of how much HP one has and it would work with the X9999 HP display quite well, I would imagine.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: JCE3000GT on March 06, 2015, 09:45:55 AM
Now those are some brilliant ideas!
One thing that may need to be tweaked is the HP per level for the characters so after say level 69 when the lovely 70-99 level ups happen the melee characters have the ability to go over 9999 at some point. Or would you add another Apple item that raises more than 50/100 HP? If it were me I would raise the EXP requirement for levels 50-69 to be about double the default amount, but, as a reward for leveling up get a substantially larger amount of HP per level up. If memory serves me I believe the only character than could legitimately get over 9999 is Yang without the use of Silver/Golden Apples. Cecil statistically can get close (~9800?) if you manage to roll the lucky number every time.
What do you all think?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 06, 2015, 10:35:01 AM
I was just going to suggest an ATB bar too! Would this use the 2nd control timer .. what I call the "master control timer"? That value technically decreases to zero over time starting from a varying value; how would you calculate an increasing percentage from it?
Are you talking about the timers at 7E2A07? If so, then yes. The current version of my User Options patch makes use of some normally unused character stat byte... like 2043,x or something. When the timer resets (is at its highest point), the value is stored into that character stat byte then it keeps checking the timer and uses this formula (where M is the max timer value and C is the current timer value): (M-C)/M The result is a 16 bit value (without looking at it again... I don't remember exactly how the calculations work) that then goes through the normal decimal conversion routine to be displayed as a percentage in the Party HP window.
One thing that may need to be tweaked is the HP per level for the characters so after say level 69 when the lovely 70-99 level ups happen the melee characters have the ability to go over 9999 at some point. Or would you add another Apple item that raises more than 50/100 HP? If it were me I would raise the EXP requirement for levels 50-69 to be about double the default amount, but, as a reward for leveling up get a substantially larger amount of HP per level up. If memory serves me I believe the only character than could legitimately get over 9999 is Yang without the use of Silver/Golden Apples. Cecil statistically can get close (~9800?) if you manage to roll the lucky number every time.
What do you all think?
If you're increasing HP and damage all around and making the higher values generally available, then I don't think you need to make it harder to get to the levels that will exceed 9999 HP. I mean, anybody who gets their characters up to Lv. 99 in FFIV is doing a lot of grinding anyway...
If you want to make above 9999 values "special," like they are in FFX, then I wouldn't build them naturally into the level-up system. Apples would be one possibility... Then there's the possibility of creating equipment that increases the wearer's max HP by a percentage (though I don't know exactly how this would work... FFIV doesn't seem to have a place to store base vs. adjusted Max HP like later FF games) You could also make equipment that gives HP bonuses at level up (make the level up routine say, "check for bonus armor, if equipped, add 200 to the level up HP award")
Or... what about simply increasing the max level? Again, I don't know exactly how difficult this would be without doing some research... the sticking point in my estimation would be whether the "current Exp" and "Exp needed for next level" have enough room for many more levels. But if characters could level up to, say 150, then Cecil and Kain would have no problem exceeding 9999 HP eventually.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: JCE3000GT on March 06, 2015, 11:10:33 AM
The increasing the level beyond 99 would pretty much fix it. The level up table can easily be done by allowing 3 digit level # displays, adding more levels after the 70-99 to do 70-150 or whatever, and add the extra experience needed. Though I cannot remember on that last one how the 70-99 experience requirements for level up are done. *edit* Ok I remember how the EXP is done so nevermind that last sentence. :)
Sucks I am at work and cannot work on this!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on March 06, 2015, 01:54:42 PM
The current version of my User Options patch makes use of some normally unused character stat byte... like 2043,x or something.
Well, that'd do it. I wonder how many hacks use the same unused stat byte. Are unused RAM areas known, assuming there are any?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 06, 2015, 03:37:49 PM
There's a huge block... I wanna say 7E4800-7E7000 (that's far from exact) that as far as I know is completely unused. But I haven't watched it through the whole game, so I cannot confirm.
I'm not aware of any FFIV hacking projects before my own that actually make use of unused stat bytes (but I don't have the "historian" cred that, say, Grimoire has, so I could be mistaken). It should be noted that those bytes only exist during battle. The out of battle character record is only 0x40 bytes long and all are used.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: avalanche on March 06, 2015, 07:52:34 PM
I feel like I have heard mention of using unused char/monster record bytes a few times from you and/or Grimoire, though I could be wrong. But perhaps one could use that area for quite a lot of additional battle-only values per slot if one was to run out of space in the $80-long areas.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 06, 2015, 10:08:29 PM
That's a good point - all of those battle-only things could be easily relocated, and could use the same indexing as the normal battle stat locations (separated by 80 bytes per character).
Grimoire and I have certainly talked about using unused stat bytes a bunch before, but to my knowledge, only User Options (for the ATB percentage) and my long-term project (for the limit breaks) actually do it.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on March 06, 2015, 10:15:07 PM
My Protect/Shell Status Mod also uses one unused stat byte. (x74) since I never saw any part of it being used.
We don't often use those unused bytes in our routines as we don't often need to. They do make good spaces for new status spots though.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on March 06, 2015, 10:35:19 PM
My Protect/Shell Status Mod also uses one unused stat byte. (x74) since I never saw any part of it being used.
We don't often use those unused bytes in our routines as we don't often need to. They do make good spaces for new status spots though.
Aha. I stand corrected. :)
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on May 02, 2015, 07:54:51 AM
I got to thinking this morning (ut-oh...): what about "true" confusion for monsters?
Why do we have all of these AI scripts wasted on what a monster should do if it's confused? Why not just have them do what player characters do - pick an action and a target at random?
Shouldn't be too hard to do... I've seen where enemy battle scripts are loaded into RAM. It would take a bit of a routine to make the game find the right set of possible commands, but it certainly wouldn't be impossible. From there, do an RNG to pick a byte within the monster's designated script area. Make sure it's less than E8 (otherwise generate a new random number), make sure it's preceded by a byte FB or higher (to be sure it's not the parameter to a targeting byte, or whatever - otherwise, as before, generate a new RN), "flip a coin" to determine ally target or enemy target, RNG to determine target(s) within that group, and... GO!
As far as game mechanics hacks I've done, the difficulty level is mid-range at worst, and the benefits to AI editing and gameplay experience would be fantastic!
I'm back to work today after my week off, but this'll be my next little distraction...
I'll do my best to assure it plays nice with my other hacks (because, you know... me).
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Pinkpuff on May 02, 2015, 11:13:31 AM
What if it randomly picks something nonsensical like "Show message 54" or "Set weakness to Ice"? Or would it always look for something that's a spell/technique or command?
My bad, I didn't read your post thoroughly enough the first time ^_^
But even so, there are some monster techniques that are used for battle control purposes, things like "Suicide, bring in next monster", "Something happens to Adult Rydia" and such... what about those? Also there are some monsters that rely heavily on reactions and don't really do much on their own turns; would it look at reaction scripts too?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on May 02, 2015, 01:55:46 PM
Well, if there are monsters you really don't want to be confusable for fear of what they might do, status immunity would still be an option.
Regarding whether reaction abilities would be included... I don't know. At this point, this is still in the theoretical phase. As I said, I have seen the place in RAM where the game stores AI scripts, but I haven't examined them fully yet. The way I see it, there are two possibilities for how the scripts are arranged: 1) all of a monster's scripts, including reaction scripts, are grouped together by monster Or 2) scripts are organized first by type (normal, then reaction), and then by monster If it's possibility 1, then easy-peasy. If it's 2, then not so much.
So... I'll keep you posted as things progress.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Pinkpuff on May 03, 2015, 06:00:47 AM
One option would be to have a charmed monster always target a random monster, Fight. Admittedly, it wouldn't be as interesting, but it would be simpler to implement and you wouldn't have to worry about anything going wonkee.
Another option might be to just have it leave the scripts themselves alone but just switch up the targeting. So, if a monster is charmed, then whenever it would target an ally with something, it instead targets an enemy with it. Whenever it would target an enemy with something, it instead targets an ally with it. This option would probably also have issues with the "control code" type techniques (though, if you have it leave "self/none" targeting alone it might mitigate it somewhat, or as you suggest, just make those monsters immune to charm) but it might make for some interesting plays regarding the timing of the charm or the interactions with the monster's reactions. For example, charm a Behemoth let's say, then Holy or Meteo it. It's magic damage so it's still charmed, so it reacts by targeting all monsters (instead of all characters) and casting Storm. Yippee!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on May 03, 2015, 09:34:21 AM
I just realized something... You're thinking about the status as "charmed," and I'm thinking about it as "confused." In later FF games, they are disparate, but in FFIV they are treated as one and the same.
Generally, when cast on the party, the visuals suggest charm... I'm thinking about the technique used by Lamia-types where the heart floats toward the character, then the character literally faces the opposite way and starts fighting for the enemy. What few visuals we have for the status as cast on monsters suggests confusion more - with the little bird flying in a circle. However, the spell is called "Charm," and the default FFIV effect on monsters suggests charm more than confusion. The thing is, I like the idea of confusion more than charm. Erratic behavior by the confused fighter lends itself to the potential for extended status effects - if the chosen action is fight, then there's only a 50% chance that the fighter's own side is targeted, then of course the chance that self still isn't the target. Furthermore, there's a possible downside for the caster to confusion - if a monster casts a full cure on one ally under certain circumstances, there exists the possibility it might full-cure its whole party, just as there exists the possibility a confused Behemoth might Storm your party at any moment unprovoked. Charm status - simply flipping the "enemy" and "ally" bytes - would always benefit the caster greatly (pending success), since un-charmed monsters can't choose to whack their ally out of it, and the potential to abuse the system as in your behemoth example. That being said, what you're suggesting (option 2, I mean, option 1 really would provide no gameplay benefits) would definitely be far easier to assemble...
Targeting bytes are bitwise, BTW, so the first monster in the battle - the one whose stats are stored at 7E2280 - is always "80," even if it's that monster acting. Whereas 00 works as "target self" for the party, I'm not positive it works that way for monsters. I struggle to think of any monster techniques that have a necessary self target (like "Hide").
I don't know, I guess I'll have to think about it a bit before I finalize the plan...
Anyone else reading this who might want to chime in thoughts and opinions?
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on May 03, 2015, 07:25:27 PM
I just realized something... You're thinking about the status as "charmed," and I'm thinking about it as "confused." In later FF games, they are disparate, but in FFIV they are treated as one and the same.
Generally, when cast on the party, the visuals suggest charm... I'm thinking about the technique used by Lamia-types where the heart floats toward the character, then the character literally faces the opposite way and starts fighting for the enemy. What few visuals we have for the status as cast on monsters suggests confusion more - with the little bird flying in a circle. However, the spell is called "Charm," and the default FFIV effect on monsters suggests charm more than confusion. The thing is, I like the idea of confusion more than charm. Erratic behavior by the confused fighter lends itself to the potential for extended status effects - if the chosen action is fight, then there's only a 50% chance that the fighter's own side is targeted, then of course the chance that self still isn't the target. Furthermore, there's a possible downside for the caster to confusion - if a monster casts a full cure on one ally under certain circumstances, there exists the possibility it might full-cure its whole party, just as there exists the possibility a confused Behemoth might Storm your party at any moment unprovoked. Charm status - simply flipping the "enemy" and "ally" bytes - would always benefit the caster greatly (pending success), since un-charmed monsters can't choose to whack their ally out of it, and the potential to abuse the system as in your behemoth example. That being said, what you're suggesting (option 2, I mean, option 1 really would provide no gameplay benefits) would definitely be far easier to assemble...
Targeting bytes are bitwise, BTW, so the first monster in the battle - the one whose stats are stored at 7E2280 - is always "80," even if it's that monster acting. Whereas 00 works as "target self" for the party, I'm not positive it works that way for monsters. I struggle to think of any monster techniques that have a necessary self target (like "Hide").
I don't know, I guess I'll have to think about it a bit before I finalize the plan...
Anyone else reading this who might want to chime in thoughts and opinions?
It is ironic. FF1's Confusion works exactly as you described. The afflicted will choose to attack an enemy or itself. FFII is the first game to have it be closer to FFIV's Charm status, except there's something interesting here. FFII's Confusion status on allies will only have them attack allies. What's even more humorous about this is that Confusion is not removed by attacking an ally... meaning there is no reason ever to attack an ally in FFII, yet this oversight causes one of the biggest gamebreaking bugs for the game. Ironic.
But monsters are even more interesting. You'd expect older technology would just let them attack allies with physical attacks, right? Since it works that way for players? Well that's not true here. They can use one of their spells from their random AI pattern on their own side. Another irony.
FFV and VI seems to take this model...
Again FFIV is the odd one out wasting Tons of space with these "If Confused..." scripts. which, while entertaining at times, doesn't seem reasonable in a game where we're struggling for space as is. My Random AI routine hack will get around this by just having one or two AI scripts devoted to "If confused - normally attack allies" "If confused - Use Random AI routine on allies".
Ironically FFV and VI do just this for their enemies Confused Status, a special list of commands that the player can gain access to with Manipulate.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on May 03, 2015, 09:13:46 PM
Well, I've been reinvigorated to work on TfW after your and ZERO's playthroughs, and once I get through the bug fixing and finishing the training room, I'm kind of excited about what comes next (a battle, not the next chapter... The next chapter is actually gonna be kind of a nightmare because of the breadth of locations). So maybe I'll mull things over and keep this idea on the back burner until I really need another side project...
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: Grimoire LD on May 03, 2015, 09:24:21 PM
Oh yes, especially considering Confusion is such a small part of the game. If you have bigger fish you want to fry than I would say that's for the best. After all what was meant to be a short side-project kind of ended up supplanting Combat Boost's original version and now I am trying to think of ways to align the new ideas with what I've already accomplished or if to just release that as the new Combat Boost.
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on May 03, 2015, 10:13:23 PM
Yeah, I've been lucky enough that, with the exception of the Shadow Hack, everything I've done has been something that I've been able to work into my Big Project. It's nice that it works as the unifying force for all (most) of my hacking endeavors, but the little side things also help me keep my sanity. Writing an entire town's dialogue, and setting all the monsters in a dungeon is wicked tedious work!
Title: Re: Chillyfeez's Mods, hacks, research notes, etc.
Post by: chillyfeez on April 10, 2016, 01:55:05 PM
I just finished putting a new little function into TfW that I thought others might be interested in for their own projects at some point. This is kind of a "User Options" sort of mod. This allows you to scroll through all of the available (individual) targets in battle by pressing Y. I developed this because I am working on a boss battle that involves seven different "Special" size monsters, which are scattered all over the screen. Since there isn't a natural formation that accommodates this particular arrangement of monsters, it's kind of hard sometimes to target a specific monster on the field. So I devised this mod so that the player can simply hit Y to scroll through available targets. Each Y press moves the target selection up by 1, instead of relying on using the D-Pad to move the cursor to where the game thinks the next monster should be. I was thinking this might come in handy for any battle that has a large number of monsters, but especially for a situation like mine.
If you want to use this assembly, by the way, bear in mind that for my purposes I used some free space realized by creating a new (shorter than what it was replacing) song. So inserting the bulk of this assembly where I did will likely cause problems, but you shouldn't have too hard a time finding a place to absorb the 53 bytes in question.
$02/B086 20 FC FF JSR $FFFC [$02:FFFC] ;Normally this says "JSR $AE27" which is the routine that looks for D-Pad input
$02/FFFC 5C BD 80 08 JMP $0880BD[$08:80BD] ;Jump to custom assembly. NOTE: BY DEFAULT THERE IS MUSIC DATA AT 880BD. I have a custom song there, so this is empty space for me, but you shouldn't have too hard a time finding 53 free bytes somewhere, and as this is a long jump, it can be anywhere at all.
$08/80BD A5 38 LDA $38 [$00:0038] ;Load "Controller Input 2" (up/down/left/right/select/start/Y/B) $08/80BF 85 1C STA $1C [$00:001C] ;Store into 1C (probably not needed as a matter of fact) $08/80C1 C9 40 CMP #$40 ;Compare with 40 (Y pressed without any other buttons) $08/80C3 F0 04 BEQ $04 [$80C9] ;If Y is being pressed (by itself) then skip the next op $08/80C5 5C 27 AE 02 JMP $02AE27[$02:AE27] ;Jump to regular D-Pad input routine $08/80C9 AD 8D EF LDA $EF8D [$7E:EF8D] ;Load currently highlighted target (which can be 00-07 for monsters, 08-0C for characters, FF for all monsters or 0D for all characters) $08/80CC 1A INC A ;Increase value by 1 $08/80CD C9 0D CMP #$0D ;Is the adjusted value 0D? $08/80CF 90 01 BCC $01 [$80D2] ;If less than 0D, skip the next op $08/80D1 7B TDC ;Transfer direct page (essentially, load 00 into A) $08/80D2 8D 8D EF STA $EF8D [$7E:EF8D] ;store new value into Current Target $08/80D5 C9 08 CMP #$08 ;Is the value 08 or higher? $08/80D7 90 0F BCC $0F [$80E8] ;If not, skip to 80E8 $08/80D9 38 SEC $08/80DA E9 08 SBC #$08 ;Subtract 8 $08/80DC AA TAX ;Transfer A to X $08/80DD BD C5 29 LDA $29C5,x[$7E:29C5] $08/80E0 C9 FF CMP #$FF ;Is there a targetable character in that slot? $08/80E2 F0 E5 BEQ $E5 [$80C9] ;If not, jump back up to the beginning of the routine to try again $08/80E4 5C F1 AE 02 JMP $02AEF1[$02:AEF1] ;Jump to the end of the D-Pad input routine (RTS) $08/80E8 AA TAX ;Transfer A to X $08/80E9 BD 23 F1 LDA $F123,x[$7E:F123] $08/80EC C9 FF CMP #$FF ;Is there a targetable monster in that slot? $08/80EE F0 D9 BEQ $D9 [$80C9] ;If not, jump back up to the beginning of the routine to try again $08/80F0 80 F2 BRA $F2 [$80E4] ;Jump to the end of the D-Pad input routine (RTS)
And then there's this, which makes pressing the Y button make a sound (cuz it seemed weird for it to do something but not make noise)
$02/B90C 29 4F AND #$4F ;Normally, this says "AND #$0F" thus only making a sound for a D-Pad button, this change makes it so Y returns true as well Enjoy!