Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Jiggers on July 27, 2019, 11:14:56 am

Title: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on July 27, 2019, 11:14:56 am
Based off the work originally done by CaptainMuscles - https://www.romhacking.net/hacks/1769/

And another thanks to Disch for his disassembly work that makes doing these things both fun and fast!

Edit: Several bugs fixed since the original post!

This link is to a Google Drive folder. In the folder are 6 files:
* 2 versions of Bank C.asm for use with Disch's Disassembly
* A stand-alone Dynamic Action ReJiggered patch, one with normal enemy regen, one with bonus enemy regen
* A version of the Dynamic Action ReJiggered patch to be merged with FF Restored, one with normal enemy regen, one with bonus enemy regen - note that due to overlapping edits, these two take out FF Restored's ability to have enemy damaged by the poison ailment. If you tweak spells in your own rom to inflict the poison ailment on enemies, it will have no effect, like in the original game. These two are addendums to FF Restored! Patch Restored in first, then one of these.

https://drive.google.com/open?id=14CImXsgmcxyqwl87ClSNJOZITlQxKxdQ

The aim of this was to fix the bugs and quirks of the original. I've done a bit of testing so far to catch those game-freezing bugs and other anomalies, but some weird things might have slipped through.

Running needs to be stress-tested, due to the triple RTS I had to put in. On some turns, a successful run would say "Close call" then continue the battle, while others would actually run from it. I've confirmed this is due to the original double RTS skipping back to the @NextTurn part of DoBattleRound, as the same issue was found when defeating all enemies--the battle would just continue on. But it only did this half the time, so a triple RTS might end up being just as bad in some cases?



Gameplay Effects:
Enemy roster and command menu only opens up when a character can act.
Character does not step back until they perform an action.
Pressing B while choosing a command will only reset the cursor, nothing else.
Player poison effect happens at the end of their action, instead of all poisoned players getting damaged at the end of the battle round.
Enemy regeneration effect happens at the end of their action, instead of all regenerating enemies regenerating at the end of a battle round.
If a character is muted, trying to pick an action other than Fight or Run will result in a brief "Silenced" message popping up.

Code notes:
I've done my best to make sure the original game's addresses are intact, with the most notable exception being "InputCharacterBattleCommand", where I put the NOPs above it rather than below, so that the space might be used without interrupting the flow into "Battle_MainMenu_APressed"--and since the routine above it needed to be extended by 2 bytes anyway.
Stepping back has been added to the Running Attempt routine, and some useless code has been NOP'd out to make room for that, as well as a triple RTS to fix a bug I made.
Enemy regeneration has been shortened to not loop through all enemies.1
BacktrackBattleCommand has been almost entirely replaced by a check to see if a character is muted. Battle_MainMenu_APressed has been given a JSR to this check, moving the first half of it it upward 3 bytes.
Just about the entirety of UndoCharacterBattleCommand has been replaced with more robust Turn taking routines:

For Players:
* A check has been added to make sure a player is alive (not stoned or dead) before even drawing commands for their turn.
* If alive, draw roster box, command box, get input, and perform their action.
* Check if the battle is over - does a double RTS out of the PlayerTurn routine, so requires another check to double RTS out of the BattleRound routine.
* If not over, apply poison.
* Update character HP and status.
* Return and check again if the battle is over.

For Enemies:
* Do their turn as normal
* Update character HP and status
* Check if the battle is over (player died or enemy died of confusion) (this was causing a bug and is not needed)
* Apply regeneration to enemy
* Return and check again if the battle is over.


1On Enemy Regeneration:

First, does Enemy regeneration still work? I haven't tested it without the loop code.

Second, regenerative enemies gain 3 HP per turn. They include Catman, Troll, Seatroll, Phantom, Vampire, WzVamp, WzOgre, WrWolf, WarMech. By the time you encounter them, 3 HP is laughable (with maybe the exception of the WrWolf.)

I've included a second patch that allows all regenerative enemies to regain their 3 HP after every enemy action. So a WrWolf with a backup of 5 wolves would gain 18 HP per round.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Vanya on July 31, 2019, 12:02:30 pm
I would test this right now if I had any idea how to patch ROMS on my phone.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: KingMike on July 31, 2019, 12:58:17 pm
Can you patch on a PC and transfer to the phone?
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Vanya on August 12, 2019, 01:23:06 pm
Sorry for the late reply.
I couldn't at the time cause my pc imploded.
I just got a new windows disk on Friday, so I'll be able to get back up and running in the next couple of days.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: lexluthermiester on August 13, 2019, 11:42:28 pm
Can you patch on a PC and transfer to the phone?
Can't think of any reason why not.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: redmagejoe on August 14, 2019, 06:07:31 am
This is a great patch. This coupled with Final Fantasy Restored really breathes new life into the classic iteration of the game. This addresses my only issue with the original game even after all the bug fixes and polishing patches: Ineffective attacks.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Googie on August 14, 2019, 07:28:12 pm
Thanks for doing this, Jiggers! I'm gonna patch this over Final Fantasy Restored like redmagejoe did, this is gonna be cool...  :D
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: redmagejoe on August 15, 2019, 04:57:39 am
Still some bugs that need to be ironed out. I can't tell you precisely how it happened, but half my party being poisoned was involved. My two poisoned allies died, leaving only the 3rd and 4th slot ones alive. They ended up getting wiped while trying to auto-attack their way out of a group of 5, and when they wiped, I jarringly got the victory music, "Monsters perished" message, and " P" of exp and I think the normal amount of Gil. I went back to the world map with a fully dead party, and when I next got into a battle, the game crashed.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 15, 2019, 02:39:40 pm
Ooh, thanks for finding that! The good news is I was able to re-create it, too. Dying of poison works ok, but having an enemy kill you seems to do it... Gonna test a few more scenarios and then figure out where its going wrong. Will edit this post with an update if I can fix it in the next hour or so!

Edit: Found it. While I have it checking for the end of battle after the enemy's turn but before applying regeneration... it increments the battle win toggle by 1 (player lost)... then regenerates the enemy, and checks again... incrementing it to 2 (player won). :P Will upload the fix once I figure out the best way to do it. I suppose it doesn't need to check for battle end before doing regeneration...

Edit 2: Links in the first post updated!

To edit the bank_C,asm file yourself, just look for "TakeTurnEnemy:", cut out the "JSR BattleTurnEnd_CheckForBattleEnd", and add 3 more NOPs below it.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: redmagejoe on August 15, 2019, 11:29:17 pm
Is it safe to apply this over my current version with no incompatibilities (layer it on top of the previous bugged-patched version) or were the changes significant enough that I should repatch from scratch?
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 16, 2019, 01:26:11 am
I have very little idea how .ips patches work on things already patched! I have very little idea how they work in general.

If its going to see the 11 bytes that were changed and fix them to be like the new version and not mess with anything else, then, yeah, it should be safe! Probably!
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on August 17, 2019, 07:51:40 am
I just applied this hack after seeing those kinks having been worked out. I love it! Great work so far.

It would be really amazing to be able to play FF3 NES this way as well. Have you given it any thought?
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 17, 2019, 02:25:04 pm
Nope! I'd love to, now that I have given it some thought... But it would require someone else to work on a disassembly a bit. I don't think I'd need it as thorough as Disch's FF1 is, but it would need to be in a way I can understand and tinker with easily. Just getting the one bank where the main battle code is should be enough, if all the necessary parts are in one bank...

I've only been able to do work on FF1 because of such a well-documented breakdown of what everything in its code does, and 2 years of absorbing it into my dreams. So even with a fresh disassembly of FF3's battle code, it would take me a few weeks to really understand what its doing and what needs changing. I'd be willing to try it, but getting the hex into ASM format just frustrates me; I've tried several different programs already.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: redmagejoe on August 19, 2019, 06:36:23 pm
FF1 and FF2 definitely benefit from this, though I'm not sure it's really "necessary" for 3. I'm pretty sure 3 was the first game to do away with "Ineffective" because your characters re-acquire targets as became the norm for the series from that point on. Not that there's anything wrong with working on it for its own sake, but I'm not sure the impetus for it is as strong as FF1 and FF2.

Regardless, do what you gonna do! :thumbsup:
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: daman.tm on August 21, 2019, 05:53:46 am
I've used the dynamic action patches on a clean FF1 rom and afterwards I patched the FF Restored hack.
Haven't noticed any problems yet, but can't say I've tested much.

Great work Jiggers!
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Bregalad on August 21, 2019, 06:09:22 am
FF1 and FF2 definitely benefit from this, though I'm not sure it's really "necessary" for 3. I'm pretty sure 3 was the first game to do away with "Ineffective" because your characters re-acquire targets as became the norm for the series from that point on. Not that there's anything wrong with working on it for its own sake, but I'm not sure the impetus for it is as strong as FF1 and FF2.

Regardless, do what you gonna do! :thumbsup:
FF3 is as far as I know the only game in the entiere series where the battles are round-based, but where the characters redirects attacks. From FF4 until FF9 the active-time-battle system is activated, so that it can be possible to target an ennemy who is going to be dead when the character actually attacks it, but the likelyhood is much lower, and that happens only if the player deliberatedly enter his orders at a faster rate than the animation plays on-screen.

In Squaresoft's game library, as far I know only the Romancing SaGa series continues to be round-based and re-targets ennemies automatically, like FF3.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 21, 2019, 03:29:44 pm
Hey! I submitted it to the queue! I went with Improvement instead of Addendum, because I don't know if it will work patched over the original Dynamic Action Patch on the site...

Thanks to everyone having fun with it so far!
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Cyneprepou4uk on August 21, 2019, 06:19:31 pm
I don't get it, what's that double or tripple or whatever rts means? Are you writting 3 rts in a row and hope it will fix something or what?
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 21, 2019, 08:03:54 pm
I can try to explain that better. Lesse...

RTS is when you return from a subroutine. So there's 2 bytes that act as the return address and get put into the stack. When you DON'T want to return to where the subroutine began, you can pull those bytes off the stack, then the next RTS will return to the previous 2 bytes. Its a way to break out of a loop. Normally when you run in FF1, it breaks out of the battle loop by pulling 2 bytes, then doing an RTS, which Disch calls a double-RTS in his notes. Because I added an extra subroutine when players take a turn, original double-RTS to break out of the battle loop was only breaking out of the player's turn loop. So I have it pull 2 more bytes off the stack, causing it to break out of 2 loops in order to end the battle if running is successful!

So it kind of goes something like this:
Overworld/Dungeon loop > Battle loop > Player Turn loop > Running subroutine: Run fails > return to Player Turn Loop > return to Battle loop > next turn

Overworld/Dungeon loop > Battle loop > Player Turn loop > Running subroutine: Run succeeds > delete return to Player Turn Loop > delete return to Battle loop > Return to Overworld/Dungeon loop

What was confusing was that sometimes, before I added this, the run was successful... meaning that it only needed the original double-RTS to return to the Overworld/Dungeon gameplay... I couldn't get it to do anything weird while running after I added it in, though.

But without it, it would say the run was successful, then the battle would continue.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Cyneprepou4uk on August 22, 2019, 02:41:49 am
Makes sense now
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: daman.tm on August 23, 2019, 02:44:17 pm
I can sadly confirm this patch does not work well with Final Fantasy Restored. Got ambushed by 4 goblins and my character's turns never came up, shut the game off after the goblin's 30th attack in a row.

Or maybe a bug in general? If I find some time I'll try and get ambushed by a bunch of goblins on a clean rom with the rejiggered patch
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 24, 2019, 02:40:31 am
I set up an ambush in my hack alone and didn't run into that bug.

I got IPS Peek and FF Restored to check if there's any overlapping changes. There are some.

(https://cdn.discordapp.com/attachments/535538496547586060/614702987188895755/unknown.png)

The two big blocks are dealing with poison and regeneration. I don't know what Restored is doing with it. In my hack all the EAs are there to remove the code that loops through enemies, so that it only performs the regen/poison on one entity.

Above that might be the problem. It's just a one-byte change, but...

In mine:
LDA #$00
STA btl_strikingfirst

If FF Restored is overwriting just that one byte? It's not setting btl_strikingfirst to 0 after a round, but some other variable - one of the characters' battle stats.

It also changes 000323FF to $82 from $D0. That's part of the "try to run from battle" routine, I don't know what that might mess up.

What order did you patch it in? Like I said before, I don't really know what happens when you put two patches together, but if you put Restored first, then this one, maybe this one will overwrite the changes Restored does? However, even if it does, the poison/regeneration stuff will be messed up, because then my hack will just be scribbling all over the much larger edits Restored did to those routines.

I'd suggest making two patched roms then:
On one rom, patch Restored on first, then this hack.
On the second rom, patch just this hack.

Then edit them both in a hex editor. In the second rom, copy everything from 000321E8 to 00032340 and paste it over that area in the first rom.

That should fix the striking first flag not being set to 0, as well as making sure poison/regen doesn't go wonky.

And then make sure 000323FF is set to $D0 maybe.

Actually, that $82 is important, but its shifted over 5 bytes. 00032404 should be $82 instead of $80, to fix the running bug--

Quote
    ; The problem is... the game is BUGGED and reads the wrong value for the level.. it ends up reading
    ;  the ailment byte for 2 players after this one (for top 2 slots) or other garbage memory for the
    ;  bottom 2 players.

Hope that's not too confusing to try!
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Cyneprepou4uk on August 24, 2019, 04:56:05 am
You could just ask him for a hash of his rom and some save files
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 24, 2019, 02:13:25 pm
Seeing as my last post might be too confusing... I tried doing what I was talking about in it.

https://drive.google.com/open?id=1-g3-sAyVGUrX_LIlaEGs8jM6jYjtEvYl - FF Restored + Dynamic Action ReJiggered

https://drive.google.com/open?id=1z424ihlDf-L71bOFQWpu2uew99pkkgLw - FF Restored + Dynamic Action ReJiggered, with Extra Enemy Regeneration

It turns out patching order is important! Doing the Action patch then Restored overwrites some bytes the Action patch needs.

Reading Restored's Read-Me file, it seems the other edits that overlap with the Action patch are just to make poison work on enemies. But without further patching to make spells actually afflict poison ailments on enemies, this seems pointless...?

I did some quick testing - not with poisoned or regenerative enemies, or poisoned players! - and got into a battle where the goblins had first turn. After all 3 took their turns, I was allowed to act. So I'm thinking its fixed!
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on August 24, 2019, 07:33:09 pm
This patch has really reignited my FF1 love. I'm using the restored version which was applied before the rejiggered patch and I've had no problems at all.

Forgive me if this is off topic, but I've been fixing the last couple tiny things that bother me with the game and there's one thing I wanted to ask help with since there's a few of technical wizards on this thread. Does anyone know which data in the rom controls the accuracy growth rate for the thief / ninja? Boosting his growth rate from 2 to 3 per level would do a much better job balancing him out for me.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 24, 2019, 07:44:20 pm
Quoting the disassembly...

Quote
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;  lut - Hit rate bonus for each class (assigned at level up)  [$9DDC :: 0x2DDEC]

lut_LvlUpHitRateBonus:
  .BYTE  3,  2,  3,  2,  1,  1,   3,  2,  3,  2,  1,  1
  ;     FT  TH  BB  RM  WM  BM   KN  NJ  MA  RW  WW  BW

Looks like it'd be 0x02DDED!
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on August 24, 2019, 07:57:30 pm
Quoting the disassembly...

Looks like it'd be 0x02DDED!
Perfect! I also incremented 0x02DDF4 for Ninja.

Most people's selling point for the thief/ninja is the run boost but I'm not much of a runner and really struggle with how low his attack output is. Now he should be lower than the fighter/knight due to his strength but he'll finally have some kind of edge on the red mage!

Thank you!
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: redmagejoe on August 24, 2019, 09:58:18 pm
I'm fairly certain I'm using Restored with Rejigger applied as my last patch, and other than the bug I reported earlier, I'm not encountering any issues...
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on August 25, 2019, 09:18:12 am
Ok. I've had a major bug turn up. I took on Astos at a pretty low level and got a total party wipe. When that happened, it played the victory music as if I won and then returned me to the castle of Astos. I could walk around as well as view the status screen where it showed all my characters dead. I then walked out, a battle started, and the game froze.

Now I feel quite foolish for doing several sprite and stat modification tweaks on top of this restored / rejiggered rom instead of doing them separately. :P Back to the drawing board!

**EDIT

Ok, redoing those hacks wasn't bad at all. One more thing I'll say is: it's amazing how much *less* I'm enjoying the game with the old round based battle structure. Getting ineffectives isn't the issue at all tbh. I'm able to predict damage output and remaining enemy HP well enough that I almost never get them. It just feels far less elegant. I really do hope someone can eventually rework FF3 to have this same style of combat. It's such a marvelous game and it simply deserves it. Someone made the comment above that it's unneeded because the game doesn't allow ineffective attacks but removing those is only a small part of the improvement here. The change in mechanics simply makes the game feel far more modern and enjoyable and that would apply every bit as much to FF3. I suppose the same could be said about FF2, but until someone actually fixes the whole progression system in that game I'll continue to pretend it doesn't exist.  :laugh:
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 25, 2019, 04:05:12 pm
Oh, yeah, that bug got fixed. I just found out about another bug when using level 5-8 spells (or even viewing the second spell box and pressing B) that will crash the game. I will try to get a fix out soon and update the links on the first post again.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Disch on August 25, 2019, 04:25:59 pm
Jiggers:

That bug is in the dynamic action patch.  I found a fix for it a while back:

http://www.romhacking.net/forum/index.php?topic=22591.0
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: redmagejoe on August 25, 2019, 10:00:10 pm
Keep us posted Jigger. I've made a few changes to my version of Final Fantasy Restored in FFHackster (like reverting the peninsula of power removal and the 4000 Mythril Sword to 1500 Long Sword in the ElfLand shop), so I'd rather not have to repatch, but I might. If you have a version that you think makes Final Fantasy Restored and your patch play nicely without bugs, I hope you'll add that alongside your standalone patch in the first post! :thumbsup:
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 27, 2019, 03:36:56 am
Jiggers:

That bug is in the dynamic action patch.  I found a fix for it a while back:

http://www.romhacking.net/forum/index.php?topic=22591.0

XD The very thread that alerted me to the bug's continued existence. Actually squashed it for someone else's hack and forgot to do it in this one 'til now. Wish I saw that thread then, would have saved me an afternoon.

Keep us posted Jigger. I've made a few changes to my version of Final Fantasy Restored in FFHackster (like reverting the peninsula of power removal and the 4000 Mythril Sword to 1500 Long Sword in the ElfLand shop), so I'd rather not have to repatch, but I might. If you have a version that you think makes Final Fantasy Restored and your patch play nicely without bugs, I hope you'll add that alongside your standalone patch in the first post! :thumbsup:

Yep, it is done. The link is a folder with all the patches and the edited .asm files I used to make it.

https://drive.google.com/open?id=14CImXsgmcxyqwl87ClSNJOZITlQxKxdQ - here it is again!

If you don't want to re-patch, you can just apply the Dynamic Action ReJiggered one to your edited rom and a second, fresh original FF rom, then use a hex editor to copy 000321E8 to 00032340 from the fresh rom to your edited rom, and then finally set 00032404 to $82 instead of $80. Heck if you bother with all that, you might as well not apply the new patch over your edited rom and just copy 00031418 to 000314DE from a fresh patched rom to your edited rom! In fact, why bother patching a fresh rom; just put this in at that address.

Code: [Select]
0C C9 5A 90 10 A9 22 CE AE 6B 4C 1A 94 A9 23 EE AE 6B 20 07 AA 4C 51 94 48 AD AE 6B C9 01 F0 1D 20 A4 BB 20 0C 98 A0 1C A9 00 8D 8C 6C 99 8E 68 88 D0 FA 68 48 4C 78 94 A9 02 20 0F F2 68 85 88 0A 0A A8 A9 00 8D F8 6A 60 20 69 A1 20 3B 93 4C 51 94 F0 10 48 AD 7A 6B 20 EB B5 A0 01 B1 92 29 40 D0 02 68 60 A9 03 20 F2 B0 68 68 68 4C AE 94 8D 7A 6B AD 7A 6B 20 45 A1 A0 01 B1 82 29 33 F0 19 29 03 48 AD 7A 6B 0A 0A A8 68 99 8F 68 4C 45 94 EA EA EA EA EA EA EA EA EA 20 12 F2 20 15 F2 AD 7A 6B 20 01 9E 20 2C 9A C9 02 F0 F9 AD AA 6A 29 01 F0 0B AD 7A 6B 09 80 A8 A9 20 4C 5D 93 AD AB 6A 29 03 0A 20 5A 94
But if you HAVEN'T used the links from a few posts ago already, enemy regeneration/player poison may behave unexpectedly, so definitely go the long way with it, or use the merged patches in the folder.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on August 28, 2019, 02:05:04 pm
Thanks for doing this! It's working great so far.

FYI, do you think it's possible to make your rejiggered patch that works with restored to be actually separate from the restored patch itself so it works more like an addendum to restored? Having your dynamic action code mixed together with a vanilla version of the restored patch alters a lot of minor things when put on top of a customized restored rom. Keep in mind that restored itself comes with lots of optional patches that become undone by your patch.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 28, 2019, 02:56:17 pm
I don't know... I'm getting pretty worn out now, for one... You're welcome, though! :D

What minor things are changed? And what do you mean by a customized restored rom? I don't think any of the optional patches in Restored's Settings folder conflict with the bits I changed...

All I know about is that enemies won't be hurt by poison. Which is something I can't undo because of the way patches work, I think. All I did was remove the part of the code that loops through enemies, leaving the original regeneration intact. If the bytes aren't changed, it won't overwrite the changes Restored does to the enemy regeneration/poison code, leaving it just a mess that might crash the game. So my combined patch pulls that part of Restored out.

Sorry if I just make things more confusing!

Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on August 28, 2019, 05:49:23 pm
I don't know... I'm getting pretty worn out now, for one... You're welcome, though! :D

What minor things are changed? And what do you mean by a customized restored rom? I don't think any of the optional patches in Restored's Settings folder conflict with the bits I changed...

All I know about is that enemies won't be hurt by poison. Which is something I can't undo because of the way patches work, I think. All I did was remove the part of the code that loops through enemies, leaving the original regeneration intact. If the bytes aren't changed, it won't overwrite the changes Restored does to the enemy regeneration/poison code, leaving it just a mess that might crash the game. So my combined patch pulls that part of Restored out.

Sorry if I just make things more confusing!
Ok, so from your link I downloaded the patch FF1 Restored - Rejiggered. I assumed that all that patch would do is apply the dynamic action on top of my customized restored file. What it actually did in addition to the dynamic action is eliminate a few of my custom restored settings. For instance, the ship minigame was put back in and the extra music was removed. It also applied sprite graphic changes implemented by restored (swapping US sprites for Japan sprites) and overwrote custom sprite fixes that I had done (which were published today as a restored addendum patch). If all your restored rejiggered patch did was apply dynamic action in a way that's compatible with restored instead of altering other things, that would be a lot more convenient. I did work around the issue by reapplying my custom setting patches and my own rebalance and graphical touch-up patches after applying your patch but it would have been a lot more convenient had I not had to. I'm sure a lot of users are like me in the sense that they already have a custom restored rom that they wouldn't want to mess up by applying your patch.

I feel like the fix for you is pretty easy. Just take your restored rom with rejiggered and create a patch using an identical (all settings the same) restored rom *without* rejiggered as the unmodified base rom. That should produce a patch that will add dynamic action to a restored rom and won't alter anything else.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 28, 2019, 07:34:45 pm
Ohhh... okay, yeah, I see!

I need to do this with CaptainMuscle's original patch so I can submit it as an addendum as well... But when I tried that it didn't work. When I have time to play around with patching stuff again I'll give it a try.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Cyneprepou4uk on August 29, 2019, 12:14:47 pm
Just to verify - when you add/delete some code in your asm file, does all code below get shifted down/up? If yes, how are you going to achieve compability between your patches?
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on August 31, 2019, 04:56:29 am
Sorry for being a little off topic but after two consecutive playthroughs of FF1 Restored, the thing I'd most love to see someone add to this game:

The ability to cast Raise or Arise in battle and have it actually work!

And one more thing, It's a real shame Restored never actually "restored" Chaos's hexagon room floor pattern that the cutting room floor website displays. I'd also be very curious what kinds of enemies you would encounter there in the Japanese version before encounters were dummied out.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on August 31, 2019, 10:13:07 pm
Just to verify - when you add/delete some code in your asm file, does all code below get shifted down/up? If yes, how are you going to achieve compability between your patches?

It does get moved, but then I put in NOP instructions, which keep the rest of the code in place. When the game reads them it does nothing, treating them as empty space basically. I used a hex compare program to make sure the compiled rom matched the original outside of the areas I edited.

Sorry for being a little off topic but after two consecutive playthroughs of FF1 Restored, the thing I'd most love to see someone add to this game:

The ability to cast Raise or Arise in battle and have it actually work!

Aw man. That would be so simple for me to do, but FF Restored does a lot of changes around the same area I'd have to edit, so I can't, since I don't know what I'd be changing anymore. Not unless I spend a bunch of time disassembling that as well... Which I just don't wanna do. >.< Sorry!

I have updated the two +Restored patches in my google drive folder, to work as addendums. I hope I did it right; I'm about to test it now and see if its broken. If I don't edit saying "woops" a few minutes from this post, assume its good?

Edit: No "woops" here for me. I only tested one of the two variants, but it seems to work fine. Hurray?
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on September 02, 2019, 06:12:58 pm
Awesome. Anything else you have in mind or are you going to submit the patches at this point?
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on September 04, 2019, 04:02:02 am
Mostly waiting for a day where I feel energized enough to make the addendum patch on the original, and re-write bits of the readme to explain that it needs to be patched on top of that one, then re-figure out how all the other submission rules work...

But meanwhile, has anyone tried to use an item that casts a spell on the character using it? Like, the White T shirt does RUSE, I think? I'd like to confirm that the message says its casting on the character and not an enemy.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on September 22, 2019, 11:23:52 pm
I'm going through the game yet again and will tell you when I get the white shirt.

Speaking of spell items, something that has annoyed me absolutely forever: the fact that the color of the spell effect when using an item is always the color of the last spell that character had cast. Would it take much asm to have each spell item create an effect of the equivalent color if you had cast that spell? I know what they all do after what... 50+ playthroughs (I have a problem, don't I?) But I imagine this has to be annoying for a new player, trying to figure out what element an attack spell is when the colors are constantly changing. Definitely seems more like a bug than a legitimate design choice to me.
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Jiggers on September 22, 2019, 11:55:09 pm
I also noticed there's no code to set the colour of an enemy's confusion attack. It will use the colour of the last spell/weapon used.

I can look into making a stand-alone patch for both things...

Gosh I hope I don't get carried away again. I kinda want to make it display the name of the spell the weapon/armour item is casting, too...



So--I'm not gonna make a bunch of patches for things... but I like pointing out ways to do things, so I did this.

In the disassembly, Bank C, look for "BattleSubMenu_Item:", and at the end...

Code: [Select]
  @GetSpellCast:
    STA $88                     ; store pointer to wep/armor data in $88,89
    STX $89
    LDY #$03                    ; Y=3 to index, since byte 3 in both wep/armor data is the "spell cast" entry
    LDA ($88), Y                ; get spell cast
   
    TAX                             ; put it in X
    DEX                             ; DEX to make it 0-based (FF becomes "no spell")
;    LDY btlcmd_curchar              ; Y=cur char -- default to targetting yourself

    JSR SetItemCastSpellPalette     ; <-- insert this in place of LDY btlcm_curchar
    LDA #$10
    JMP SetCharacterBattleCommand

And then, somewhere that fits...

Code: [Select]
   
SetItemCastSpellPalette:
    TXA                             ; bring spell ID back from X
    PHA                             ; back it up
    JSR GetPointerToMagicData
    STA $80                         ; $80,81 points to this spell's data
    STX $81
   
    LDY #$06                        ; 06 = spell's palette
    LDA ($80), Y                    ; get the palette and put it in X
    TAX
   
    LDA btlcmd_curchar              ; get current character to act
    ASL A                           ; double the ID and put in Y
    TAY
    TXA                             ; bring the spell palette from X
    STA btlcmd_magicgfx+1, Y        ; save it here--when walking forward, the variable palette will be updated to this
    PLA                             ; bring back the spell ID
    TAX                             ; put it in X
    LDY btlcm_curchar               ; Y=cur char -- default to targetting yourself
    RTS
   
This is like... 29 bytes. Its hard to find that much uninterrupted space when you want to use other patches alongside... FF Restored seems really popular. Wish I had time to disassemble that so I could make all kinds of battle system changes that support that patch. Then just shove code around willy-nilly and re-assemble Bank C. %50 of the time I end up with more free space to keep playing around with, too!
Title: Re: FF1 Dynamic Action Patch Re-Jiggered
Post by: Chicken Knife on September 24, 2019, 04:55:17 pm
Thanks for looking at this! Would be so cool to plug it in to Restored but certainly not worth a separate disassembly. As far as why Restored is so popular, it has a lot of little aesthetic touches here and there but the reason I at least pretty much play it exclusively is for the bug fixes. I'm the type that wants something close to the original game, doesn't need a lot of modern conveniences, and just wants everything to work the way it's supposed to work. Restored scratches that itch, but it would be nice to at one point down the road have a bug fix compilation that's separate from Restored so that other projects can enjoy the benefit of a fully working game while going their own direction with other various elements. That being said, Restored has sort of functioned as that base but I can see purists rejecting some of the things it did.