How did they flip background tiles in Final Fantasy 3?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
User avatar
Avedare
Posts: 4
Joined: Mon Aug 24, 2020 11:26 am

How did they flip background tiles in Final Fantasy 3?

Post by Avedare » Mon Aug 24, 2020 11:38 am

Hello, guys! (Sorry if wrong section)

I'm making a documentary about Final Fantasy series on YouTube. I dedicate single 1-2 hour movie for each game, and of course I talk about NES technologies, that Final Fantasy use. Bank Switching for water movement for example.
Now I am working on Final Fantasy III, and I met a problem. Look.
NES/Famicom can't flip background tiles. But in FF3 sometimes enemies attack you from behind and they are standing on the right side totally flipped! Four warriors are sprites and enemies are background, so they are definitely somehow flipped. I explored all tiles in game with special software and found only single type of every enemy, no any preflipped enemies.
So how did they do that? How could guys from Square flip any enemy on NES?
Image

User avatar
Bregalad
Posts: 7951
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: How did they flip background tiles in Final Fantasy 3?

Post by Bregalad » Mon Aug 24, 2020 11:44 am

Hello and welcome to nesdev !
I'm a huge fan of the Final Fantasy series, at least until X included, so I am very interested by your series ! Actually, back then FF1 was pretty much the game that brought me to those forums.

Now to answer your question, I did not look at FF3's code, not even at name/pattern tables viewer, but I'll answer with an educated guess. The NES can't flip background tiles in hardware, but it can in software, provided a given game uses CHR-RAM. And FF3 uses CHR-RAM. So most likely it mirrors the enemie's image by software.

The hirony is that, in order to display a proper battle scene, the enemies didn't have to be flipped in the first place. The hereos should just have looked away from the enemy. The game just display a mirrored battle scene, but the heroes are facing the enemies as usual, so it does not display an "attack from behind". Most ironically, they put talent into doing something that actually wasn't supposed to be here !
Bank Switching for water movement for example
No Final Fantasy game I know of uses bank switching for water movement. It is done by software too, by simply rotating each line in a tile at a slow pace. This technique is used from FF2 until FF5 and was used in a few other Squaresoft games such as Hanjuku Hero, Seiken Densetsu (aka Final Fantasy Adventure); SaGa 1-3 (aka Final Fantasy Legend); and Romancing Saga, possibly others I'm forgetting.
Useless, lumbering half-wits don't scare us.

User avatar
Controllerhead
Posts: 148
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: How did they flip background tiles in Final Fantasy 3?

Post by Controllerhead » Mon Aug 24, 2020 11:49 am

I don't know without looking at / stepping through the code, but: Final Fantasy 3 uses an 8KB CHR RAM chip, as opposed to baked in CHR ROM, so most likely, they loaded the graphics data from ROM into it backwards.

EDIT: Bregalad beat me to it. Fungah! Foiled again!
Image

User avatar
Bregalad
Posts: 7951
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: How did they flip background tiles in Final Fantasy 3?

Post by Bregalad » Mon Aug 24, 2020 12:04 pm

@Controllerhead : Sorry 'bout that.

@Avedare : So I looked at your video, the content looks of great quality but unfortunately I can't understand a word, there's not even (non automatic) subtitles :(

It's obvious you use an innacurate emulator at 17:39 (link) There's supposed to be a beam of light coming to the hero when lighting the orb, this beam of light is created by enabling and disabling the monochrome bit at $2001.0 very quickly in a special fasion.
Useless, lumbering half-wits don't scare us.

User avatar
Avedare
Posts: 4
Joined: Mon Aug 24, 2020 11:26 am

Re: How did they flip background tiles in Final Fantasy 3?

Post by Avedare » Mon Aug 24, 2020 12:51 pm

Bregalad wrote:
Mon Aug 24, 2020 12:04 pm
@Avedare : So I looked at your video, the content looks of great quality but unfortunately I can't understand a word, there's not even (non automatic) subtitles :(
It's obvious you use an innacurate emulator at 17:39 (link) There's supposed to be a beam of light coming to the hero when lighting the orb, this beam of light is created by enabling and disabling the monochrome bit at $2001.0 very quickly in a special fasion.
Oh, thank you so much! You helped me a lot with this!
So if you allow, I will ask another thing too: when fight with any boss starts or ends, there is animation for monster like this one (10:43). I looked to the resources with YY-CHR software, and found tons of prepared frames for this animation. What technology did they use for this one?

Oh, sorry for that, I will add English subtitles one day, but as soon as I come at least to FF7 :-)

Yeah, I used jNES emulator, but unfortunately when I was recording FF1 I didn't configure it properly. Fixed colors and everything for FF2.
By the way, I'll ask for future series - what emulator will be most accurate for SNES Fantasies? I will be very thankful for help!

User avatar
Bregalad
Posts: 7951
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: How did they flip background tiles in Final Fantasy 3?

Post by Bregalad » Mon Aug 24, 2020 1:03 pm

Avedare wrote:
Mon Aug 24, 2020 12:51 pm
Yeah, I used jNES emulator, but unfortunately when I was recording FF1 I didn't configure it properly. Fixed colors and everything for FF2.
I don't think FF2 or FF3 needs an emulator as accurate as FF1, as there's no beam of light effect in either of those. There's colour emphasis when a random battle happens, but that can look OK with any moderately accurate emultor, because they only change it once per frame and not multiple times per scanline like the beam of light in FF1.

Oh, sorry for that, I will add English subtitles one day, but as soon as I come at least to FF7
You can also add them directly in French if you don't like English language ;)
By the way, I'll ask for future series - what emulator will be most accurate for SNES Fantasies? I will be very thankful for help!
As far as I know there is no need for a very accurate emulator for neither FF4, FF5 or FF6, they don't use timing trickery. This kind of stuff is less common on advanced systems, because the system is already powerful enough so there's no need for extra trickery to display the graphics we want.

EDIT : Now that I think about it, FF4 uses a VIRQ to display the dialog box and I remember some inacurate emulator (some version of Snes9x ?) displaiyng a blank scanline above the bottom border of the dialog boxes. So pay attention to that, the dialog box looks fine on real hardware.

The only major caveat is the sound; instrument #4 of FF5/6 is a spcial white noise like sample created by an overflowing sine wave that is supposed to make the BRR decoder go cahotic, ZSNES and early SNES9x won't emulate this correctly and will either make it sound like some synth/sine wave or like pure white noise. Other instruments will also sound wrong if the BRR decoding doesn't overflow properly, but because they're reset when the wave is looping it won't sound as wrong.

You can test this by starting a new game in FF6, if it sounds like wind it's fine but if it sounds like a siren alarm then it's not an acurate emulation of the sound.
Useless, lumbering half-wits don't scare us.

User avatar
Avedare
Posts: 4
Joined: Mon Aug 24, 2020 11:26 am

Re: How did they flip background tiles in Final Fantasy 3?

Post by Avedare » Mon Aug 24, 2020 3:04 pm

As far as I know there is no need for a very accurate emulator for neither FF4, FF5 or FF6, they don't use timing trickery. This kind of stuff is less common on advanced systems, because the system is already powerful enough so there's no need for extra trickery to display the graphics we want.

EDIT : Now that I think about it, FF4 uses a VIRQ to display the dialog box and I remember some inacurate emulator (some version of Snes9x ?) displaiyng a blank scanline above the bottom border of the dialog boxes. So pay attention to that, the dialog box looks fine on real hardware.

The only major caveat is the sound; instrument #4 of FF5/6 is a spcial white noise like sample created by an overflowing sine wave that is supposed to make the BRR decoder go cahotic, ZSNES and early SNES9x won't emulate this correctly and will either make it sound like some synth/sine wave or like pure white noise. Other instruments will also sound wrong if the BRR decoding doesn't overflow properly, but because they're reset when the wave is looping it won't sound as wrong.

You can test this by starting a new game in FF6, if it sounds like wind it's fine but if it sounds like a siren alarm then it's not an acurate emulation of the sound.
Thank you! I'll use you advices :-)
Do you have any ideas about bosses' animation technology?

tepples
Posts: 22049
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: How did they flip background tiles in Final Fantasy 3?

Post by tepples » Mon Aug 24, 2020 7:59 pm

Bregalad wrote:
Mon Aug 24, 2020 1:03 pm
You can also add them directly in French if you don't like English language ;)
I thought Google was doing away with user-contributed subtitles in favor of charging deaf, HOH, and international folks for professional subtitling.

User avatar
Bregalad
Posts: 7951
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: How did they flip background tiles in Final Fantasy 3?

Post by Bregalad » Tue Aug 25, 2020 1:34 am

Avedare wrote:
Mon Aug 24, 2020 3:04 pm
Do you have any ideas about bosses' animation technology?
I don't think the boss is "amimated" but there's simply a graphical effect when it appears and disapears, this is one more time CHR-RAM effect. This is used a lot in everywhere FF games. You can confirm this just by using a "pattern table viewer" in many emulators.

I doubt any boss is "animated" in FF1-3, but they definitely are in FF4 and 5; this is probably done by simple name table switching, something that would be technically possible on the NES as well.
Useless, lumbering half-wits don't scare us.

User avatar
Avedare
Posts: 4
Joined: Mon Aug 24, 2020 11:26 am

Re: How did they flip background tiles in Final Fantasy 3?

Post by Avedare » Tue Aug 25, 2020 4:08 am

Bregalad wrote:
Tue Aug 25, 2020 1:34 am
I don't think the boss is "amimated" but there's simply a graphical effect when it appears and disapears, this is one more time CHR-RAM effect. This is used a lot in everywhere FF games. You can confirm this just by using a "pattern table viewer" in many emulators.

I doubt any boss is "animated" in FF1-3, but they definitely are in FF4 and 5; this is probably done by simple name table switching, something that would be technically possible on the NES as well.
Thank you one more time! You really helped me!
May I ask you some things if I'll have technical questions in future? :-)

User avatar
Bregalad
Posts: 7951
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: How did they flip background tiles in Final Fantasy 3?

Post by Bregalad » Tue Aug 25, 2020 5:45 am

Most certainly !
Useless, lumbering half-wits don't scare us.

Pokun
Posts: 1511
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: How did they flip background tiles in Final Fantasy 3?

Post by Pokun » Tue Aug 25, 2020 2:10 pm

The most accurate SNES emulator is bsnes/higan, but Mesen-S has caught up quickly, is probably easier to use and may have more useful tools (Mesen is one of the most useable and accurate emulators for NES). I wouldn't use Zsnes nowadays (although I used to find it great), and probably not Snes9x if it can be helped.

I'm also a fan of Final Fantasy and hopes for English subtitles one day. :)

User avatar
Bregalad
Posts: 7951
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: How did they flip background tiles in Final Fantasy 3?

Post by Bregalad » Wed Aug 26, 2020 6:10 am

Pokun wrote:
Tue Aug 25, 2020 2:10 pm
The most accurate SNES emulator is bsnes/higan, but Mesen-S has caught up quickly, is probably easier to use and may have more useful tools
64-bit only :cry:
However Mesen works fine.
Useless, lumbering half-wits don't scare us.

Post Reply