Ever wonder how these cutscenes in Ninja Gaiden work? How do they do a letter box while having moving objects in side the letter box?
I'll tell you! And it actually relies on a LIMIT of the NES! 🧵
It might not be obvious why this is interesting, but ask yourself: how does this shot have Ryu clipped at the top of the frame? Why doesn't he pop out?
Knowing the limits of the NES, shouldn't it look more like mock screenshot? How does the top of Ryu go *under* the black bars?
The way this is accomplished is pretty clever and actually exploits a limit of the NES!
As you may know, the NES can only draw 8 sprites per horizontal line of the screen. This is what causes the infamous sprite flicker on the NES.
If you look at this shot in the debugger, you will find that there are 32 black rectangle sprites in the top right of the screen. Stacked in groups of 8, in 4 rows.
Together, these 4 rows of sprites cover the top of the screen, and because there are 8 sprites, it maxes out the sprite limit of the NES. Any sprites drawn after that will not be renderer; in this case the sprites from the cutscene!
And that's how one small aspect of those famous Ninja Gaiden cutscenes were possible on the NES!
Follow me for more behind the scenes technical breakdowns of classic NES games, as well as my own games!
@UnrollHelper unroll
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Here's how I do some really basic perf testing on my NES game, Super Sunny World 🌞
I can enable a "Frame Line" which draws a line of "white" at the end of the Game Loop. If that line goes past the bottom of the screen, that would result in a lag frame! #nesdev
This works because while FRAME 1 is drawing, line by line from the top of the screen downward, FRAME 2 is being calculated. So the longer FRAME 2 takes to update, the lower on screen the line will be.
But you may be wondering: I didn't think the NES could draw arbitrary lines like that! You're right. The "line" isn't actually a "line". Instead I change to color of the rendering (using something called an "emphasis bit") for a set time creating the illusion of the line.
Implementing scrolling on the NES is difficult. Because of that, I've been thinking about what different platformer games have done, and which battles I want to fight with my #nesdev game.
I'll document all the different *types* of scrolling I can think of in this thread.
::Full 8-Way Scrolling (Blaster Master)::
Levels extend in all directions with a maze-like layout, not favoring any one direction in particular. Levels are much larger than can fit in nametable, and employ level streaming.
::Limited 8-Way Scrolling (Mario 3)::
SMB 3 has some levels with 8 way scrolling, but are still designed with a bias towards horizontal movement. Up/Down is reserved for "hidden objects" and "secrets".
Camera is designed to only scroll up if player is doing a highjump/flying.
Here's a fun problem to solve when making NES games, that you might not even realize is a problem! #nesdev
Sprites on the NES are actually drawn in "screen space" and wrap around at the edges. But obviously in many games, this makes no sense! Here's how to solve it 🧵
The sprites are drawn in a range of 0-255 on the x-axis (0-239 on the y-axis), and have no concept of a "camera", or the level. It is up to the dev to draw them in a location on screen that makes sense, relative to the game's camera.
It is also up to the dev to make sure that objects that are "off camera" do not get drawn.
But this can be tricky because "objects" are actually multiple 8x8 sprites drawn together to form a larger object.
Got the day off work, and kids are in school! Time to go ham on this project, and turn *this* (side scroller) into *this* (top down rpg-like world map). #nesdev
Bringin' in the lil' guy!
Believe it or not, this is actually *progress*! Graphics data for the top down character is being properly swapped in (replacing the side scroller graphics).