gorgh Posted September 9, 2021 Share Posted September 9, 2021 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 Quote Link to comment Share on other sites More sharing options...
gorgh Posted September 9, 2021 Author Share Posted September 9, 2021 (edited) 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 September 9, 2021 by gorgh Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 9, 2021 Share Posted September 9, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
gorgh Posted September 9, 2021 Author Share Posted September 9, 2021 (edited) Thanks SpiceWare, that's really smart approach! Edited September 9, 2021 by gorgh 1 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 9, 2021 Share Posted September 9, 2021 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: all the cards are drawn using Player 0, the color and graphics are changed between each copy. 1 Quote Link to comment Share on other sites More sharing options...
Lord Mushroom Posted September 9, 2021 Share Posted September 9, 2021 But how many 7 Ups are there in each scanline? That´s the question! 1 Quote Link to comment Share on other sites More sharing options...
gorgh Posted September 10, 2021 Author Share Posted September 10, 2021 I don't know about 7UP but for sure you can have at least 1 Pepsi in a scanline Quote Link to comment Share on other sites More sharing options...
+Dave C Posted September 10, 2021 Share Posted September 10, 2021 (edited) 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 September 10, 2021 by Dave C 2 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 10, 2021 Share Posted September 10, 2021 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. though looks like they need updating for modern browsers as the results are in one long line for some reason... Back then I was using graphics.h, which did a bunch of zz defines that made graphics more visible in the source: I now use binary values with custom syntax highlighting in jEdit: 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.