Level takes place on a screen

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

corlenbelspar
Posts: 22
Joined: Tue Jan 24, 2012 2:56 am

Level takes place on a screen

Post by corlenbelspar »

I was wondering if it were possible on the NES to have a level that takes place on a monitor screen in game. I've included a screenshot below to clarify what I mean.

Image

If not that way, is there any roundabout way to trick the NES to do it in a similar way without using sprites?
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

This should be possible if the background scrolls in 8/16 pixels increments (or if it doesn't scroll at all) in the horizontal direction at least.
Would not look very good though.
Useless, lumbering half-wits don't scare us.
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

You can draw the screen in a way that left-right edges aren't visible, so you won't need sprites to cover the edges.
corlenbelspar
Posts: 22
Joined: Tue Jan 24, 2012 2:56 am

Post by corlenbelspar »

Would I be able to have the monitor sides as tiles and smooth pixel by pixel scrolling if I made the game not draw the sides of the display of the level itself?

I would be OK with horizontal scroll regions for the top and bottom of the screen where it stays in place and displays the top and bottom of the monitor, but I would prefer if I could have the sides of the monitor in question as well.
Last edited by corlenbelspar on Tue Mar 20, 2012 2:38 am, edited 1 time in total.
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

Well, perharps you could make prescrolled graphics for the edges, and update it in the nametable every frame. But in this case you have to deal with attributes clash (can be avoided it if only one palette is used for the whole screen, think sepia style), and scroll update area will be visible, which is certainly looks bad.
corlenbelspar
Posts: 22
Joined: Tue Jan 24, 2012 2:56 am

Post by corlenbelspar »

I suppose I'll try it with sprites first and if I get too much sprite flicker I'll just forgo the sides of the monitor.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

A "monitor" screen with borders at left and right like the world map screens in Super Mario Bros. 3? That's certainly possible, though you'll lose a few sprites to drawing the border.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

You'd have to use a column of sprites on each side of your "screen" to allow the game window to scroll smoothly, effectively reducing the sprites-per-scanline limit to 6. Also, except for the parts drawn with sprites, the sides of the screen would have to be flat. If those limitations don't bother you, go ahead.
Roth
Posts: 400
Joined: Wed Aug 03, 2005 3:15 pm
Contact:

Post by Roth »

Bregalad wrote:This should be possible if the background scrolls in 8/16 pixels increments (or if it doesn't scroll at all) in the horizontal direction at least.
Would not look very good though.
For an idea of what this idea of Bregalad's would look like, here's a vid of something I worked on before:

http://blip.tv/slydogstudios/nes-homebr ... 00-5900509

Note that it's going by tile, so 8 pixels, not 16. The downside here is that each of these separate rows that move all keep the same attributes. This means you would have to move by 16, so moving each column over by two instead of one (16 instead of 8) to keep the attributes aligned. I think this would be too jumpy, personally.

Tokumaru's idea is probably the closest you could get, but as he said, it is very, very limiting also. It might even take too many sprites just trying to cover the sides so as to not leave you with enough to work with. It depends on the design of the overall game, I suppose.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Roth wrote:Tokumaru's idea is probably the closest you could get, but as he said, it is very, very limiting also. It might even take too many sprites just trying to cover the sides so as to not leave you with enough to work with.
I wouldn't use sprites to cover the whole area though... most of it would be background tiles (which means you'd have to clear columns of tiles as the screen scrolls, but if you use an unrolled loop this shouldn't take away a lot of precious VBlank time), the sprites would be there just to mask the transition between the flat area and the game window, which could be off by up to 7 pixels.

Image

Only the areas marked in red would have to be sprites. It's enough to draw some sort of trimming, and if you use 8x16 sprites there will be enough left for the game. There are certainly a number of undesirable limitations, but it might be possible to accommodate them in your design if you really need this effect.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

For those keeping count, tokumaru's mockup uses 22 sprites, leaving 42 left for the rest of the game.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Roth
Posts: 400
Joined: Wed Aug 03, 2005 3:15 pm
Contact:

Post by Roth »

tokumaru wrote:
Roth wrote:Tokumaru's idea is probably the closest you could get, but as he said, it is very, very limiting also. It might even take too many sprites just trying to cover the sides so as to not leave you with enough to work with.
I wouldn't use sprites to cover the whole area though... most of it would be background tiles (which means you'd have to clear columns of tiles as the screen scrolls, but if you use an unrolled loop this shouldn't take away a lot of precious VBlank time), the sprites would be there just to mask the transition between the flat area and the game window, which could be off by up to 7 pixels.

Image

Only the areas marked in red would have to be sprites. It's enough to draw some sort of trimming, and if you use 8x16 sprites there will be enough left for the game. There are certainly a number of undesirable limitations, but it might be possible to accommodate them in your design if you really need this effect.
How does that work? I was sitting here thinking it was to cover the sides because the whole middle would be scrolling. Is there some kind of "nametable showing through in another nametable" trick that I don't know of?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Whenever the screen scrolls 8 pixels, a blank column would be written at the trailing edge (under the sprite column) and the column of newly visible tiles would be written at the leading edge (under the other sprite column).
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Yeah, no trick. Like tepples said, just as a part of the level is about to appear from below the sprites on the trailing edge when the screen scrolls, that column is blanked out, so it becomes part of the border.

Another limitation I just thought of is that the border color would either have to be color 0 or be present in every palette.

Given all the limitations, I'd consider this for special parts of a game, but not the entire thing.
3gengames
Formerly 65024U
Posts: 2281
Joined: Sat Mar 27, 2010 12:57 pm

Post by 3gengames »

Not to be mean...but...

Image
Post Reply