Jump to content
IGNORED

Somebody please ELI5 for me the capabilities of the missile/ball sprites


Colmino

Recommended Posts

I'm reading they are all single pixel in detail, any height (of course), and several different widths, albeit, again, only a single "pixel" in total detail.

 

So I'm trying to figure out how games like the original Galaxian port, the homebrew Galagon, and the homebrew Space Instigators manage to display 7, 8, and 9 simultaneous horizontal sprites, respectively.  You take the player sprites (8 pixels of horizontal detail) and triple them up, and that gets you a maximum of 6, like in the port of Space Invaders.  Now, in the footage I've seen of Space Instigators, whenever a missile passes a line of aliens, it disappears outright, suggesting the obvious: That the missile sprites are serving duty as additional aliens.

 

There is a strong disconnect between what I've read about player/missile/ball sprites and what is going on in these games.  I seek a clarification.

Link to comment
Share on other sites

For a start, if you are using Stella, try the debug color mode (see doc for details). Then you can see what is using which TIA object.

 

Regarding Galaxian, Galagon and Space Instigators, these homebrews are using the so called "RESP-Trick", which allows displaying more than 6 sprites per row. It works by permanently resetting the x-position of the sprites while they are being displayed.

  • Like 1
Link to comment
Share on other sites

You can RESP eve ry 3 cycles. But when there are gaps in the formation, the spacing becomes uneven. Therefore usually every 4 cycles is used.

 

I have attached a WIP which displays 11 invaders with minimal, 4 cycle spacing.

SIA V0.35 (Thomas Jentzsch) (NTSC).bin

Edited by Thomas Jentzsch
  • Like 3
Link to comment
Share on other sites

Well this certainly completely changes how I'll be scrutinizing things from now on.  (I'll have to check the .bin out later, but thanks.)  Now I'm left wondering why the enemies in Galagon need to be so widely spaced, and whether it might have been possible to cause their spacing to expand/contract like it does in the arcade original (Galaga).  The spacing in Galagon is so wide that they have almost no room to float left/right.  I'd always assumed this was simply a limitation dictated by the needs of sprite tripling and whatever else was done to display the enemies.

Link to comment
Share on other sites

3 hours ago, Colmino said:

I seek a clarification.

 

MiniDig can be helpful for stuff like this, the Tricks page has a link to the message where Christopher Tumber explains how he used the RESPn trick in Space Instigators.

 

The balls and missiles can be used to draw "sprites" by changing their size and/or shifting them left/right over success scanlines.  A few examples of that:

 

Note the nice looking bells in Hunchy II:

 

7927221_HunchyII(2005).thumb.png.c058da8b6998173984bb3de1339d51ec.png

 

In Stella's Debug Color mode each object is drawn in a specific color:

 

1276454642_ScreenShot2021-05-17at9_51_43AM.png.5c3f4558b46bd8f8ea841c53e3ee340b.png

 

You can see the bells are all orange, which means they're drawn using Missile 0. The shape is achieved by both changing the size and shifting the position:

 

152013685_HunchyII(2005)_1.thumb.png.8ed2d4faa3bccf097af531e60d4853fb.png

 

 

In Warlords the kings:

 

72490770_Warlords(1981)(Atari).thumb.png.d91ef82fe89d881fc29a29e59d7947ee.png

 

are drawn using the missiles. The shape is achieved by changing the size of the missiles, position is not changed:

 

1999763940_Warlords(1981)(Atari)_1.thumb.png.0f1bb8bf6de86cb2c255d3ca70284028.png

 

in Draconian the animated station cores:

 

draconian_20171013_RC6_dbg_7ad753e8.thumb.png.17fea8f7da2bff0becc7dd0c93a419a4.png

 

are preferentially drawn using the ball. Shape is achieved by shifting the position, size is not changed:

 

draconian_20171013_RC6_dbg_7ad7738c.thumb.png.f7b3638db198ed46c5cce83566f9cf31.png

 

I preferentially use the ball because that allows me to color the station cores red.  If 2 stations line up horizontally I can't draw both with the ball, so one of the cores will be drawn using a missile (either one). When that occurs the station core will change color due to TIA limitations.

 

draconian_20171013_RC6_dbg_7ae2d39d.thumb.png.c340edf4b17c82eff501012f85189d19.png

  • Like 3
Link to comment
Share on other sites

7 minutes ago, SpiceWare said:

The balls and missiles can be used to draw "sprites" by changing their size and/or shifting them left/right over success scanlines.

Thank you for the detailed writeup.

 

It turns out that my fundamental misunderstanding was that sprites can in fact be repositioned before moving to the next scanline, which I had assumed to be impossible, possibly due to the chosen methodology of the Space Invaders port, or perhaps I was conflating other data such as the limitations on playfield color.

 

Edit: Incidentally, I've long considered Draconian to be among the top three most impressive things I've ever seen someone make the Atari 2600 do.  Belated congratulations.  The miracle of digital sound is something I've been meaning to investigate.  If it's being helped along with an extra chip, perhaps someday you'll return to the title and go whole hog with that approach and give it all the voices it needs to replicate the arcade sound without compromise.  That seems to be the popular choice with homebrew lately, especially with the advent of the AtariVox+.

Edited by Colmino
  • Like 1
Link to comment
Share on other sites

15 minutes ago, Colmino said:

It turns out that my fundamental misunderstanding was that sprites can in fact be repositioned before moving to the next scanline, which I had assumed to be impossible, possibly due to the chosen methodology of the Space Invaders port, or perhaps I was conflating other data such as the limitations on playfield color.

It is considered an advanced technique, and I'm guessing they hadn't figured it out when Space Invaders came out. It is used in the 2600 port of Galaxian, however. If you reposition mid-line, the original sprite won't display, but the last copy will. Probably others can explain it better than me, though.  ?  

  • Like 1
Link to comment
Share on other sites

4 hours ago, Colmino said:

Thank you for the detailed writeup.

 

You're welcome!

 

4 hours ago, Colmino said:

Incidentally, I've long considered Draconian to be among the top three most impressive things I've ever seen someone make the Atari 2600 do.  Belated congratulations.  The miracle of digital sound is something I've been meaning to investigate.  If it's being helped along with an extra chip, perhaps someday you'll return to the title and go whole hog with that approach and give it all the voices it needs to replicate the arcade sound without compromise.  That seems to be the popular choice with homebrew lately, especially with the advent of the AtariVox+.

 

Thanks!  Digital sample playback was figured out back in the day:

 

 

Basically set CHANNEL to 0, then store sample data into VOLUME once per scanline. Volume's limited to 0-15, so you get 4-bit digital audio.

 

Main issues is its difficult to draw a game screen while playing a sample, which is why Quadrun blanks the screen. Using CDFJ makes it possible to do it using just 5 cycles per scanline, making it easier to play a sample while also drawing the screen.

 

Samples use a LOT of ROM which limits what else you can do in your game. I'd originally wanted to save high scores to the savekey, but couldn't fit it in.

 

Another limit with CDFJ is you can only play back 1 sample at a time, which would be a major limit on sound effects if I tried to do them all using samples.  Draconian switches on the fly between playing back 1 sample + 1 sound effect, and playing back 2 sound effects.

Link to comment
Share on other sites

14 minutes ago, SpiceWare said:

Digital sample playback was figured out back in the day:

I was very slightly, vaguely familiar with the fact that there was a game out there that did it, but I'd always assumed that either 1) the cartridge had some extra, necessary hardware for offloading the processing, or 2) it simply used up most of the available processing whenever the technique was utilized, making it only useful for non-gameplay scenarios (as seemingly corroborated by the example in your linked video).  Learning that Draconian is actually doing this on an unenhanced VCS, during what is already vastly more advanced gameplay than in almost any commercial title ever developed, is frankly mind blowing.  I thought I was used to the phenomenon of the VCS having insane unintended potential, but I was not braced for this.  Forget what I said about extra voices—I can definitely appreciate the appeal of making the most of what literally existed in 1977.

Link to comment
Share on other sites

Draconian uses the Melody Board, which contains an ARM chip, to make it possible. The ARM runs a driver that emulates coprocessors, like the DPC used in Pitfall 2. We created an updated driver that adds new features, such as making it easier to do digital samples.  Additionally game logic runs on the ARM during overscan and vertical blank.

Link to comment
Share on other sites

I made "two rockets + their trails" with just one ball, in my prototype:

It renders quite nicely. That does one "fake sprite" on each lane (plus six real ones). The shape of the rocket is tailored to the ball's characteristics/limits, but it looks like a "real sprite" to the player's eyes.

  • Like 1
Link to comment
Share on other sites

On 5/17/2021 at 2:40 PM, Thomas Jentzsch said:

Since 1 CPU cycle equals 3 display pixel, you cannot position or move sprites smoothly horizontally this way. I suppose that was the reason of the spacing.

 

I am sure @johnnywc can explain better.

In Galagon, I see that the enemy multi-sprites are semi-smooth scrolling horizontally, moving 1/2 pixels alternately. Because the sprites are 7 pixels wide, the trick being used here is to shift the graphics a single bit, and for the next move add 1 CPU cycle and shift the graphics back.

 

[Edit]: I just found that Galaxian's enemy sprites are 6 pixels wide, which is probably the reason why that game shows smooth horizontal scrolling of the multi-sprites.

 

Edited by Dionoid
Link to comment
Share on other sites

On 5/17/2021 at 1:53 PM, Colmino said:

So I'm trying to figure out how games like the original Galaxian port, the homebrew Galagon, and the homebrew Space Instigators manage to display 7, 8, and 9 simultaneous horizontal sprites, respectively.

I've also been investigating this RESPx multi-sprite trick yesterday, and finally this detailed information on the multi-sprite trick by @SeaGtGruff made it all "click" for me.

Edited by Dionoid
  • Like 1
Link to comment
Share on other sites

1 hour ago, Dionoid said:

I've also been investigating this RESPx multi-sprite trick yesterday, and finally this detailed information on the multi-sprite trick by @SeaGtGruff made it all "click" for me.

What seems to miss is, why sprites get shifted if you skip one RESPx. Which is the reason why e.g. my Space Invaders game needs a 4 cycle interval.

Link to comment
Share on other sites

8 hours ago, Thomas Jentzsch said:

What seems to miss is, why sprites get shifted if you skip one RESPx. Which is the reason why e.g. my Space Invaders game needs a 4 cycle interval.

I think @SeaGtGruff explains that with that paragraph about the +5 color clocks after a STA RESPx ends, right? Probably not as detailed as Andrew Towers' hardware notes, but sufficient for me.

And kudo's to the Stella team for emulating this TIA quirk correctly!

Quote

When you do STA RESP0, the player0 sprite gets repositioned at the color clock that's +5 after wherever the STA ended-- e.g., if STA RESP0 begins on cycle 23 (as in your code above), the cycle after STA RESP0 ends is cycle 26 (23+3=26), which is color clock 78 (3*26), so player0 gets positioned at color clock 83 (78+5=83). The first 68 color clocks are the HBLANK persiod, so that would be pixel number 15 on the visible scan line (83-68=15).

 

The reason for the +5 delay is explained in Andrew Tower's hardware notes, but we'll just accept it without trying to fathom the why of it-- but I recommend reading (and rereading several times) Andrew Towers' document.

 

Edited by Dionoid
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...