This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Better fading

Better fading
by on (#46769)
Since the NES palette doesn't have many colors, fading in and out smoothly can be very hard. Most (all?) games I've seen just mess with the brightness of the colors, which means that fading sequences have only 4 steps. Personally, I think that's too little.

In other platforms (such as the SMS, which has a comparable number of colors), I've seen something that appears to make the process smoother, which is moving the palette towards blue as brightness goes down. That could double the number of steps when alternating between making the palette darker and making it bluer.

I implemented something similar and it looked great, but it used some huge look-up tables. Now that I've decided to work with less ROM, I had to cut those tables out, but would like to maintain the smooth fades. I've tried to calculate the palette on the fly and use smaller look-up tables but I think it's still too slow.

What I meant to ask is: does anyone know of any NES game that does this? I've never seen one, and was just curious to see how someone might have implemented this. Also, if anyone has any ideas, I'd sure like to hear them. I'm not expecting to copy anything from anyone, I'm just in search of some new ideas.

Another thing I have considered for smoother fades is alternating between changing the brightness bits and turning the color emphasis bits. For example, if I wanted to fade out I'd first turn all color emphasis bits on. During the next step I'd turn them off and decrement the brightness of all colors. Then the color emphasis again, and so on. I though that might make the fading smoother, but still doesn't help if I want to fade to white.

by on (#46773)
I think it'd be best to just stick with a 4-stage fade as you described initially. You're dealing with limitations of the hardware, and all the other ideas you proposed sound like they'd be visually more annoying to the player than just "keeping it retro".

by on (#46774)
koitsu wrote:
You're dealing with limitations of the hardware, and all the other ideas you proposed sound like they'd be visually more annoying to the player than just "keeping it retro".

Do you think that fading through blue looks annoying? I think it looks great! All SMS games that use it look much better than the ones with 4-stage fades. And I'm pretty sure the idea of using the emphasis bits would allow for intermediate levels of brightness between each of the basic 4 stages.

I plan to do as little "sticking with the basics" as possible, as that is the reason the homebrew scene is stuck with technicaly uninteresting games (which doesn't necessarily mean they are bad games). Why would I go with the old, blocky 4-step fade when an 8-step is perfectly possible? I'm just looking for ideas on how to save ROM without wasting too much CPU, but it's definitely possible, one way or another, and it looks great.

by on (#46776)
Well, 4-stage fading looks great as long as it's fast enough. That's a hardware limitaiton of the NES somehow. Using color emphasis you could increase the number of stages as you say, but it could result in the impression of flickering on colors that are initially bright (altough you'd have to try on real hardware to know).

To fade to blue you'd probably want to reduce the hue as well as the luminousity. Final Fantasy does palette fade to hue instead of luminosity for more stages and this looks fun.

by on (#46778)
Ah, Final Fantasy, huh? Great, that's exactly what I was looking for: NES games that work on hue during fading. I'll check it out.

by on (#46804)
Uh... I couldn't find a fade like you described in any Final Fantasy... They seem to use moving black bars for scene transitions, and the only time I've seen a palette animation was when you go into battle, but that was not a fade, it was just flashing. Is there a specific moment in the game I should be looking for?

by on (#46806)
Perhaps it's in the Inn in FF2 or FF3... I would suggest trying one of those. I know it fades TO blue in FF3 when you stay at the inn.

EDIT: Go into the menu in FF3; I think it does it there.

by on (#46814)
I've seen some games where they flicker between colors to try to mix them, and use that in a fading transition.

like

pink, flicker pink-lightred, lightred, flicker lightred-red, red, flicker red-darkred, darkred, flicker darkred-black, black

something like that.

by on (#46815)
I think flicker-based color mixing on consoles died with the seizure lawsuits.

by on (#46817)
tepples wrote:
I think flicker-based color mixing on consoles died with the seizure lawsuits.

In Megaman 2, when Megaman gets equipped with a new weapon, the part where he flickers between the two colors appears as a solid, non-flickering color on my tv. :P

by on (#46818)
Celius wrote:
I know it fades TO blue in FF3 when you stay at the inn.

I suck at this game too much in order to bother finding an inn! O_o

Quote:
EDIT: Go into the menu in FF3; I think it does it there.

This is a regular 4-step fade.

CKY-2K/Clay Man wrote:
I've seen some games where they flicker between colors to try to mix them, and use that in a fading transition.

Oh no, flickering looks terrible! Is it possible that no NES games used hue shifts to increase the length of fading sequences?

EDIT: I checked some SMS games I had laying around and found 2 that fade through colors: Daffy Duck in Hollywood and Putt & Putter (found others, but they don't look as good). Ninja Gaiden has a pretty good fade-through-blue too. The SMS palette is RGB, and since it uses 2 bits per component, it would make sense to use a basic 4-step fade like on the NES. But instead, many games fade the components in clever orders to have a smoother animation. I find it strange that this isn't common at all on the NES (I can't seem to find a single game with a smoother fade).

by on (#46819)
Oh, I guess you're right about the menu. Oops. Also, you wouldn't get to an Inn unless you beat the first boss and went to the first town. You start in a cave, so this takes about 10-15 minutes. Anyways, I looked and it actually doesn't fade to blue. It does like a hue cycling thing and stops on blue. I'm not actually sure where any fade to blue stuff happens in any FF game now that I think about it...

This may be a strange idea, but if you're using CHR RAM, you could try doing some dithering to fade out. For example, if you have a blue tile, place a black checkerboard over it to make it fade down once. But this might look really stupid, and might not be worth the time. But I just thought I'd mention it.

by on (#46820)
Quote:
Uh... I couldn't find a fade like you described in any Final Fantasy... They seem to use moving black bars for scene transitions, and the only time I've seen a palette animation was when you go into battle, but that was not a fade, it was just flashing. Is there a specific moment in the game I should be looking for?

I was talking about when you enter or quit the menu or when you get OUTSIDE of battle in FF1.

About flickering, Mega Man actually appers flickering on my TV. That's where it really make a difference between CRTs and LCDs. At 50/60 Hz, CRTs will look flickering, but LCDs will shot a nice average of both color. So while flickering will be okay for GB, GBA or DS games, games that connects to a non HD TV set should avoid flickering unless it's supposed to flicker.

by on (#46827)
Celius wrote:
This may be a strange idea, but if you're using CHR RAM, you could try doing some dithering to fade out. For example, if you have a blue tile, place a black checkerboard over it to make it fade down once. But this might look really stupid, and might not be worth the time. But I just thought I'd mention it.


That's an interesting idea actually. Could you theoretically achieve fade-out patterns like in Cave Story (first two seconds in the video)? They don't look too bad.

I suppose that would only work as long as there aren't many different tiles on screen because the NES would be too slow to handle all the chr ram updates within one vblank.

by on (#46829)
Destiny of an Emperor actually does something similar when entering in battle.

by on (#46835)
Bregalad wrote:
Destiny of an Emperor actually does something similar when entering in battle.


And this effect totally destroys some emulators. A couple I've used slow down to a total crawl (music/sound impacted as well). I've seen the same thing happen with Bionic Commando's title screen.

I've always been curious how they do it (mid-scanline PPU trickery, or do they convert sprites into tiles then change the CHR data using CPU code)... actually, fuck it -- I don't want to know how they did it. I'd rather appreciate the mystery, just like the scaling "IV" in Dragon Quest 4 (not Dragon Warrior 4!). I must be the only technically-savvy person these days who doesn't want to know how everything works (and I'm an Aquarius! Go figure!)

Another game which uses a similar fading effect is Shadowgate.

by on (#46838)
I guess it's pretty simple how it does it. It turns the screen blanked for a frame, and mask a bit in all tiles of the BG pattern table used for the background.

I've also asked myself about the scaling IV. It's really a mystery.

by on (#46839)
Scaling in IV? It just uses a lot of frames to do it, combined with nametable flipping to smooth the animation.

by on (#46988)
Many of Natsume's NES games, starting from 1991 (such as Shatterhand, Chaos World, and Shadow of the Ninja), fade certain colors beyond their original hues. Gun-Nac also does this.

by on (#46993)
i saw on this page that setting the color emphasis bits actually darkens the screen.. might be worth checking out

http://www.games4nintendo.com/nes/faq.php#40

by on (#47347)
frantik wrote:
i saw on this page that setting the color emphasis bits actually darkens the screen.. might be worth checking out

http://www.games4nintendo.com/nes/faq.php#40


It's the same as this:
http://nesdev.com/NESTechFAQ.htm
Oddly, they removed the first 3 questions, and all the author's notes. It's good info though.

by on (#47349)
I considered using the emphasis bits, like I mentioned before, but gave up on the idea for a number of reasons.

I ended up solving my problem by reordering the palette so that it's more friendly to hue and brightness transformations. The conversion table ended up a bit larger than I first wanted, but it will have to do for now. I'm tweaking the fading to be as smooth as possible.