Using window/shape mask directly on the background colour . . .

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Using window/shape mask directly on the background colour . . .

Post by Pokun »

OK that sounds kinda like the Gameboy's window which can only grow out from the bottom and right edges and is also kinda like a FIX layer (in that it can't scroll), it is a true separate tiled layer however.
Does the MD window have its own nametable like the Gameboy one do?


Yeah on the SNES each BG layer can scroll independently from each others and have their own separate tilesets.

The Gameboy window isn't affected by the BG's scrolling so it's basically a true second tiled layer, but it's limited in that it can't scroll other than being moved out of the screen downwards and rightwards, but not upwards nor leftwards for whatever reason.
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: Using window/shape mask directly on the background colour . . .

Post by turboxray »

iNCEPTIONAL wrote: Wed Jun 29, 2022 2:04 pm It's a pretty interesting way of doing that effect in TMNT, and also impressive that it's never obvious during actual play that the character being thrown into the screen is limited by the three colours per tile restriction of layer 3. A novel and effective solution, and something that would be hard to do on Genesis, especially given two full backgrounds and even part of background 3 are normally used for the levels and overlaid HUD in the SNES game. You'd have to waste a lot of sprites to do the same thing on Genesis, and it would probably cause a lot of flicker at times too. I guess that's why we never saw the effect in the Genesis version (and also why the HUD there is in a big black bar). Bonus point to SNES right there.
I always thought it was obvious. The colors are low, the snes has three layers, etc. Honestly don't know why konami wasted that much vram. Could have easily used hDMA effect on it and stored less tiles. It's not like anything else happens when this animations plays.

The effect is totally doable on the Genesis. Albeit not the same way. I mean I did for PCE, so I know it's possible on Genesis. One, sprites underneath it won't show for the large frame, and any sprites on the surrounding area.. might blank out if you used ALL sprites. Not a big deal, but rather.. the edges the of the large frame should be sprites, and all internal parts are just BG tiles with sprites clipped out. On Genesis, I'm sure you could just set high tile priority on the map instead of doing a manual clipping across all sprites. Anyway, it's doable. Just requires extra thought put into it.
iNCEPTIONAL

Re: Using window/shape mask directly on the background colour . . .

Post by iNCEPTIONAL »

turboxray wrote: Wed Jun 29, 2022 7:23 pm
iNCEPTIONAL wrote: Wed Jun 29, 2022 2:04 pm It's a pretty interesting way of doing that effect in TMNT, and also impressive that it's never obvious during actual play that the character being thrown into the screen is limited by the three colours per tile restriction of layer 3. A novel and effective solution, and something that would be hard to do on Genesis, especially given two full backgrounds and even part of background 3 are normally used for the levels and overlaid HUD in the SNES game. You'd have to waste a lot of sprites to do the same thing on Genesis, and it would probably cause a lot of flicker at times too. I guess that's why we never saw the effect in the Genesis version (and also why the HUD there is in a big black bar). Bonus point to SNES right there.
I always thought it was obvious. The colors are low, the snes has three layers, etc. Honestly don't know why konami wasted that much vram. Could have easily used hDMA effect on it and stored less tiles. It's not like anything else happens when this animations plays.

The effect is totally doable on the Genesis. Albeit not the same way. I mean I did for PCE, so I know it's possible on Genesis. One, sprites underneath it won't show for the large frame, and any sprites on the surrounding area.. might blank out if you used ALL sprites. Not a big deal, but rather.. the edges the of the large frame should be sprites, and all internal parts are just BG tiles with sprites clipped out. On Genesis, I'm sure you could just set high tile priority on the map instead of doing a manual clipping across all sprites. Anyway, it's doable. Just requires extra thought put into it.
Sure you did. When you played that game originally and saw the character flying towards the screen as a cool effect for a couple of frames every once in a while during the kickass beat 'em up action, you were like "Why is he is so low colour?". I totally believe you.

And everything is doable if you don't mind the compromises. The SNES can display 3D games as complex as Genesis--if you don't mind them moving at 1fps. So yeah, Genesis technically can do the effect, but SNES can do it at the same time as displaying two full-screen fully-overlapping background layers, far more colours onscreen total, potentially some semi-transparency, a proper overlaid HUD (not in a big black bar), and no sprites have to be dropped out. It's just like how SNES can technically show as many enemies onscreen as any Genesis beat 'em up, technically more even, IF you don't mind potentially a bit/a lot of dropout and visual glitching. So, caveats, I guess.
crabking
Posts: 7
Joined: Thu Jun 30, 2022 5:13 am

Re: Using window/shape mask directly on the background colour . . .

Post by crabking »

turboxray wrote: Wed Jun 29, 2022 7:23 pm
iNCEPTIONAL wrote: Wed Jun 29, 2022 2:04 pm It's a pretty interesting way of doing that effect in TMNT, and also impressive that it's never obvious during actual play that the character being thrown into the screen is limited by the three colours per tile restriction of layer 3. A novel and effective solution, and something that would be hard to do on Genesis, especially given two full backgrounds and even part of background 3 are normally used for the levels and overlaid HUD in the SNES game. You'd have to waste a lot of sprites to do the same thing on Genesis, and it would probably cause a lot of flicker at times too. I guess that's why we never saw the effect in the Genesis version (and also why the HUD there is in a big black bar). Bonus point to SNES right there.
I always thought it was obvious. The colors are low, the snes has three layers, etc. Honestly don't know why konami wasted that much vram. Could have easily used hDMA effect on it and stored less tiles. It's not like anything else happens when this animations plays.

The effect is totally doable on the Genesis. Albeit not the same way. I mean I did for PCE, so I know it's possible on Genesis. One, sprites underneath it won't show for the large frame, and any sprites on the surrounding area.. might blank out if you used ALL sprites. Not a big deal, but rather.. the edges the of the large frame should be sprites, and all internal parts are just BG tiles with sprites clipped out. On Genesis, I'm sure you could just set high tile priority on the map instead of doing a manual clipping across all sprites. Anyway, it's doable. Just requires extra thought put into it.
El Viento uses a similar effect for in game explosions.
Image
Image
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Using window/shape mask directly on the background colour . . .

Post by TmEE »

Pokun wrote: Wed Jun 29, 2022 5:07 pmDoes the MD window have its own nametable like the Gameboy one do?
Yes, it has its own fixed size tilemap (32x32 in H256 and 64x32 in H320)
iNCEPTIONAL

Re: Using window/shape mask directly on the background colour . . .

Post by iNCEPTIONAL »

TmEE wrote: Thu Jun 30, 2022 7:54 am
Pokun wrote: Wed Jun 29, 2022 5:07 pmDoes the MD window have its own nametable like the Gameboy one do?
Yes, it has its own fixed size tilemap (32x32 in H256 and 64x32 in H320)
Does the window tilemap use a different tileset from the background that the window is part of, or do they still both share the single tileset?
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Using window/shape mask directly on the background colour . . .

Post by TmEE »

On MD there are no tile addressing limitations aspect like on SNES, so all of VRAM is usable for every layer (including parts used up by tilemaps and other non-GFX data structures). BG layers, window and sprites can share and reuse all of the tiles. In my very slowly work in progress game I even arranged BG tiles to use same ordering as sprites do so that I can use BG tiles with a 16x16 sprite as additional gamepla elements if the need comes up.
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: Using window/shape mask directly on the background colour . . .

Post by turboxray »

iNCEPTIONAL wrote: Thu Jun 30, 2022 12:41 am Sure you did. When you played that game originally and saw the character flying towards the screen as a cool effect for a couple of frames every once in a while during the kickass beat 'em up action, you were like "Why is he is so low colour?". I totally believe you.
Some of us have been coding since we were kids (I was). Even my non-programming friends were talking about it. We had VHS recordings back then that we made ourselves of the game, as well magazine scans (to look at still frames). And yes, the low colors was observed for that frame. We had technical debates; one of my friends was trying to say that it was mode-7. El Viento on the Genesis was used to prove that it didn't need mode-7 for that type of effect. And that a solid-ish color backdrop wasn't used during that effect, so it wasn't mode-7 (dead giveaway). And yes, this was back in the day. My point is, yeah we didn't know the system in-depth like today, but we were very technically aware and had related programming experience. Just because you didn't come from that kind of environment and understanding, does mean others didn't.

And everything is doable if you don't mind the compromises. The SNES can display 3D games as complex as Genesis--if you don't mind them moving at 1fps. So yeah, Genesis technically can do the effect, but SNES can do it at the same time as displaying two full-screen fully-overlapping background layers, far more colours onscreen total, potentially some semi-transparency, a proper overlaid HUD (not in a big black bar), and no sprites have to be dropped out.
I'm talking about what the game is doing - and if other systems can also do it. So I'm not sure what any of that has to do with my point.

Just so you understand.. El Viento did exactly what you see in SNES Turtles in Time, and what I was talking about. And actually it did more with that effect, years before. SNES doesn't have the sprite screen coverage for that 16x16|8x8 mode (as well sprite vram constraints), so it's not even an option to use that along with advance sprite culling method - that doesn't mean it's not an avenue for other systems. Anyway, the point is that it can be done, and look near indistinguishable, if not exactly the same other systems.. and even the potential to look better (more detail/color).

It's just like how SNES can technically show as many enemies onscreen as any Genesis beat 'em up, technically more even, IF you don't mind potentially a bit/a lot of dropout and visual glitching. So, caveats, I guess.
That is definitely not a true statement. I know you've been following my sprite line optimization tweets. I should probably do something similar for the SNES, but overall sprites, to dispel some of the myths about "128 sprites" advantages of the SNES.
iNCEPTIONAL

Re: Using window/shape mask directly on the background colour . . .

Post by iNCEPTIONAL »

TmEE wrote: Thu Jun 30, 2022 8:29 am On MD there are no tile addressing limitations aspect like on SNES, so all of VRAM is usable for every layer (including parts used up by tilemaps and other non-GFX data structures). BG layers, window and sprites can share and reuse all of the tiles. In my very slowly work in progress game I even arranged BG tiles to use same ordering as sprites do so that I can use BG tiles with a 16x16 sprite as additional gamepla elements if the need comes up.
Well, it's more versatile for sure, but most of the time you don't use the same tiles for a background on the characters and/or HUD too, usually, so it generally translates into one element comes at the cost of the other and it's ultimately a balancing act. But good on you if you've pushed the limits and got the most out of it to achieve things 99.9% of others haven't.
iNCEPTIONAL

Re: Using window/shape mask directly on the background colour . . .

Post by iNCEPTIONAL »

turboxray wrote: Thu Jun 30, 2022 9:50 am
iNCEPTIONAL wrote: Thu Jun 30, 2022 12:41 am Sure you did. When you played that game originally and saw the character flying towards the screen as a cool effect for a couple of frames every once in a while during the kickass beat 'em up action, you were like "Why is he is so low colour?". I totally believe you.
Some of us have been coding since we were kids (I was). Even my non-programming friends were talking about it. We had VHS recordings back then that we made ourselves of the game, as well magazine scans (to look at still frames). And yes, the low colors was observed for that frame. We had technical debates; one of my friends was trying to say that it was mode-7. El Viento on the Genesis was used to prove that it didn't need mode-7 for that type of effect. And that a solid-ish color backdrop wasn't used during that effect, so it wasn't mode-7 (dead giveaway). And yes, this was back in the day. My point is, yeah we didn't know the system in-depth like today, but we were very technically aware and had related programming experience. Just because you didn't come from that kind of environment and understanding, does mean others didn't.

And everything is doable if you don't mind the compromises. The SNES can display 3D games as complex as Genesis--if you don't mind them moving at 1fps. So yeah, Genesis technically can do the effect, but SNES can do it at the same time as displaying two full-screen fully-overlapping background layers, far more colours onscreen total, potentially some semi-transparency, a proper overlaid HUD (not in a big black bar), and no sprites have to be dropped out.
I'm talking about what the game is doing - and if other systems can also do it. So I'm not sure what any of that has to do with my point.

Just so you understand.. El Viento did exactly what you see in SNES Turtles in Time, and what I was talking about. And actually it did more with that effect, years before. SNES doesn't have the sprite screen coverage for that 16x16|8x8 mode (as well sprite vram constraints), so it's not even an option to use that along with advance sprite culling method - that doesn't mean it's not an avenue for other systems. Anyway, the point is that it can be done, and look near indistinguishable, if not exactly the same other systems.. and even the potential to look better (more detail/color).

It's just like how SNES can technically show as many enemies onscreen as any Genesis beat 'em up, technically more even, IF you don't mind potentially a bit/a lot of dropout and visual glitching. So, caveats, I guess.
That is definitely not a true statement. I know you've been following my sprite line optimization tweets. I should probably do something similar for the SNES, but overall sprites, to dispel some of the myths about "128 sprites" advantages of the SNES.
Yeah, so in reality you almost certainly didn't notice the limitations during normal play, but you dug into the game and learned how it was actually done and then noticed these things. You understood how it was done and could see behind the magic curtain after studying how it was done--go figure. Or you can continue to sell me your narrative that I simply do not believe. Trying to convince me you were playing that game normally and could tell at a glance that the character was limited to three colours per tile is more embarrassing and insulting to you than me.

Like I said, you can obviously do it in some other way, but it's also a hack on Genesis and costs something itself--the magical Genesis isn't perfect you know, no matter how much you seem to want to believe it. The Genesis has its own limitations, and even if it hurts you to think it, the SNES actually has some advantages over the Genesis (and visa versa, obviously). So, yeah, you can show pretty much no other visible enemies while the dude is zoomed in right up at the screen and it's not that noticeable, but SNES can do it with the enemies all there. It is what it is. No matter how you wangle it, I think the SNES has the advantage here when doing that particular effect. And, just like you can problem solve to do it on Genesis, maybe even better in some ways than the current SNES method, I have literally zero doubt someone could go even further with the SNES version similarly. But, what you can never do on Genesis is have two fully overlapping backgrounds at the same time as a fully overlaid HUD at the same time as that character zoomed all the way in at the same times as all the enemies being onscreen too (visible or behind the zoomed enemy or not) at the same colour level as SNES is capable of and potentially with some transparency too--and that's just a fact.

Well, I literally just asked that sprite limit thing in another thread and was told the SNES can in fact do 128 sprites of any size [up to 64x64] onscreen (ignoring the patent flickering and drop-out that would occur beyond a certain number at a certain size, and the almost inevitable slowdown too). So, if the SNES can in fact technically do 128 64x64 sprites, even with a crap-load of flicker and drop-out and slowdown, that is matter of fact beyond the Genesis max 80 32x32 sprites, even if it can or can't do that without any flicker or drop-out or slowdown. 128 64x64 objects is definitely more than 80 32x32 objects. So unless I'm being lied to, what I just said is technically true, as meaningless as it is in any real world application. But that Turtles in Time Arcade Edition on SNES does have up to eleven characters onscreen at one time for sure (I counted them with my own eyes, one Turtle plus ten Foot Solider enemies, with, admittedly, a lot of flicker and drop-out at that number, but not much at all when there's seven enemies), so that already shows the SNES is at least more capable than most people seem to think (most Genesis fanboys honestly believe the SNES can't put more than four enemies onscreen--why am I even surprised that they still believe such rubbish at this point--even though the normal Turtles in Time has up to nine enemies onscreen on very rare occasions, although smaller robot dog ones mixes with normal Foot Clan ones).

And I'll just post this here: viewtopic.php?p=279342#p279342 (Thanks 93143 for that)

PS. There isn't always just as solid-ish colour behind to give away that Mode 7 is being used:
https://youtu.be/tVg8m_BYqcw?t=27
https://youtu.be/BSLhSJLtXCE?t=435
https://youtu.be/AKn_lhmspzk?t=267
https://youtu.be/Tl7D25I6yDc?t=4364
https://youtu.be/FVbcK9RAWOw?t=99
https://youtu.be/oiydgb5iQA4?t=63
https://youtu.be/ppW9FIyXhqo?t=5(I think)
https://youtu.be/KHf1_Pk5pqU?t=743
https://youtu.be/Upr-KNWeZjs?t=339
https://youtu.be/Z5AC80K5JtI?t=2694
https://youtu.be/wpz0xxjZuCw?t=1508
https://youtu.be/iIvZNcicyM0?t=6608
https://youtu.be/b-1cHogqQTI?t=288 (the level and boss)
https://youtu.be/ATW5uBC62vE?t=1466
https://youtu.be/sRBX2GbGr2M
https://youtu.be/U8btNneN8ew?t=20145
https://youtu.be/spVwBD6NOVI?t=4
https://youtu.be/L8dpxGu8AzY (basically the entire game)

That's just a few examples.

Just like with Genesis, in the right hands the SNES can be made to do some tricks most people don't think are possible.
Last edited by iNCEPTIONAL on Thu Jun 30, 2022 12:24 pm, edited 13 times in total.
crabking
Posts: 7
Joined: Thu Jun 30, 2022 5:13 am

Re: Using window/shape mask directly on the background colour . . .

Post by crabking »

iNCEPTIONAL wrote: Thu Jun 30, 2022 10:03 am Well, I literally just asked that sprite limit thing in another thread and was told the SNES can in fact do 128 sprites of any size [up to 64x64] onscreen (ignoring the patent flickering and drop-out that would occur beyond a certain number at a certain size, and the almost inevitable slowdown too). So, if the SNES can in fact technically do 128 64x64 sprites, even with a crap-load of flicker and drop-out and slowdown, that is matter of fact beyond the Genesis max 80 32x32 sprites, even if it can or can't do that without any flicker or drop-out or slowdown. 128 64x64 objects is definitely more than 80 32x32 objects. So unless I'm being lied to, what I just said is technically true, as meaningless as it is in any real world application. But that Turtles in Time Arcade Edition on SNES does have up to eleven characters onscreen at one time for sure (I counted them with my own eyes, one Turtle plus ten enemies, with, admittedly, a lot of flicker and drop-out at that number, but not much at all when there's seven enemies), so that already shows the SNES is at least more capable than most people seem to think (most Genesis fanboys honestly believe the SNES can't put more than four enemies onscreen--why am I even surprised that they still believe such rubbish at this point--even though the normal Turtles in Time has up to nine enemies onscreen on very rare occasions, although smaller robot dog ones mixes with normal Foot Clan ones).
Wait, am i reading correctly?

As Snes can display 128 simultaneous 64 x 64 sprites, if the screen resolution only support 16 of them?
iNCEPTIONAL

Re: Using window/shape mask directly on the background colour . . .

Post by iNCEPTIONAL »

crabking wrote: Thu Jun 30, 2022 11:28 am
iNCEPTIONAL wrote: Thu Jun 30, 2022 10:03 am Well, I literally just asked that sprite limit thing in another thread and was told the SNES can in fact do 128 sprites of any size [up to 64x64] onscreen (ignoring the patent flickering and drop-out that would occur beyond a certain number at a certain size, and the almost inevitable slowdown too). So, if the SNES can in fact technically do 128 64x64 sprites, even with a crap-load of flicker and drop-out and slowdown, that is matter of fact beyond the Genesis max 80 32x32 sprites, even if it can or can't do that without any flicker or drop-out or slowdown. 128 64x64 objects is definitely more than 80 32x32 objects. So unless I'm being lied to, what I just said is technically true, as meaningless as it is in any real world application. But that Turtles in Time Arcade Edition on SNES does have up to eleven characters onscreen at one time for sure (I counted them with my own eyes, one Turtle plus ten enemies, with, admittedly, a lot of flicker and drop-out at that number, but not much at all when there's seven enemies), so that already shows the SNES is at least more capable than most people seem to think (most Genesis fanboys honestly believe the SNES can't put more than four enemies onscreen--why am I even surprised that they still believe such rubbish at this point--even though the normal Turtles in Time has up to nine enemies onscreen on very rare occasions, although smaller robot dog ones mixes with normal Foot Clan ones).
Wait, am i reading correctly?

As Snes can display 128 simultaneous 64 x 64 sprites, if the screen resolution only support 16 of them?
I guess it's called "overlapping" sprites. LOL It's not really practical at this number and size, and you'll get a crap-load of flickering and drop-out, but apparently it is technically possible. I mean, I'm just trusting what the programming wizards in here are telling me.
Last edited by iNCEPTIONAL on Thu Jun 30, 2022 11:53 am, edited 1 time in total.
crabking
Posts: 7
Joined: Thu Jun 30, 2022 5:13 am

Re: Using window/shape mask directly on the background colour . . .

Post by crabking »

iNCEPTIONAL wrote: Thu Jun 30, 2022 11:30 am
crabking wrote: Thu Jun 30, 2022 11:28 am
iNCEPTIONAL wrote: Thu Jun 30, 2022 10:03 am Well, I literally just asked that sprite limit thing in another thread and was told the SNES can in fact do 128 sprites of any size [up to 64x64] onscreen (ignoring the patent flickering and drop-out that would occur beyond a certain number at a certain size, and the almost inevitable slowdown too). So, if the SNES can in fact technically do 128 64x64 sprites, even with a crap-load of flicker and drop-out and slowdown, that is matter of fact beyond the Genesis max 80 32x32 sprites, even if it can or can't do that without any flicker or drop-out or slowdown. 128 64x64 objects is definitely more than 80 32x32 objects. So unless I'm being lied to, what I just said is technically true, as meaningless as it is in any real world application. But that Turtles in Time Arcade Edition on SNES does have up to eleven characters onscreen at one time for sure (I counted them with my own eyes, one Turtle plus ten enemies, with, admittedly, a lot of flicker and drop-out at that number, but not much at all when there's seven enemies), so that already shows the SNES is at least more capable than most people seem to think (most Genesis fanboys honestly believe the SNES can't put more than four enemies onscreen--why am I even surprised that they still believe such rubbish at this point--even though the normal Turtles in Time has up to nine enemies onscreen on very rare occasions, although smaller robot dog ones mixes with normal Foot Clan ones).
Wait, am i reading correctly?

As Snes can display 128 simultaneous 64 x 64 sprites, if the screen resolution only support 16 of them?
I guess it's called "overlaid" sprites. LOL It's not really practical, and you'll get a crap-load of flickering and drop-out, but apparently it is technically possible. I mean, I'm just trusting what the programming wizards in here are telling me.
Excuse guy, but this still doesn't make sense for me.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Using window/shape mask directly on the background colour . . .

Post by rainwarrior »

crabking wrote: Thu Jun 30, 2022 11:28 amAs Snes can display 128 simultaneous 64 x 64 sprites, if the screen resolution only support 16 of them?
Yes. You can fit 4 full 64x64 sprites on a line before tiles start dropping out from the 34-tiles-per-line limit. (Tiles are 8x8.)

They didn't intend for you to use all 128 sprites at that size, but a sprite is a sprite to the hardware, if you tell it to draw 128 sprites it will do as many as it can for each scanline and discard the rest. Same way it would have to discard some if you tried to put 128 8x8 sprites on a scanline.
crabking
Posts: 7
Joined: Thu Jun 30, 2022 5:13 am

Re: Using window/shape mask directly on the background colour . . .

Post by crabking »

rainwarrior wrote: Thu Jun 30, 2022 11:45 am
crabking wrote: Thu Jun 30, 2022 11:28 amAs Snes can display 128 simultaneous 64 x 64 sprites, if the screen resolution only support 16 of them?
Yes. You can fit 4 full 64x64 sprites on a line before tiles start dropping out from the 34-tiles-per-line limit. (Tiles are 8x8.)

They didn't intend for you to use all 128 sprites at that size, but a sprite is a sprite to the hardware, if you tell it to draw 128 sprites it will do as many as it can for each scanline and discard the rest. Same way it would have to discard some if you tried to put 128 8x8 sprites on a scanline.
Well yes, but considering that there is no practical application in a game situation, i wouldn't call it an "advantage".
Post Reply