Author Topic: New patch: Caravaggio Bug fix  (Read 468 times)

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 624
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
New patch: Caravaggio Bug fix
« on: April 20, 2017, 01:06:06 PM »
Hi! This bug was reported to me by Gi Nattak: it is possible to cast Roulette via the Rage and Sketch commands (e.g. Veteran), but casting it this way means that only the enemies are valid targets, and instead of giving you the finger it just picks a target. This patch puts Roulette, as cast via Sketch or Rage, more in line with the actual spell by making it mimic the enemy version of the spell, which adds a rotating finger as part of the casting animation (in contrast with the Lore, which has it as part of the selection of the spell itself).

A few things to note: I wasn't entirely sure at first that this really qualified as a bug, but what had me convinced was that only enemies are valid targets. Also, I was careful to ensure that there was no loss of compatibility with Mimic.

:edit: September 25, 2017
Thanks to Assassin for pointing out the minor bug that made it possible for Gogo to Mimic the wrong command. This has now been fixed.

:edit: November 2, 2017
Found a much more major bug: a neglected JMP within the Control code into the edited Sketch command. It makes weird things happen when the game tries to execute a command from the enemy's menu. I have now corrected this.
« Last Edit: November 02, 2017, 03:41:33 AM by 13375K31C43R »
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

Chronosplit

  • Guard Leader
  • *
  • Posts: 44
    • View Profile
Re: New patch: Caravaggio Bug fix
« Reply #1 on: April 20, 2017, 02:07:47 PM »
Nice catch.  I always thought Roulette was weird in a rage, but I used it so little through it that it never occurred to me that it would be a bug.

Quote
instead of giving you the finger it just picks a target
Petition to name this patch Rude Roulette or something similar.
« Last Edit: April 20, 2017, 02:24:37 PM by Chronosplit »

assassin

  • Bane of Retards
  • *
  • Posts: 1,020
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Caravaggio Bug fix
« Reply #2 on: August 18, 2017, 09:18:49 AM »
when Mimicking Sketch, Gogo is supposed to Sketch the original enemy, unless it's been killed or Hidden/etc.

that won't necessarily be the case with Roulette now.  i believe the problem stems at least partially from you assigning FFh to $3415.

abridged description of variable:
Code: [Select]
C21540: STZ $3415  ; force random targeting
full description of variable:
Code: [Select]
C2/1543: 9C 15 34     STZ $3415      (will force randomization and skip backing up of
                                      targets)

:P

now, this issue can be elusive to verify in gameplay, because to see it:
- there must be a mixed formation; i.e. some non- Pipsqueak or Veteran monster for Gogo to possibly Sketch instead.
- the differing enemy must not have been killed (e.g. by Roulette) since initial Sketching of Pipsqueak/Veteran.
- the initially Sketched enemy must not have been killed since said doodle.
- Gogo can't have been slayed by Roulette.

pile on the Safety Bits and Memento Rings, and make liberal use of emulator fast forward.

also, i am curious as to what you're doing with Bit 0 of $B3, as vanilla just uses that with Blitz.

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 624
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Caravaggio Bug fix
« Reply #3 on: August 19, 2017, 04:10:43 AM »
when Mimicking Sketch, Gogo is supposed to Sketch the original enemy, unless it's been killed or Hidden/etc.

that won't necessarily be the case with Roulette now.  i believe the problem stems at least partially from you assigning FFh to $3415.

Which means I need to copy the Sketch target to the backup variable. I don't know which would work better: moving the "STZ $3415" to before the "JSR $17F0", or adding a "JSR $3865".

also, i am curious as to what you're doing with Bit 0 of $B3, as vanilla just uses that with Blitz.

That's to ensure no one is immediately subject to the Doom effect, which will happen if I don't include that. You'd see one entity get killed, then the finger flashes around, and then another entity gets killed.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

assassin

  • Bane of Retards
  • *
  • Posts: 1,020
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Caravaggio Bug fix
« Reply #4 on: August 19, 2017, 11:37:52 AM »
the Sketch target is already copied to the backup variable by that command's call to C2/317B.  normally, Sketch zeroing $3415 after that prevents the command invoked by Sketch from overwriting it.  however, Enemy Roulette now does so, due to FFh'ing $3415.  i suspect you do this to try and keep the Roulette targets empty to start?

it's like we want to preserve and restore $3A30 if Enemy Roulette is being run by Sketch:

Code: [Select]
stz sketchFlag

LDA #$FF
TSB $3415
bne noSketch
inc sketchFlag
noSketch:

...

lda $3a31
pha
lda $3a30
pha

JSR $175F

rep #$20
pla
dec sketchFlag
bne noSketch2

sta $3a30
noSketch2:
sep #$20

only 700 added bytes!

moving the $3415 writing to after the $B3 and $B5 ones can shorten (and speed up) that some:
Code: [Select]
...

LDA #$FF
TSB $3415
bne noSketch

lda $3a31
pha
lda $3a30
pha
JSR $175F
rep #$20
pla
sta $3a30
sep #$20
bra continue

noSketch:
JSR $175F
continue:

assassin

  • Bane of Retards
  • *
  • Posts: 1,020
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Caravaggio Bug fix
« Reply #5 on: September 05, 2017, 06:31:33 PM »
if space is a concern, another way to go about it is to not have "enemy_roulette" mess with $3415, then do something like this:

Code: [Select]
org $C231D3

lda $3a7c
pha

lda $b3
lsr
bcs noBlitzFail
lda #$1e
sta $01,s
bra noForceRandom
noBlitzFail:
lda $3415
bmi noForceRandom
lda #$40
tsb $ba
noForceRandom:

...

pla   ; was "LDA $3A7C"
CMP #$1E       ; did we have either original command of Enemy Roulette, or a set Failed Blitz Input flag?

a bit more intrusive, as it edits a general function instead of just adding a bunch of code to a Roulette-specific one.  but the assumption that a failed Blitz wouldn't want to randomly retarget seems fairly safe, given the other steps it takes.

:edit: scrapped more complicated code that wasn't any smaller.
« Last Edit: September 06, 2017, 12:56:58 AM by assassin »

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 624
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Caravaggio Bug fix
« Reply #6 on: September 12, 2017, 03:04:07 AM »
another way to go about it is to not have "enemy_roulette" mess with $3415

Just to be clear, you're saying that if I implement this solution, and remove the "clear $3415" part that I added to Enemy Roulette, that's what I have to do to fix the Gogo Sketch problem?
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 624
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Caravaggio Bug fix
« Reply #7 on: September 25, 2017, 01:26:39 AM »
OK, I've added your solution! I went with the intrusive one because I always like to avoid using up free space whenever possible.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 624
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Caravaggio Bug fix
« Reply #8 on: November 02, 2017, 03:41:49 AM »
:bump: Updated again!
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings