This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Strange character position in NES

Strange character position in NES
by on (#56716)
How come that in most NES games, the characters stand one pixel inside the ground?
Image
If I programmed a game, I would make them stand like this:
Image
This would look more realistic and it would be more logic since in this case, the character's Y location would be a value of (n * 16) and not (n * 16 + 1). But only in a few NES games does the characters stand above the ground. In most games, they stand inside the ground. Why is this the case?

by on (#56717)
I don't think it makes a significant difference. This might be because sprites automatically appear one pixel below the coordinate you specify, altough its really easy to correct it.

by on (#56718)
What do you mean, most? I bet for every game with one inside the ground you could find three more that are on top. I just checked Blaster Master and Castlevania 3 and they're fine. Kirby's Adventure isn't, but can you even tell?

Image

Most NES games have a one pixel border around characters and/or on the ground anyway, or have a "slanted" floor where they can place characters on any plane they want (River City Ransom, Battletoads, Prince of Persia). Even if the intent is for a perfectly horizontal view, one or two pixels do not ruin the game.

by on (#56719)
Dr. Mario and Tetris 2 both draw pieces one scanline below where they end up after they lock, but Tetris doesn't.

by on (#56720)
I think this is just a design choice, there is no technical reason for it to be either way.

by on (#56721)
The nes hardware draws all sprites one scanline lower then they're actually supposed to be. It's completely up to the game to compensate for this by removing 1 to the sprite Y coordinate, and some games just don't care. :P

by on (#56722)
I don't think it's possible that programmers weren't aware of this behavior. And it's something that's very easy to fix, no matter what kind of sprite rendering you use. Also, there are characters behaving like that in many other platforms, where the Y coordinate delay doesn't exist.

by on (#56726)
Well, keep in mind that logically, the Y position means one thing, whereas the Y position on the hardware physically results in another thing. Plus, there weren't HD TVs and LCD monitors back then, so the display was blurry enough to obscure this kind of a phenomenon.

Plus, it's not a gigantic problem by any means, so I wouldn't be surprised if it was just a trivial matter to most devs, i.e. not high up on the priority list to fix.

by on (#56727)
Drag wrote:
Plus, there weren't HD TVs and LCD monitors back then, so the display was blurry enough to obscure this kind of a phenomenon.

TVs back then were 480i. Atari 2600, NES, and the vast majority of Super NES and Genesis games run at 240p, which on a decent set will show dark spaces between the scanlines. (The "scanlines" effect in popular emulators simulates this.) If you can see the spaces between scanlines on a CRT, then you can certainly see whether Mario's feet are above or in a block, and you can definitely see whether small Mario's head grazes the block above him.

You might be confusing CRT blur with Game Boy LCD motion blur, where games could actually get away with updating OAM late *cough*Wario Land*cough* until Super Game Boy and Game Boy Pocket came out.

Quote:
Plus, it's not a gigantic problem by any means, so I wouldn't be surprised if it was just a trivial matter to most devs, i.e. not high up on the priority list to fix.

You're right that not all game designs depend on strict alignment between background and sprites because the collision isn't pixel-precise anyway.

by on (#56729)
tepples wrote:
You might be confusing CRT blur with Game Boy LCD motion blur, where games could actually get away with updating OAM late *cough*Wario Land*cough* until Super Game Boy and Game Boy Pocket came out.

What does Wario Land do wrong ? I'm fan of this game recently and I think it has some of the best graphics on the monochrome Gameboy I don't see any glitches (I use my GBA SP to play it).

And I'm pretty sure the Game Boy Pocket has terrible motion blur. I never use it because for most games it's impossible to see what is going on so much it's terrible. However the GBC and GBA has MUCH less motion blur, and the SGB of course doesn't have any (as it's connected to a TV).

by on (#56730)
Bregalad wrote:
What does Wario Land do wrong ?

Updates to the background position register are out of sync from updates to OAM, that's all. Run a Super Game Boy or a Game Boy Player (with motion blur set to "sharp") into a VCR, press record, and hit some blocks to expose power-ups, and walk back and forth under the power-ups. Once you've done this a few times, go back and play the tape, single-stepping through the section where you walked back and forth and paying attention to alignment between the powerups and the blocks they came out of. If you don't see it, the problem might have been fixed for the (E) release.

by on (#56731)
You know, I think I actually have my character in my game displayed one pixel in the ground. I do actually compensate for the sprite display error, so I think it's something just with the size of the bounding box. I'll have to check why I made the size of the bounding box a pixel less... I know there was a reason for it.

by on (#56732)
If you watch the bouncing question blocks in SMB1 though, you'd see that they are drawn one pixel lower than the logical animation would suggest.

by on (#56744)
Celius wrote:
You know, I think I actually have my character in my game displayed one pixel in the ground. I do actually compensate for the sprite display error, so I think it's something just with the size of the bounding box. I'll have to check why I made the size of the bounding box a pixel less... I know there was a reason for it.

If you program your sprite drawing routine for it, it could be faster to simply assume a sprite is at a nice even y value (when not in the air) rather than needing to subract 1 every single frame.

by on (#56747)
tepples wrote:
Dr. Mario and Tetris 2 both draw pieces one scanline below where they end up after they lock, but Tetris doesn't.


I thought Dr. Mario did that on purpose so you could clearly see when the piece has "set".

I always hated when I thought a piece has set and I try moving the next upcoming piece, only to find the piece didn't set yet and I just moved it and screwed myself. Happens to me ALL THE TIME in Tetris, but never happens to me in Dr. Mario.

by on (#56751)
tepples wrote:
Updates to the background position register are out of sync from updates to OAM, that's all. Run a Super Game Boy or a Game Boy Player (with motion blur set to "sharp") into a VCR, press record, and hit some blocks to expose power-ups, and walk back and forth under the power-ups. Once you've done this a few times, go back and play the tape, single-stepping through the section where you walked back and forth and paying attention to alignment between the powerups and the blocks they came out of. If you don't see it, the problem might have been fixed for the (E) release.

You're right, no it haven't be fixed for the (E) release.
Quote:
If you program your sprite drawing routine for it, it could be faster to simply assume a sprite is at a nice even y value (when not in the air) rather than needing to subract 1 every single frame.

Well I don't know for other games but in my game I have a releative Y coordinate for all sprites in a metasprite (and the game engine always draws metasprites, no sprites) so substracting 1 from it won't change anything to the speed (and I think most games hanldes it the same way as I do).

by on (#56752)
Dwedit wrote:
If you watch the bouncing question blocks in SMB1 though, you'd see that they are drawn one pixel lower than the logical animation would suggest.

Another strangeish thing is that when the mushroom comes out of the box, it will stay on top of the box for couple of frames and then sink 1 pixel in to the box.

by on (#56758)
Bregalad wrote:
Well I don't know for other games but in my game I have a releative Y coordinate for all sprites in a metasprite (and the game engine always draws metasprites, no sprites) so substracting 1 from it won't change anything to the speed (and I think most games hanldes it the same way as I do).

I do to. What I meant was you can check that relative data for zeroes and if so, skip the add. Or would that "beq" slow down the process enough that it wouldn't be worth the savings? My relative coords have zeroes in them quite often.

by on (#56762)
Disch wrote:
I thought Dr. Mario did that on purpose so you could clearly see when the piece has "set".

Some Tetris games visually indicate lockdown by making the active piece brighter (PC Tetris 3.12, Tetris The Grand Master) or changing the texture (Tetris for SNES, Bombliss/Tetris Blast, LJ65) or flashing it white (Tetris The Grand Master). Lockjaw for PC can actually be set up to do all three.

Quote:
I always hated when I thought a piece has set and I try moving the next upcoming piece, only to find the piece didn't set yet and I just moved it and screwed myself.

Inadvertent slides are sometimes called "jiznickery". They happen more often in games with a fairly long lock delay but no manual lock, such as The New Tetris for N64.

Quote:
Happens to me ALL THE TIME in Tetris, but never happens to me in Dr. Mario.

Another thing that helps is that Dr. Mario has ARE. This slows the game down, but it provides a clean break between one piece and the next. Some games (TGM, Tetris DS, LJ65) have "manual lock", where the player can press Down once the piece has landed to cause the piece to lock down immediately. Other games (Tetris 3.12, Tetris Worlds, Tetris DS, Tetris Party, Dr. Mario Online Rx, LJ65) have "hard drop", allowing the player to move a piece down as far as it can go and lock it into place immediately with one press.

Enough Tetris, let's get back to sprite rendering:

UncleSporky wrote:
What I meant was you can check that relative data for zeroes and if so, skip the add. Or would that "beq" slow down the process enough that it wouldn't be worth the savings?

It wouldn't be worth it.

by on (#56793)
UncleSporky wrote:
What do you mean, most? I bet for every game with one inside the ground you could find three more that are on top.

O.k., I don't really know which ones are more, but to me it seems that the inside-object-games are more.

UncleSporky wrote:
I just checked Blaster Master and Castlevania 3 and they're fine.

Blaster Master yes. But Castlevania 1 and 3 are a strange thing: O.k., it looks like they stand above the ground:
Image
But if you duck, you see that the sprite is really inside the ground:
Image
That's because the 32 pixel high sprite is drawn like that:
Image
rather than that:
Image

UncleSporky wrote:
Kirby's Adventure isn't, but can you even tell?

Yes, you can:
Image

Drag wrote:
The nes hardware draws all sprites one scanline lower then they're actually supposed to be.

Why is this the case?

Also, there are games where the character starts above the ground, but fall into it when he moves (i.e. "Metroid").

by on (#56794)
JohnJohn wrote:
Drag wrote:
The nes hardware draws all sprites one scanline lower then they're actually supposed to be.

Why is this the case?

Because the NES evaluates which sprites it's supposed to draw in one scanline but only draws them on the next one (when it'll will be evaluating the the next sprites to draw and so on).

I don't know why Nintendo couldn't use an internal counter that was one step ahead (or why they didn't give us access to this counter, which would be much more useful than sprite 0 hits), so that sprites were drawn exactly where told.

by on (#56797)
tokumaru wrote:
I don't know why Nintendo couldn't use an internal counter that was one step ahead (or why they didn't give us access to this counter, which would be much more useful than sprite 0 hits), so that sprites were drawn exactly where told.

Probably patents. Consider that in the 8-bit era, the general concept of a video game itself was patented, and you'll understand how patents on basic raster graphics rendering techniques might have required crazy workarounds.

by on (#56805)
JohnJohn wrote:
UncleSporky wrote:
Kirby's Adventure isn't, but can you even tell?

Yes, you can:
Image

No, you can't. Not during normal play when such things might actually matter. We're not talking about this sort of thing:

Image

Which wouldn't even be that bad if the game was designed that way.

The fact that Castlevania really is off by one but is only noticeable on close inspection further illustrates that this does not matter from a gameplay perspective. And we've already seen why and how it is dealt with from a programming perspective.

by on (#56807)
UncleSporky wrote:
We're not talking about this sort of thing:

Image

Which wouldn't even be that bad if the game was designed that way.

Let me guess: You liked Kirby Super Star.

by on (#56817)
Never played it for more than a few minutes, I don't know what that has to do with it.

by on (#56823)
KSS had about 8px of "thickness" above each block, and the bottom of the sprite was placed in the middle of that thickness.

by on (#56840)
UncleSporky wrote:
No, you can't. Not during normal play when such things might actually matter.
[...]
The fact that Castlevania really is off by one but is only noticeable on close inspection further illustrates that this does not matter from a gameplay perspective. And we've already seen why and how it is dealt with from a programming perspective.

Why are you so defensive about it? I never claimed that it "matters". I just asked why this is the case. I didn't evaluate it, I just wondered about it. So, no need to start a heated debate about if it matters.

By the was, I'm still asking myself why in "Metroid" you start above the ground, but then fall into it when you start walking. A similar thing can be observed in "Kid Icarus": You start above ground as long as you don't jump. When you jump, you fall into he ground. It's even possible to fall two pixels into the ground.

by on (#56841)
To be honnest I never noticed anything about characters being in the ground, it don't look weird at all to me. Even the Kirby completely in the ground don't look weird to me - it just looks a bit 3D like in Double Dragon (but to a smaller scale).

by on (#56843)
When the sprites and ground are outlined it make sense to let the outlines blend into each other.

In the kirby case I think it would look uglier to put the sprite one pixel up.

by on (#56845)
JohnJohn wrote:
A similar thing can be observed in "Kid Icarus": You start above ground as long as you don't jump. When you jump, you fall into he ground. It's even possible to fall two pixels into the ground.

Now that is strange, must be a bug (unlike many other things in this thread which I think are intentional). I also think in Metroid it's probably intentional.

by on (#56846)
JohnJohn wrote:
UncleSporky wrote:
No, you can't. Not during normal play when such things might actually matter.
[...]
The fact that Castlevania really is off by one but is only noticeable on close inspection further illustrates that this does not matter from a gameplay perspective. And we've already seen why and how it is dealt with from a programming perspective.

Why are you so defensive about it? I never claimed that it "matters". I just asked why this is the case. I didn't evaluate it, I just wondered about it. So, no need to start a heated debate about if it matters.

I'm not really trying to get into a heated debate, nor do I want to sound rude, I'm just saying I think it's irrelevant, that's all. :) Mostly it's a response to you saying it would look more realistic and logical in your first post, which I disagree with. No big deal.

by on (#56847)
Oh, it's irrelevant, hm? Well, you know what's irrelevant too? Talking about NES games. And posting in a forum to discuss them. Actually, NES games themselves are completely irrelevant for life. Only a bunch of 0s and 1s that are represented as colored dots on a TV screen. So, please stop talking about them and please stop playing them because all that is irrelevant. :roll:

by on (#56849)
Oh I miss the old days when we didn't have to go trough this kind of crap.

JohnJohn it's you who made this thread only to call it irrelevant later it really doesn't make sense please use common sense before you post thanks.

by on (#56852)
Before this heats up too far, I'll give the verdict: In some games, it's an art style decision. In others, especially when it happens inconsistently, it's a physics bug.


Image
Talk to the tummy.