Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411621 Posts in 69391 Topics- by 58447 Members - Latest Member: sinsofsven

May 11, 2024, 04:10:49 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperArt (Moderator: JWK5)Help on understanding NES's graphic restrictions.
Pages: [1]
Print
Author Topic: Help on understanding NES's graphic restrictions.  (Read 6291 times)
Manuel Magalhães
Forum Dungeon Master
Level 10
*****



View Profile WWW
« on: May 02, 2012, 06:27:40 AM »

I've some questions about the NES' restrictions. I want to try to comply with all the (graphic) restrictions for AGBIC 2012, but I don't understand some of them:

-I don't understand what they mean by "scanline". Is every horizontal line a scanline?
-What is a "fade region"?
-Can a sprite have more than one palette?

Thanks in advance, and sorry if I'm sounding too dumb with all this. Smiley
Logged

Player 3
Level 10
*****


View Profile
« Reply #1 on: May 02, 2012, 06:38:34 AM »

- Yes. Every horizontal line is a scanline.
- Fade region? Searching only brings EVE Online crap.
- Yes, it can. But the same instance of a sprite can't have more than one palette.
  You can combine two sprites for more colors (I think the Mega Man games did that), but that takes away from    what you can use.
Logged
Manuel Magalhães
Forum Dungeon Master
Level 10
*****



View Profile WWW
« Reply #2 on: May 02, 2012, 08:38:17 AM »

Thanks. Smiley
Logged

Kramlack
Guest
« Reply #3 on: May 02, 2012, 01:25:18 PM »

I'll cover all the questions even though Player3 pretty much answered them all.

-I don't understand what they mean by "scanline". Is every horizontal line a scanline?
A scanline is every 1px tall line going all the way across the screen. Literally just like the lines in the effect of the same name. That's why there's so much flicker when there's a lot of action going on, on screen. Too many sprites on a scanline will cause the game to flicker between them.

-What is a "fade region"?
I actually don't know this one, but I'll ask Overkill about it since he's worked with the NES hardware, he might post in here and help you out.

-Can a sprite have more than one palette?
Yes and no. On the NES, you're only allowed four palettes for sprites and four palettes for tiles at a single time. You can change palette's on the fly, so you're not restricted to just 4 for the whole game, but as I said, you can only use four at a single time. To answer your question, a sprite can only have one palette, however, there's a trick that, if I remember correctly, was first used in Mega Man, where they'll put a sprite over top of another sprite. For Megaman, it was his skin tone and whites for the eyes I think, that went over top of the blue body. It's a bit hard to use because then you're using more sprites on screen, but it's a wonderful trick if used right.

If you're curious about 8bit restrictions, I like to think that I know a fair share about them, since Overkill and I are working on a GameBoy Color game together. You can feel free to PM either him or I if you want some detailed answers, I'm sure we'd be able to answer almost any question you have.
Logged
DavidCaruso
YEEEAAAHHHHHH
Level 10
*



View Profile
« Reply #4 on: May 02, 2012, 01:44:03 PM »

I think the "fade region" probably refers to the color emphasis bits:

Quote
Mask ($2001) > write

Is often referred as PPUMASK.

This register controls screen enable, masking, and intensity. Write $00 here if you want to turn rendering off so that you can update the pattern tables or nametables outside of vertical blanking. Write $1E when you're done to turn rendering back on. The other bits do special effects with the colors.

76543210
||||||||
|||||||+- Grayscale (0: normal color; 1: produce a monochrome display)
||||||+-- 1: Show background in leftmost 8 pixels of screen; 0: Hide
|||||+--- 1: Show sprites in leftmost 8 pixels of screen; 0: Hide
||||+---- 1: Show background
|||+----- 1: Show sprites
||+------ Intensify reds (and darken other colors)
|+------- Intensify greens (and darken other colors)
+-------- Intensify blues (and darken other colors)

http://wiki.nesdev.com/w/index.php/PPU_registers

Basically, by setting all three emphasis bits in this PPU register you can display a darker set of colors. (Or emphasize the color palette towards blue, green, red, etc. but the effect is kind of subtle when only one bit is set.) You can change the emphasis bits mid-rendering (e.g. during the HBlank event, which you can trigger at the end of every scanline), so a vertical third of the screen is displayed with regular colors, then the next third is darkened (or emphasized towards red/green/blue), then the next third is regular again, etc. Not many games used this that I know of, though, and on NES clones which use RGB it messes up badly (instead of darkening it sets the corresponding color channel to 255, which means setting all three turns everything to pure white), but for a PC title it probably isn't a huge concern. But

, a shitty practically unplayable Bible game which uses the grayscale bit combined with the blue emphasis bit to get a sort of water effect.

It's also possible, if you time it perfectly, to do things like e.g. change one color every scanline. It's a bit complicated since you have to reset the scrolling registers again every time or else you get artifacting, and all of this has to be done within the ~84 CPU cycles in HBlank before the next scanline starts rendering. Could use the concept for textboxes or something easily, though (where scrolling isn't an issue.)
« Last Edit: May 02, 2012, 01:52:44 PM by DavidCaruso » Logged

Steel Assault devlog - NES-style 2D action platformer: successfully Kickstarted!
Kramlack
Guest
« Reply #5 on: May 02, 2012, 02:27:29 PM »

@DavidCaruso: You and I should do a sex some time, I'll bring the pixels.
Logged
Manuel Magalhães
Forum Dungeon Master
Level 10
*****



View Profile WWW
« Reply #6 on: May 02, 2012, 02:40:01 PM »

@Kramlack Thanks for your insightful info, Kramlack. It cleared up some confusion I had about palette use. And thanks for the help offer. Smiley

@DavidCaruso Useful data. I'm surprised that it wasn't used more often, as it looks like a really nice trick when well used.
Logged

Robotwo
Level 2
**


I'm a complicated being after all


View Profile
« Reply #7 on: May 02, 2012, 02:49:46 PM »

@DavidCaruso: You and I should do a sex some time, I'll bring the pixels.

This shipping is now canon, may the R34 commence  Giggle
Logged

What we are is simply a stepping stone to what we can become
Kramlack
Guest
« Reply #8 on: May 03, 2012, 11:45:26 AM »

@Manuel Magalhães: Another example of the colour changing technique is using it for gradients. Shameless plug to my old Devlog, but Overkill and I are actually using this trick. Originally though, I saw it used in an unreleased GameBoy Color game called Infinity, where it used colour changing once per scanline, like Caruso originally mentioned. Anyway, just keep in mind that while these tricks are hard to pull off, they're all very possible, in case anyone grills you saying gradients aren't doable, haha.

@Robotwo: Hm?

EDIT: OH YEAH! I just remembered something Overkill told me once. I hadn't heard about it before, so it might be news to you to, but with the NES, all tiles have to have black as one of their four colours. I can't remember why this is exactly, but that's why you see so much black in NES games.

Forget what I originally posted here, Overkill's corrected me saying tiles use three colours + a standard background colour, which was usually black for most games. Full response below;

Quote from: Overkill
No no. It's three colors + background color, but it's OFTEN black, because it's a common shade to want, since the background color appears in all four palettes. Some platform games use a sky color for the background color, like Mario 3. And an advantage of that is that they can move things from sprite to tile really easily, because color 0 is transparent when a sprite OR color 0 is the background color when a tile.
« Last Edit: May 03, 2012, 11:59:05 AM by Kramlack » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic