øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=printpage;topic=663.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index1b88-2.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=663.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index1b88-2.html.zx€}g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ  ,OKtext/htmlISO-8859-1gzip0|ÖÿÿÿÿÿÿÿÿTue, 10 Mar 2020 12:00:23 GMT0ó°° ®0®P®€§²ð®}g^‡  Print Page - Battle Background Loading Code

Board of Slick

Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: Phoenix on July 07, 2008, 02:19:47 AM

Title: Battle Background Loading Code
Post by: Phoenix on July 07, 2008, 02:19:47 AM
Does anyone know the location of the code that loads the battle backgrounds? I'm trying to change a few of the maps for my hack, and have realized that the battle background is determined by map number, not tileset. Anyone know anything?
Title: Re: Battle Background Loading Code
Post by: Lenophis on July 07, 2008, 02:30:37 AM
I'm trying to change a few of the maps for my hack, and have realized that the battle background is determined by map number, not tileset.
That seems odd, because in dungeons the background changes based on the tile you're on. (Cave to water, for example). Are you referring to strictly world maps or are you including everything?
Title: Re: Battle Background Loading Code
Post by: Phoenix on July 07, 2008, 03:05:14 AM
Quote
That seems odd, because in dungeons the background changes based on the tile you're on.

That's what I thought, but I changed one of the location map tile sets, and it would only load the green overworld grass background. It was one of the unused maps, which might be the problem, but I thought I'd take a look at the code and see what was happening. I'll try a few more test cases eventually and see if I can work it out -- I only did just the one test because I was curious, but for now I'm trying to finish up the overworld map changes. I'll post here when I find out what the problem was.
Title: Re: Battle Background Loading Code
Post by: Phoenix on July 07, 2009, 06:49:37 AM
As I posted in the thread on Metallic Properties, it turns out Yousei's data was one byte off for location properties. So, the location properties actually start at A8E84, and battle backgrounds are determined within the data, like so:

Code: [Select]
00: Battle/Spell Properties
bits 0-3: Battle Background
0: Grass 8: Magnes/Sealed Cave
1: Forest 9: Desert
2: Mountain A: Beach
3: Castle B: Land of Monsters/Sylphs
4: Cave C: Tower of Zot
5: Moon D: Lunar Subterrane
6: Ship E: Crystal Room
7: Water F: Underground
bit 4: Warp can be cast
bit 5: Exit can be cast
bit 6: Use alternate palette if available (backgrounds 0, 4, 7, 8, B, C)
bit 7: Battles have magnetic effect if event flag E1 is set

Another mystery solved.

:edit:
Did some testing and revised the bits list.

:edit:
Found the missing bits.
Title: Re: Battle Background Loading Code
Post by: Dragonsbrethren on July 07, 2009, 07:25:13 AM
Cool.