It is currently Thu Oct 19, 2017 1:18 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 55 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: Sun Jan 25, 2015 7:06 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
Hi, I'm new here, so apologies if my questions at times seem basic.

I'm working on a platformer and would like to emulate the NES' graphical capabilities within the abilities of the MMC5 chip. The actual game is programmed in a modern engine, but using tiles and so on.

I was wondering that if you split the screen, or use some other technique like raster split, you would gain another set of colours for those tiles?

Something like below, where the screen is somehow split at the water line and uses the second palette there.

Image


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 7:20 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
This is really lazy of me, but the topic "Questions about NES Graphics Limitations" has some information regarding it on page 2.


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 7:25 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
You can't "gain a new palette", but you can use split-screen to change the palette in $3Fxx to new values "mid-screen" so that you have more actual colour choices to work with from that scanline onward. However, be aware: doing this on a NES tends to be somewhat tricky/temperamental, as it's very timing-sensitive and depending on what mapper you use may cause things like a scanline of corruption and/or flicker (really depends on timing). There are commercial games which do this (I think Wizards & Warriors is one of them[1]).

I often tell people developing games on non-NES consoles this: if you want to make a game that's "like" the NES in graphical style, go right ahead. But unless you absolutely no-questions-asked plan on making the game for the actual NES itself, there's really no reason to limit yourself to how the system behaves or how some of the mappers are implemented (ex. MMC5's graphical extensions, scanline/IRQ counter, etc.); just make the game you want and make it look like whatever style you want.

A great present-day example of this is Shovel Knight, where the graphics are "NES-like" but wouldn't work flawlessly if the game were actually designed on the NES (it would work fine on the SNES). On the other hand, the music done by Jake Kaufman/Virt and Manami MATSUME was actually composed in FamiTracker (I believe) and thus is 100% natively available on a NES (more specifically: on an actual Famicom -- the music uses Konami's VRC6 mapper, whose audio capabilities would not work on a non-modded NES). The MP3/in-game versions sound more "full" or "fat" because of post-mixing (ask Jake, he can tell you :-) ). NSF is available here (read text): http://virt.bandcamp.com/album/shovel-k ... soundtrack

[1]: If we (the royal "we") don't already have a section on the nesdev Wiki listing off games which do this, we should make one. Having a list, similar in concept to our sprite overflow page, would be beneficial.


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 7:32 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10059
Location: Rio de Janeiro - Brazil
The NES isn't very friendly with mid-screen palette changes. Fact is you can turn rendering off mid-screen, upload a new set of palettes, reset the scroll to the proper location, and enable rendering back on (rendering would have to be disabled for more than 1 scanline depending on how many colors you need to change). There are a few problems with this approach though:

Both the background and the sprites have to be disabled so you can write to the palette, otherwise the PPU isn't actually resting and your VRAM accesses will clash with the PPU's and you'll get all sorts of corrupted graphics. The second issue is that while rendering is off and the PPU address is pointing to the palette area, the color being pointed gets rendered, which means that you'll get a rainbow-like effect in the scanlines where the updates are taking place. This effect can be made less noticeable by turning grayscale mode on, so you'll see a few grays instead of rainbows, but it's still weird. The final issue I can think of, is that disabling sprites mid-frame is a risky task. If it's not done at a precise time or when the sprites are arranged in a certain way, you might get corrupted sprites the next frame or when they are re-enabled.

In conclusion, the short answer is no, you can't get a clean split like in your mock-ups.

If the water is not moving up and down, the safest thing to do is to simply sacrifice 1 of the palettes for all the underwater stuff. If the water does move up and down, one thing to consider are the color emphasis bits: the PPU has 3 bits you can change at any time that will emphasize the red, green or blue (or combinations of those colors) in the entire palette. You could emphasize the blue for the underwater sections, but the effect is much more subtle than in your mock-ups. To make this effect more harsh, you can simultaneously turn on the grayscale mode and the blue emphasis, which is what the game Noah's Ark does. The good think about these settings is that they can be changed freely at any time without messing the the rendering process. Keep in mind that they affect all colors, even sprites.


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 7:41 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 936
koitsu wrote:
[1]: If we (the royal "we") don't already have a section on the nesdev Wiki listing off games which do this, we should make one. Having a list, similar in concept to our sprite overflow page, would be beneficial.

[quote=
Tricky-to-emulate games on Nesdev Wiki wrote:
*Crystalis, Fantastic Adventures of Dizzy, Fire Hawk, and Super Off Road do mid-frame palette changes.


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 10:28 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
koitsu wrote:
You can't "gain a new palette", but you can use split-screen to change the palette in $3Fxx to new values "mid-screen" so that you have more actual colour choices to work with from that scanline onward.


Thanks so much for clarifying this. So basically I can change the shared colour only? (so from sky blue to white, but the other colours need to remain the same.) In theory this works and thats good enough for me.

koitsu wrote:
I often tell people developing games on non-NES consoles this: if you want to make a game that's "like" the NES in graphical style, go right ahead. But unless you absolutely no-questions-asked plan on making the game for the actual NES itself, there's really no reason to limit yourself to how the system behaves or how some of the mappers are implemented (ex. MMC5's graphical extensions, scanline/IRQ counter, etc.); just make the game you want and make it look like whatever style you want.


While I agree with you, on a personal note; I've been hammering away on pixel art on and off for most of my life. I have a relatively busy schedule these days so really I have just enough time to geek out on this one. I'd like to set myself a challenge, and learn more about the NES... then I'll probably break all the rules later ;)

koitsu wrote:
A great present-day example of this is Shovel Knight, where the graphics are "NES-like" but wouldn't work flawlessly if the game were actually designed on the NES (it would work fine on the SNES).


That game was awesome. Also an awesomely liberal use of the word 8-bit.

koitsu wrote:
On the other hand, the music done by Jake Kaufman/Virt and Manami MATSUME was actually composed in FamiTracker (I believe) and thus is 100% natively available on a NES (more specifically: on an actual Famicom -- the music uses Konami's VRC6 mapper, whose audio capabilities would not work on a non-modded NES). The MP3/in-game versions sound more "full" or "fat" because of post-mixing (ask Jake, he can tell you :-) ). NSF is available here (read text): http://virt.bandcamp.com/album/shovel-k ... soundtrack


This for me seemed a little strange. They started out with strict NES graphics, then changed to loosely authentic graphics, but the music stayed authentic when it could have done with the same liberties IMHO.

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 10:45 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
tokumaru wrote:
In conclusion, the short answer is no, you can't get a clean split like in your mock-ups.

Thanks for the insight here. I won't be emulating on real hardware, but if this was a real graphical technique that was tried back in the day I can roll with it.

tokumaru wrote:
If the water is not moving up and down, the safest thing to do is to simply sacrifice 1 of the palettes for all the underwater stuff. If the water does move up and down, one thing to consider are the color emphasis bits: the PPU has 3 bits you can change at any time that will emphasize the red, green or blue (or combinations of those colors) in the entire palette. You could emphasize the blue for the underwater sections, but the effect is much more subtle than in your mock-ups. To make this effect more harsh, you can simultaneously turn on the grayscale mode and the blue emphasis, which is what the game Noah's Ark does. The good think about these settings is that they can be changed freely at any time without messing the the rendering process. Keep in mind that they affect all colors, even sprites.


Originally I had just 13 colours with the blue (which included a white for the waves) and then on tiles that had no white (this posts) I was thinking to use a white sprite. Thanks so much for the video link, that is food for thought!

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 10:47 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6281
Location: Seattle
hawken wrote:
So basically I can change the shared colour only? (so from sky blue to white, but the other colours need to remain the same.) In theory this works and thats good enough for me.
You can change all the colors, but it will take some amount of vertical distance. You might want to read through Okk's thread.

For example, if you have the right edge of the scanline empty, you could probably update a single color for the next scanline. The title screen of Taito's Indiana Jones and the Last Crusade does this.
If you disable more time (for example, one entire blank line), you can update up to 16 colors.


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 10:57 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10059
Location: Rio de Janeiro - Brazil
hawken wrote:
koitsu wrote:
You can't "gain a new palette", but you can use split-screen to change the palette in $3Fxx to new values "mid-screen" so that you have more actual colour choices to work with from that scanline onward.


Thanks so much for clarifying this. So basically I can change the shared colour only?

No, that's not what he said. Note the "$3Fxx" in his post: the "xx" can be any address, meaning any color. Like I said in my post, you can change any of the colors, but several restrictions apply, and it's not possible to get a clean split. You can't have scanline 120 use a set of colors and scanline 121 use the same set but with 3 different colors. There has to be a "break" (no background or sprites at all) of 1 or more scanlines, because changing colors takes time, even if it's just 1 color. Plus the other few other "gotchas" that I mentioned in my post (colors get rendered as they are updated, disabling sprites can glitch them later).

All instances of mid-screen palette changes in commercial games I'm aware of take place between the gameplay window and the status bar, or other similar transitions, where there's a clear break between the areas using different palettes.


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 11:14 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
tokumaru wrote:
hawken wrote:
koitsu wrote:
You can't "gain a new palette", but you can use split-screen to change the palette in $3Fxx to new values "mid-screen" so that you have more actual colour choices to work with from that scanline onward.


Thanks so much for clarifying this. So basically I can change the shared colour only?

No, that's not what he said. Note the "$3Fxx" in his post: the "xx" can be any address, meaning any color. Like I said in my post, you can change any of the colors, but several restrictions apply, and it's not possible to get a clean split. You can't have scanline 120 use a set of colors and scanline 121 use the same set but with 3 different colors. There has to be a "break" (no background or sprites at all) of 1 or more scanlines, because changing colors takes time, even if it's just 1 color. Plus the other few other "gotchas" that I mentioned in my post (colors get rendered as they are updated, disabling sprites can glitch them later).

All instances of mid-screen palette changes in commercial games I'm aware of take place between the gameplay window and the status bar, or other similar transitions, where there's a clear break between the areas using different palettes.


Ah I see what you mean, so basically it can be done but you lose one row of tiles? That would be bad news for the graphics above. Maybe I should look at not splitting the screen.

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 11:25 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
Myask wrote:
koitsu wrote:
[1]: If we (the royal "we") don't already have a section on the nesdev Wiki listing off games which do this, we should make one. Having a list, similar in concept to our sprite overflow page, would be beneficial.

[quote=
Tricky-to-emulate games on Nesdev Wiki wrote:
*Crystalis, Fantastic Adventures of Dizzy, Fire Hawk, and Super Off Road do mid-frame palette changes.


Thanks for these links. Is this a Y or N?

I'll certainly give them a good read to see if any apply to my case.

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Top
 Profile  
 
PostPosted: Sun Jan 25, 2015 11:29 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
To be fair, 2 of the palettes for the bottom of the screen are exactly the same as the ones on the top, minus color 0. I wonder if it would be possible to at least just change color 0, or if you'd get the rainbow effect from switching from blue to white? By the looks of you're picture though, it appears that the BG color is being obscured by a darker blue for a gradient color, but I still don't know if you'd be able to update in time. You could always make the darker blue gradient start higher up.

Attachment:
Palette Transition.png
Palette Transition.png [ 338 Bytes | Viewed 2274 times ]


Top
 Profile  
 
PostPosted: Mon Jan 26, 2015 1:41 am 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
Espozo wrote:
To be fair, 2 of the palettes for the bottom of the screen are exactly the same as the ones on the top, minus color 0. I wonder if it would be possible to at least just change color 0, or if you'd get the rainbow effect from switching from blue to white? By the looks of you're picture though, it appears that the BG color is being obscured by a darker blue for a gradient color, but I still don't know if you'd be able to update in time. You could always make the darker blue gradient start higher up.

Attachment:
Palette Transition.png


Sounds interesting! I can make this blue go up, any guesses on how many vertical tile rows up from the change would I need to change colour 0 in theory? (if the tile rows didn't use colour 0) This can be theory only, as this won't run on an actual NES or emulator.

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Top
 Profile  
 
PostPosted: Mon Jan 26, 2015 2:15 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5718
Location: Canada
There are all sorts of permutations of weird technical possibilities that you could pull off on the NES, but a lot of them really aren't typical. Like, if you're trying to faithfully "fake" the look of an NES game, you probably don't want to be trying special tricks that aren't really part of the NES experience.

For instance, MMC5 8x8 pixel attributes were only used in 1 game, to my knowledge (Just Breed), and it was a Japan-only RPG. It's a thing you could technically pull off on an NES, but it's not characteristic of NES games at all. Part of the reason it wasn't used is that having 8x8 pixel granularity in the world can quadruple the complexity of your map (ROM size constraints, RAM constraints, extra collision tests required, etc.) so even if you had the special MMC5 hardware for 8x8 attributes, it's a significant burden on the NES to make a world that puts it to use!

A palette change for a status bar is an advanced and atypical technique. A clean palette change during normal background rendering is elite tier. Something like this usually comes with weird design constraints, and these are things you don't really consider when you're just looking at one technical issue; you only find them when you try to build a whole game. Suddenly you find this one technical feature you implemented is dictating how you have to design your maps, etc. A lot of these techniques aren't seen much for good reason (though sometimes it's just that we have better knowledge and tools now than back then).

An emphasis change like Noah's ark is fairly easy to implement. It's not typical, but it's very doable. Your water line has to be straight, this way, though.

Anyhow, I don't really understand the point of trying to push the NES graphical capabilites to the limit without actually using an NES. It doesn't matter what was technically possible or not. Just make a nice game, and if you like the NES look, imitate the parts of it that feel good to you, and ignore the rest. If it's important to you that it be NES-faithful, for some reason, you should probably stick to normal techniques that look and feel like real NES games, not technical obscurities... but... never mind my opinion. I don't know what motivates you. If you can make a good game out of it, do whatever suits you.


Top
 Profile  
 
PostPosted: Mon Jan 26, 2015 2:49 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Looking at the size of that map, it'd be probably better to just change the palettes as the camera moves around. It doesn't look like all palettes would be shown at once in the first place.

tokumaru wrote:
To make this effect more harsh, you can simultaneously turn on the grayscale mode and the blue emphasis, which is what the game Noah's Ark does.

Wait, how do the emphasis bits work? Because that looks a tad more washed out than I expected.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 55 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group