Welcome, Guest. Please Login or Register
To the NESWORLD news page
   
  HomeHelpSearchLoginRegisterAwards  
 
Page Index Toggle Pages: 1
Send Topic Print
I've got a question on sprites. (Read 2522 times)
cranium
Forum Newbie
*

Offline



NESWORLD Supporter!

Posts: 1

I've got a question on sprites.
24. Feb 2009 at 22:04
 
I know that sprites tend to not handle too well on the NES. The more, the worse, or the bigger, the worse, but I've got an interesting question. What determines how well sprites handle?


Look at this game: http://www.youtube.com/watch?v=R8bzf21-qdQ
That game can handle sprites pretty well. No flickering, or the known glitch of disappearing sprites. The clouds in the background are actually sprites, how else does the game manage to parallax scroll?


I've noticed that a whole set of sprites that are lined up vertically handle better then lined up horizontal. I don't know why that is. some games like Super Pitfall can't handle simple sprites. The game flickers like crazy.


this isn't fair. some3 games can handle sprites, some can't why? Is it how much space is in the game? Is it how massive the levels are? Thanks.
Back to top
 
 
IP Logged
 
NESaholic
God Member
*****

Offline



Obscurist maximus

Posts: 2450
The Netherlands

Gender: male
Re: I've got a question on sprites.
Reply #1 - 26. Feb 2009 at 15:24
 
It's a memory problem I think, correct me if I'm wrong though guys.
Back to top
 
NESaholic NeSaHoLiC  
IP Logged
 
cdb900
God Member
*****

Offline



NES- The 8-bit Engine
that Could

Posts: 530
Missouri

Gender: male
Re: I've got a question on sprites.
Reply #2 - 28. Feb 2009 at 02:28
 
The way I've always understood it (correct me if I'm wrong) is that the real limitation of the hardware lies with the number of sprites that you can have on a single horizontal plane.  If there are too many sprites on a single horizontal, the game would slow down to being unplayable or crash immediately  (more specifically, the graphics hardware of the NES would lock up).  Reason being (again correct if I'm wrong) that the NES can't make all those calculations and still get the signal out in time for the scan pass of the TV, which screws everything up in a hurry.

The flickering you see is actually a less-than-elegant programming solution to the very real problem of situations where there are too many sprites on one horizontal.  By alternating which sprites display on each scan pass, the NES can handle more sprites without affecting much gameplay.  The alternating sprites produces the flickering that you see.

The best example I can think of is a Megaman game.  Hop into a room with a boss robot.  Stand at the opposing end of the room from the robot.  Nothing happens even though your sprites are on the same horizontal plane.  Now, let go with a couple of blaster shots in rapid succession (each round blaster shot is also a sprite).  Suddenly, your body, the blaster shots, and the robot boss will flicker, but only the parts lined up on that horizontal plane with the shots.

Scan lines are horizontal, so vertical sprite orientation is not so much of an issue, and you can have lots of sprites lined up vertically and still be fine.

There are two types of sprites: foreground and background.  The foreground ones are the ones that you usually see flicker, and the background ones are the ones you see in parallax games (like the clouds).

Various games have better and worse ways of handling an overflow on foreground sprites.  Super Pitfall ain't too great, Mega Man is somewhat close to elegant, and other games use a secondary graphics chip.   Another story.

Back to top
 

There's no power greater than N.
 
IP Logged
 
hyarion
Forum Newbie
*

Offline



NESWORLD Supporter!

Posts: 8
sweden

Gender: male
Re: I've got a question on sprites.
Reply #3 - 12. Apr 2009 at 17:19
 
you have 2 types of picture elements on a nes; tiles and sprites.

tiles is placed on a grid, and can therefore only be used for a simple background (no paralax scrolling clouds), text etc. you can change the grid offset (this is how scrolling is done) but not the relative position between two tiles. tiles can also have transparency

sprites however can be placed anywhere on the screen but only a limited number can be used at once. each sprite can be set to either be place in the foreground (in front of the tiles) or in the background (behind tiles, only visible where tiles are transparent)

you can have 64 sprites/frame but only 8 sprites/scanline. however i think you might be able to change sprite positions or enable/disable sprites during the scanline, this should increase the number of flicker free sprite/scanline but would not be an easy task. much easier to do as cdb900 said.

in case of the game you referred to (my guesses, you can check using an emulator):
* background are using tiles
* clouds are draw as sprites behind the background
* clouds are only placed in the level so that sprites doesn't count up to more than 8 on each scanline. (less clouds where there are enemies)

as a side note; it is also possible to exchange/generate tiles on the fly by adding a layer between the PPU and the C-ROM, but those games would be more expensive to produce
Back to top
 
55859796  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print