Text: sprites or tiles?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Text: sprites or tiles?
by on (#89033)
I was wondering that why doesn't OAM cycling happen with text boxes? Are the letters tiles instead of sprites? Again, I am doing NES-looking graphics for a PC game and I want the graphics to look as authentic as possible.

For example when you speak with the old man in The Legend of Zelda, the letters appear one by one. That is kind of "animation", so isn't it necessary to use sprites when ever there is any kind of animation?

by on (#89034)
Yes, the background is used for text. Unless you can fit all the text within 8 sprites and no objects on the line, which some games do, but never for long lines of text as it makes zero sense to try. :)

by on (#89035)
Just because it's background doesn't mean it can't be changed. I've written code that changes 216 background tiles in a single frame.

Battletoads also does neat things with the background layer. Check out the Snake Pit level, with the exception of the snake's head and tail caps, the animated snake is done entirely through background tiles.

The Megaman series is also known for boss fights against giant monsters which are entirely in the background. Sometimes they use split screen scrolling.

Also, nearly every tile you interact with in Super Mario Bros 3 is a background tile. When it needs to leave the grid, (like when you bump a question block) it gets replaced with a sprite temporarily, then goes back to being a background tile.

by on (#89037)
Atari Games' arcade version of Tetris doesn't even have a sprite chip. Everything is animated by updating tiles in the background layer.

Some examples from my own games:
  • In LJ65, a piece is added to the background once it lands, and then the tiles scroll within the window after the player clears a line. I push updates to about 200 tiles per frame, allowing line clear animation to be much smoother than in Tetris by Tengen or Nintendo, but I turn rendering off a bit early to make up for this.
  • Concentration Room is like Super Mario Bros.: whenever a card turns over, it momentarily becomes a sprite while the turn animation proceeds, and it returns to the background once it rests.
  • Thwaite: Think about it. Updating the score is animation of text, yet most games write their score to the background. Every time you shoot a missile, the score panel is rewritten to reflect that your available ammo has decreased by one. The blinking colons in the game time don't hurt either.
  • All three of these games have a cut scene engine that uses the same "write text a character at a time" trick as The Legend of Zelda.

If you have a ROM of a game, and you want to see what's background and what's a sprite, run it in an emulator that has a nametable viewer. These include Nintendulator, NESICIDE, the Windows version of FCEUX, or PocketNES inside the Windows version of VisualBoyAdvance.

by on (#89038)
Ok, this makes sense! Thanks again for a quick reply!

by on (#89040)
Dwedit wrote:

The Megaman series is also known for boss fights against giant monsters which are entirely in the background. Sometimes they use split screen scrolling.



That explains the blank, black backgrounds. What are some examples with the split-screen scrolling?

by on (#89041)
noattack wrote:
What are some examples with the split-screen scrolling?

Anything that uses different scroll values in different parts of the screen. For example, if a background enemy moves on top of a static floor, there's a split between the enemy and the floor.

I remember that early Mega Man games (Mega Man 2, more specifically) used floors without any horizontal detail in such areas, they were just stripes, so that the player wouldn't notice that the floor was moving left and right along with the enemy.

EDIT: Found a video: http://youtu.be/KvkHhpz2FrY?t=27m56s

Notice how the floor suddenly changes from detailed patterns to dull stripes. That's because the floor is actually moving with the enemy, there's no split, but you can't tell because the pattern.