øA slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=printpage;topic=2109.0 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf24f.html slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2109.0 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf24f.html.z x ðg^ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ 1^ ¥> OK text/html ISO-8859-1 gzip @øÕ ¥> ÿÿÿÿÿÿÿÿ Tue, 10 Mar 2020 04:34:15 GMT 0ó° °® 0® P® €§² ð® ðg^ Ù ¥>
Print Page - Final Battle's bagkground effect - Is it usable elsewhere?
Board of Slick
Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: Bahamut ZERO on August 24, 2015, 02:11:41 PM
Title: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: Bahamut ZERO 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!
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: chillyfeez 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...
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: Gemini 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.
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: Grimoire LD 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.
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: Pinkpuff 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.
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: chillyfeez 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
Title: Re: Final Battle's Scrolling Effect - Is it usable elsewhere?
Post by: Bahamut ZERO 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.
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: avalanche 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
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.
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.
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: chillyfeez 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...
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: avalanche 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.
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: chillyfeez 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.
Title: Re: Final Battle's bagkground effect - Is it usable elsewhere?
Post by: Gedankenschild 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.
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.