øAslickproductions.org/forum/index.php?PHPSESSID=ukascihcm6qoputfjcvkl4kg34&topic=2109.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index1dce.htmlslickproductions.org/forum/index.php?PHPSESSID=ukascihcm6qoputfjcvkl4kg34&board=13.100e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index1dce.html.zxúÂh^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ ,/0ëOKtext/htmlISO-8859-1gzip8:Ö0ëÿÿÿÿÿÿÿÿWed, 11 Mar 2020 11:09:07 GMT0ó°° ®0®P®€§²ð®úÂh^ÿÿÿÿÿÿÿÿ¨%0ë Final Battle's bagkground effect - Is it usable elsewhere?

Author Topic: Final Battle's bagkground effect - Is it usable elsewhere?  (Read 2309 times)

Bahamut ZERO

  • Cagnazzo
  • *
  • Posts: 347
  • Gender: Male
  • If ye're takin a beatin, hop in de back row!
    • View Profile
Final Battle's bagkground effect - Is it usable elsewhere?
« on: August 24, 2015, 02:11:41 PM »
Lately I've been back to chugging along on my project (lots of little things all over the place have finally gotten done, and dialgoue up to the Cainazzo has been edited)
and I've been brainstorming on what to do with the fights with the individual fiends.  As a child I always wished I could see the crazy scrolling battle background effect seen during just one singel fight - the fight with Zeromus.

Which begs me to ask - would it be feasible to use that effect outside of that one fight?  What conditions must be met for it to occur?  Is it possible to use this effect with other battle backgrounds, regardless of how wonky it may look?


From my persistant proddings with FF4kster,  the only things I can gather are:

- The effect doesn't trigger if I set up Cainazzos Mytery byte/flags to match Zeromus in the Formation Editor

- The map which the final battle occurs has the Crystal Room background, yet the final battle calls it's own background

- The dying effect during the final battle cuts the music, and is longer as well as crazier looking than normal. I'd love to figure out how that's handled as well.


I'm going to give another go with Geigers and try to see what I can find out (which may not be a whole lot, as I'm still trying to figure stuff out on that front.)  I'll also be  looking for the battle background used for the final fight in YYCHR (oughtta be around the same place as all the others), but mostly to see how other backgrounds look like when fighting Zeromus  :wink:


Any info/theories on the matter are highly appreciated!



I update my graphics thread on almost a daily basis, so keep an eye out for new stuff!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #1 on: August 24, 2015, 03:26:16 PM »
I wonder if it's related to formation number... What happens if you change the Zeromus in the final battle to an imp? Anything? What happens if you make that particular battle formation occur anywhere else in the game (like, as a random encounter)?
The answers to these questions may help illuminate the info you seek...

Gemini

  • FF4 Hacker
  • *
  • Posts: 31
  • Gender: Male
  • Broom broom
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #2 on: August 24, 2015, 08:31:38 PM »
It's been a while so don't take this as 100% sure information, but that effect should be hardcoded with the battle background ID.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #3 on: August 24, 2015, 09:43:49 PM »
Gemini is right and it's something I've noted to PinkPuff in the past. The final battle background is just background 10, which as you'll notice the editor stops just shy of. There is a range called when a battle starts and if that range falls in the one formation it can be (Zeromus) then it will force that background.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #4 on: August 25, 2015, 03:21:12 AM »
There's a reason it's not in the editor. The byte containing the battle background only has four bits for battle background; the rest are flags for other properties: warpable, exitable, mystery bit, and magnetic. Thus, it can only encode the battle backgrounds 0 to F and so 10 has to be hardcoded by formation.
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #5 on: August 25, 2015, 05:25:05 AM »
But do we know the offset of that formation check?
It's likely something like a
CMP #$XX
BNE $YY
where XX is Zeromus's formation number.
If you know where that is, you could add it to the features editor.
Something like
Battle BG 10:  exactly/everything except/everything above/everything below formation number XX

Bahamut ZERO

  • Cagnazzo
  • *
  • Posts: 347
  • Gender: Male
  • If ye're takin a beatin, hop in de back row!
    • View Profile
Re: Final Battle's Scrolling Effect - Is it usable elsewhere?
« Reply #6 on: August 31, 2015, 01:47:07 PM »
Gemini is right and it's something I've noted to PinkPuff in the past. The final battle background is just background 10, which as you'll notice the editor stops just shy of. There is a range called when a battle starts and if that range falls in the one formation it can be (Zeromus) then it will force that background.


There's a reason it's not in the editor. The byte containing the battle background only has four bits for battle background; the rest are flags for other properties: warpable, exitable, mystery bit, and magnetic. Thus, it can only encode the battle backgrounds 0 to F and so 10 has to be hardcoded by formation.


I see.   I guess the scrolling effect is hardcoded to that one background as well, so I wouldn't be able to use that effect on any of the others.  :hmm:

Though now that you mention the mystery bit, is there a way to set it for background 10?  I know for most battle backgrounds setting the mystery bit causes them to use an alternate color scheme.





I update my graphics thread on almost a daily basis, so keep an eye out for new stuff!

avalanche

  • Mom Bomb
  • *
  • Posts: 122
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #7 on: October 29, 2015, 08:25:08 PM »
Slight necro here.  Dug a little into this one.

The special battle background 0x10 is indeed forced based on an encounter number check.  When the encounter number is 439-440, it overwrites the byte at $1802 with 0x10
Code: [Select]
00:8739  AE 00 18    LDX $1800                 Load battle/encounter ID
00:873C  E0 B7 01    CPX #$01B7                Branch if encounter ID < 439 (0x1B7)
00:873F  90 0A       BCC $0A       [00:874B]   ..
00:8741  E0 B9 01    CPX #$01B9                Branch if encounter ID >= 441 (0x1B9)
00:8744  B0 05       BCS $05       [00:874B]   ..
  > only for encounter ids 439 and 440
00:8746  A9 10       LDA #$10                 
00:8748  8D 02 18    STA $1802

00:874B  [carry on]


Then there is a routine called every frame to update the animation at 03:F902.  It checks $1802 for 0x10, and if so, performs some math to slide horizontal strips of the background.
Code: [Select]
03:F909  AD 02 18    LDA $1802                 load battle background ID
03:F90C  C9 10       CMP #$10                 
03:F90E  D0 37       BNE $37       [03:F947]   branch if not zeromus's battle BG (returns from routine)

This routine will animate whatever background is there.  So if you for example change $1802 to 0x10 after the first test (or change the test assembly to something more complex), then it will happily animate some other background other than the blue starry Zeromus bg.  I tried it with the grass and desert.  It might take some crafty background artwork to look good, because it just slides 8-pixel-tall strips around.

So by modifying the first part which tests for encounter number, you could reuse the entire zeromus battle background as-is.  Or you could leave that part, and change the second part which tests for 0x10, and you could animate a different background.

As a bonus, the strip-sliding math uses a table at $7992 which contains how much to move each strip to the left every frame, defining the galactic spinning shear it has.  You can change those values to slide stuff to the right or change the pattern in other ways.  I'm sure this 18-byte table is either copied from the ROM or generated procedurally, but I didn't look into it.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #8 on: October 29, 2015, 11:10:46 PM »
Good finds, avalanche!
Do you know if the graphical data for background 10 are stored among the data for the other backgrounds? I'm guessing it might be hard to see in a tile editor. Probably just a bunch of horizontal lines, huh? Maybe not much more than a few tiles, even...

avalanche

  • Mom Bomb
  • *
  • Posts: 122
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #9 on: October 30, 2015, 11:23:39 AM »
Good finds, avalanche!
Do you know if the graphical data for background 10 are stored among the data for the other backgrounds? I'm guessing it might be hard to see in a tile editor. Probably just a bunch of horizontal lines, huh? Maybe not much more than a few tiles, even...

No, I don't know where those graphics are stored yet.  Actually come to think of it, I don't think I know where any of the battle background graphics are yet.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #10 on: October 30, 2015, 12:38:00 PM »
That's definitely documented somewhere.
Maybe in yousei's document?
I'm sure gedankenschild knows, as he's actually edited some of them in his 4bpp project.

Gedankenschild

  • Vargas
  • *
  • Posts: 101
  • Gender: Male
    • View Profile
Re: Final Battle's bagkground effect - Is it usable elsewhere?
« Reply #11 on: October 30, 2015, 04:55:03 PM »
I haven't written anything down in an organized form.
What I can tell you is that the background graphics start at $E2A00 (headered).
There is a table at $0B7FB4 (headered) that contains the offsets for the various backgrounds.

Code: [Select]
B7DB4-B7DD5 (16FDB4-16FDD5) Battle Background Offset Table

00 A8 C0 AB 08 AF 50 B2 20 B5 80 B8 38 BB 90 BD 30 C0 D0 C2 70 C5 10 C8 B0 CA 50 CD F0 CF 90 D2 30 D5

I put together this crude thing before finding that table.
You've got to be kidding me with that Dynasty Warriors registration question??!!
I barely know such a series exists...