Jump to content
IGNORED

More than 2 sprites in a scanline


gorgh

Recommended Posts

Hi there folks,
I was trying to figure out how Dave achieved 4 sprites in onle scanline in his upcoming game Legendary Spear but so far I can't wrap my head around the source code. I'm aware that there are some techniques used to achieve more than 2 sprites on the screen with different shapes (I'm not talking about simple multiplying the same shape), what kind of sorcery is used to get that effect? Dave's game seems not to use flickering, so Im clueless how to duplicate that effect :)

Link to comment
Share on other sites

OK, I guess I got it... Dave is changing the horizontal size of the player each scanline so it looks like multiple sprites are used for each sprite... smart! but are there any other ways to have more sprites in one scanline? racing the beam in order to change sprite registers on a fly?

Edited by gorgh
Link to comment
Share on other sites

You can toggle on Stella's Fixed Debug Color mode, by using Developer Keys <ALT><PERIOD> or <CMD><PERIOD>, to analyze how games do things. Looks like he's mostly reusing the players (sprites) vertically as the screen is drawn.

 

On each scanline he's also changing the players' sizes between 1x, 2x, and 4x while shifting them left/right in order to create large, yet detailed, graphics.

 

 

 

1112945133_ScreenShot2021-09-09at2_58_45PM.thumb.png.29ce5baeb8b128c525704f883816df0a.png

  • Like 1
Link to comment
Share on other sites

24 minutes ago, gorgh said:

but are there any other ways to have more sprites in one scanline? racing the beam in order to change sprite registers on a fly?

 

Yep, set the players to duplicate or triplicate mode then change the player graphic and/or color registers on the fly is one way. Of course you don't get to control the X position of each copy separately. An example of that would be 1977's Blackjack:

 

1236916542_Blackjack(1977)(Atari).thumb.png.dc67c178ca5c302830e818ab1deed494.png

 

all the cards are drawn using Player 0, the color and graphics are changed between each copy.

 

485030306_Blackjack(1977)(Atari)_1.thumb.png.313f9bd64bdbb4db358e34149bcd525a.png

  • Like 1
Link to comment
Share on other sites

17 hours ago, SpiceWare said:

On each scanline he's also changing the players' sizes between 1x, 2x, and 4x while shifting them left/right in order to create large, yet detailed, graphics.

Yes I originally was studying the various multi-sprite kernels I found here and got onto this track of wanting to try to make a demo of two big sprites moving around seemingly independently which led to this size/shift approach. 

In case anyone wants to play around with it I wrote this (python) script to generate code for this style of sprite from image files. It's a little bit hardwired to work with aseprite files r/n but it wouldn't be a stretch to adapt it to work directly with png / etc.

 https://github.com/DChristianson/legendary-spear/blob/main/scripts/spritify.py

Basically if you pass it an image > 8 pixels wide and supply the --bits 8 option it will interpolate the image into 8 bits and emit the appropriate multi-resolution sprite code (nusiz and hmov jammed together in 1 byte - the kernel uses the low bits for NUSIZ and high bits for HMP). Note it will straight up fail if you give it an "impossible" image (for instance if getting to the next line means shifting more pixels than you can shift in an HMOVE)
 

Edited by Dave C
  • Like 2
Link to comment
Share on other sites

1 hour ago, Dave C said:

In case anyone wants to play around with it I wrote this (python) script to generate code for this style of sprite from image files. It's a little bit hardwired to work with aseprite files r/n but it wouldn't be a stretch to adapt it to work directly with png / etc.

 

I did something similar using PHP. They're on my Atari page, in the SpiceWare Utility section.  Here's an example of the Two Color Sprite Converter that I used in 2006 for Medieval Mayhem.  It doesn't resize the players, they're always 2x, but it does shift them left/right. 

 

1927087757_ScreenShot2021-09-10at9_04_50AM.thumb.png.4de00bcc7e8b71d0e221ffbf192a45df.png

 

though looks like they need updating for modern browsers as the results are in one long line for some reason...

 

1395820613_ScreenShot2021-09-10at9_04_54AM.thumb.png.ac5d05f37a4873319468856d86d9300f.png

 

Back then I was using graphics.h, which did a bunch of zz defines that made graphics more visible in the source:

 

1608753765_ScreenShot2021-09-10at9_13_09AM.thumb.png.e2ed0d8c819b7e2163be0cd8aa5c356e.png

 

I now use binary values with custom syntax highlighting in jEdit:

 

1023635620_ScreenShot2021-09-10at9_41_41AM.thumb.png.12743529ecd0a0d3342acd78565cff03.png

 

 

 

 

  • Like 1
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...