Aslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1973.0;prev_next=nexte:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index5f48-2.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1973.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index5f48-2.html.zx&g^ЋOKtext/htmlISO-8859-1gzip@Tue, 10 Mar 2020 05:49:45 GMT0 0P&g^" Battles - Exp gained & Victory theme played?

Author Topic: Battles - Exp gained & Victory theme played?  (Read 1352 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Battles - Exp gained & Victory theme played?
« on: March 29, 2015, 08:24:19 AM »
There are some battles with the "no change" music option that award exp/money and play the victory theme (e.g. Cagnazzo battle, MomBomb battle) and others that don't, even if the monsters themselves have rewards... The mystery flags in the formaitons don't seem to have any bearing on this as far as I can tell; does anyone know how this is determined?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Battles - Exp gained & Victory theme played?
« Reply #1 on: March 29, 2015, 01:31:08 PM »
There are some battles with the "no change" music option that award exp/money and play the victory theme (e.g. Cagnazzo battle, MomBomb battle) and others that don't, even if the monsters themselves have rewards... The mystery flags in the formaitons don't seem to have any bearing on this as far as I can tell; does anyone know how this is determined?

Ah, you're referring to the Fabul Battles and Golbez vs. Tellah,  I believe with the music that stays constant and the Boss Battles that do play the Victory Theme, sure I'll take a look.

Let's see here... after a little digging I found the song/sound effect that is currently called is loaded at 7E1E01 and indeed at the end of conventional battles a 08 is loaded into this section to play the Victory Theme, now it looks to be a bit of a Table that is used for this sort of dealing, here are the instructions called for this..

Code: [Select]
$03/8219 AD E5 38 LDA $38E5  [$7E:38E5] A:0008 X:0111 Y:000D P:eNvMxdIzc - Load Second Set of Encounter Flags.
$03/821C 29 0C AND #$0C A:0000 X:0111 Y:000D P:envMxdIZc - Keep only 4 and 8.
$03/821E 4A LSR A A:0000 X:0111 Y:000D P:envMxdIZc - /2
$03/821F 4A LSR A A:0000 X:0111 Y:000D P:envMxdIZc - /2
$03/8220 C9 03 CMP #$03 A:0000 X:0111 Y:000D P:envMxdIZc - Is it equal to 03?
$03/8222 F0 09 BEQ $09    [$822D] A:0000 X:0111 Y:000D P:eNvMxdIzc - If so, branch. (This is continue playing the default music)
$03/8224 AA TAX A:0000 X:0111 Y:000D P:eNvMxdIzc - Transfer A to X.
$03/8225 BF 0C FF 13 LDA $13FF0C,x[$13:FF0C] A:0000 X:0000 Y:000D P:envMxdIZc - Load A from the Battle Music Table.
$03/8229 22 12 FF 13 JSL $13FF12[$13:FF12] A:0017 X:0000 Y:000D P:envMxdIzc - Jump to Placing Song Data.
(This table is...)
27 - Normal Battle Music
1A - Elemental Fiends Battle Music
0B - Boss Music

Now let's see how this End of Battle is interpreted then.

Alright, once the battle is won this data is loaded to play the normal Victory Fanfare...

Code: [Select]
$03/872F AD E5 38 LDA $38E5  [$7E:38E5] A:0000 X:FE67 Y:000E P:envMxdiZC  - Load Second Set of Encounter Flags
$03/8732 29 0C AND #$0C A:0000 X:FE67 Y:000E P:envMxdiZC - Get rid of all bits that are not 0C.
$03/8734 C9 0C CMP #$0C A:0000 X:FE67 Y:000E P:envMxdiZC - Is it 0C?
$03/8736 F0 08 BEQ $08    [$8740] A:0000 X:FE67 Y:000E P:eNvMxdizc - If so, branch. (If the Second Set of Encounter Flags contains a 0C the game will not play the Victory Fanfare, however having a 03 (which only implies a 0C /4  for the second encounter flags in terms of bits since it is divided twice) will still be "no change").
------------------------------------------------------------------------------------------------------
$03/8738 A9 08 LDA #$08 A:0000 X:FE67 Y:000E P:eNvMxdizc - Load Victory Fanfare into A.
$03/873A 8D BE 38 STA $38BE  [$7E:38BE] A:0008 X:FE67 Y:000E P:envMxdizc - Store A in 7E38BE.
----------------------------------------------------------------------------------------------------------
$03/873D EE BD 38 INC $38BD  [$7E:38BD] A:0008 X:FE67 Y:000E P:envMxdizc - +1 to 38BD.
$03/8740 20 0F 88 JSR $880F  [$03:880F] A:0008 X:FE67 Y:000E P:envMxdizc - Jump to Subroutine (??)

While it's in the code above I may as well say it plainly here as well... if the Second Set of Encounter Flags which controls the music playing contains a 0C it will play "no change" music, whereas if a 0C is used it will not only continue "no change" music, but it will also suppress the Victory Fanfare.

As I've never looked at that data in ROM, PinkPuff it doesn't make much sense to me, but since you put together a program that reads these matters correctly I imagine you would know how this second set of encounter flags are parsed in the Formation data.

 :edit: I forgot the basics of hex math, so my above conclusion is incorrect. I'm still looking for the answer.

No, no. Nevermind. It was a misunderstanding on my part. My above conclusion is right, there does appear to be something special about the MomBomb battle though, since that should fall under the same auspices of of 0C and skipping the victory theme, I'll take a look though.

Let's see... some sort of check at 13FD00  is looked at in the end of battle seeing what formation was just played... looks to be the Auto-Battles, but I don't know what is being referred to here.

Hmm, can you get Exp/Gil in Auto Battles? I'm wondering if they are looking to suppress those?

 :edit:
Ah? Here's another table of sorts which looks a bit more varied, let's see here... 13FE69...

Battle DD - 221 (CPU)

Battle E1 -  226 (Mom Bomb)

Battle E7 -  232 (Dark Elf/Dragon)

You know what these all have in common? They are all "No change" music Boss Battles which end with the Victory Theme. And I am right on the ticket!

This is the answer, another bizarre choice of Formation tables. These are located at 13FE69 in LoROM and ROM at 9FE69.

Here is the data with that...

DD 00 - CPU
E1 00  - Mom Bomb
E7 00  - Dark Elf/Dragon
A7 01 - Calbrena
A8 01 - Golbez
AF 01 - Evil Wall

And there you go! You may have Only Six specific formations have a "no change" music and have the Victory Theme. A very strange way of going about it, make no mistake.
B6 01


« Last Edit: March 29, 2015, 02:38:00 PM by Grimoire LD »

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Battles - Exp gained & Victory theme played?
« Reply #2 on: April 14, 2015, 09:13:06 PM »
There are some battles with the "no change" music option that award exp/money and play the victory theme (e.g. Cagnazzo battle, MomBomb battle) and others that don't, even if the monsters themselves have rewards... The mystery flags in the formaitons don't seem to have any bearing on this as far as I can tell; does anyone know how this is determined?

I'd be curious to see how that works too. I had another thought as to rewards. I don't know how practical this may be but I had been considering at times to test the feasibility of certain formations automatically leveling up a character. With the game as well paced as it is it would be unnecessary but it is something I was considering for optional side bosses. What brought that to mind was that I was considering using a different theme along with said battle; maybe the "Added to Party" theme. Anyway, just a thought.
"Now I know; and knowing makes it even more confusing..."

Bahamut ZERO

  • Cagnazzo
  • *
  • Posts: 347
  • Gender: Male
  • If ye're takin a beatin, hop in de back row!
    • View Profile
Re: Battles - Exp gained & Victory theme played?
« Reply #3 on: April 15, 2015, 01:37:12 PM »
Oh boy! I was worried it was the other way around, meaning I thought there were a set number of "no change" battles that ended with no victory theme. Reading this kind of just made my day. Thanks!
I update my graphics thread on almost a daily basis, so keep an eye out for new stuff!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Battles - Exp gained & Victory theme played?
« Reply #4 on: April 15, 2015, 10:31:12 PM »
There are some battles with the "no change" music option that award exp/money and play the victory theme (e.g. Cagnazzo battle, MomBomb battle) and others that don't, even if the monsters themselves have rewards... The mystery flags in the formaitons don't seem to have any bearing on this as far as I can tell; does anyone know how this is determined?

I'd be curious to see how that works too. I had another thought as to rewards. I don't know how practical this may be but I had been considering at times to test the feasibility of certain formations automatically leveling up a character. With the game as well paced as it is it would be unnecessary but it is something I was considering for optional side bosses. What brought that to mind was that I was considering using a different theme along with said battle; maybe the "Added to Party" theme. Anyway, just a thought.

Battle music can be changed with an AI Command, unless you were referring to changing the Fanfare theme. Which... would be tricky and require custom code.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Battles - Exp gained & Victory theme played?
« Reply #5 on: April 16, 2015, 11:29:01 AM »
Battle music can be changed with an AI Command, unless you were referring to changing the Fanfare theme. Which... would be tricky and require custom code.

Changing the Fanfare was what I was thinking. Maybe I could get around it by not playing the Fanfare in the battle at all - like in Fabul etc. - and then just play whatever I'd want after the battle just to keep it simple.
"Now I know; and knowing makes it even more confusing..."

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Battles - Exp gained & Victory theme played?
« Reply #6 on: April 18, 2015, 04:44:45 AM »
Thanks! That solves the "playing the fanfare" part, but what about the Exp/Gil part? Chaging something from an autobattle to a normal battle does not seem to cause it to start doling out rewards...

 :edit: Never mind, I figured it out. That table at 9FD00 has a list of 12 formations that suppress the giving out of rewards. Some are autobattles and some aren't. Anyway it's all good; next version of the editor will have rewards toggle and victory theme toggle in the formation editor.
« Last Edit: April 18, 2015, 05:52:43 AM by Pinkpuff »
Let's dance!