Why, yes, it does
(4 different places blending is used for effect)
I’ve done an initial implementation of the blending in Cool Riders, turns out the basic logic is
If a sprite has palette value of 0×8000 it’s transparent, always.
A value < 0x8000 is a solid 555RGB colour
A value > 0×8000 is a blended 555RGB colour
when a Colour is blended a sprite attribute is used to decide the blending level, this goes between 0×0 (full blend, MAYBE 100% invisible) to 0×7 (no blend, solid)
Implementing this was more work than I expected, mainly because it broke my zbuffer implementation, because in some cases transparent sprites were being sent to the display by the game before the sprites they were meant to cover, causing them to cut holes in sprites and show the background instead. The only real way to fix this was to sort all the sprites based on their z value before drawing which meant a slight change in the way things were being done was needed.
Having done that, I was able to get the above screens, and blending seems correct in the cases where it’s used now.
One thing that threw me off when trying to figure out the blending at first was that ALL the road pixels had the 0×8000 bits set, why would you want to blend the road? The only thing underneath it is the background! It turns out that most sections of the road actually have the 0×7 value set for the blend level, meaning they render as solid, but during my testing (rendering different values of that register as random colours every frame) I noticed that some bits of the road actually had different blend values set, in increasing amount. It turns out the blending is used for a most unexpected effect too, blending the end of one road terrain type with the start of the next! The screenshots below show the road between stages first, on the left from an earlier build without blending, and the right the current code, with blending applied, kinda neat.
(Left, old code, no blending | Right, new code, blending used between road sections)
This is also used to great effect on short tunnels and the like. The road blending also gets used to show sprites below the tunnel for a special effect when entering the extra stage, as the first lot of screenshots show.
Of course doing all this slows things down a bit, so I’ve actually spent most of the past 2 days coming up with optimizations, including an object tile caching system so that we can avoid calling the RLE decoder too often, as decoding entire rows of 16×16 tiles each time just to draw a tiny road line in the background is not an insignificant waste of CPU power! All that got it up to a decent enough speed on my system, before all the extra effects dragged us to around where we were before, so time well sent.
Additionally I improved the full-screen RGB effect logic, so it now actually gets applied to the full screen instead of just the tilemaps, but it will need a video to demonstrate that, and I don’t have time to do one tonight,
(Video showing the latest progress, cropped to a single screen)
(same video, without cropping so you can see the attract on the 2nd screen)
A few graphical glitches remain, but nothing major and it’s feasible the ones we have left could be original bugs although I do have a few things to try first. The sound is still buggy, but as of now the game is marked as WORKING.