Big Scaled 'Sprites'
All game development is cheating. The older and slower and simpler the hardware, the more cheating you need to do!
So how to achieve big scaling backgrounds?
The first solution I came up with was just to store all the frames of a scaling animation, convert all frames to a character set, and store down a character map for each frame of the animation. This actually works great, and is really simple to implement.
However the problem lies in authoring the content. We couldn't find a decent way to scale images on character boundaries in Aseprite, and the other approach I was going to try was to add another tool in to the toolset to do the map scaling for me. (in fact, we might well do this at some future point - depends on usage)
But instead I decided to give the 'real time' scaling a shot first, just to see how slow it would be. It'd be a fun bit of code to create, at least.
To make things simple and fast I output some helper data from my c# tools. This data tells the code which source image character to use for every output character, for each scale size. This could all be done on the 68000 side, but would be a lot slower.
So essentially the scaled BLIT code is two loops, Y and X, which traverse the original data, picking which character to render for each output character. This is very similar to how texture mapping a triangle works on modern (and old) GPUs, but very much simplified.
I added multiple code paths for independent X/Y scaling, as well as flipped versions (so I can rotate the Biscuithead boss upside down), which is enough for this project.
Very much looking forward to using this system even more in future games. I plan to add the ability to generate the tables on the 68000 side, in real time, so we can scale more items in an ad-hoc way. Also to-RAM versions (rather than writing straight to VDP which we do here) which will be better for handling multiple moving scaled objects at once.
If you have any ideas or suggestions for how you'd like to see this used in a horizontally scrolling shooter, let us know!
Comments
Post a Comment