Thursday, July 13, 2017

Tree Top Trickery

The boss fight in Mushroom Hill Zone 2 is home to a yet another pseudo-3D effect, where the player and the boss race through a series of three-dimensional archs, composed of two pillars, one in the background and one in the foreground, connected by a thin plank which scrolls across the screen with semi-realistic perspective.


Much like the ice sheets in Icecap Zone 2's background, the plank is drawn with a skewed perspective in advance, but ironically you can never see the undistorted graphic due to the foreground pillar overlapping it.


Here's how everything comes into place: first, the normal level backdrop is drawn on the low background planes. Then the background pillar is rendered through a bunch of low priority sprites stacked vertically on top of each other.


In order for it to be deformed, the plank must be rendered through a background plane, and in order for it to overlap the sprite-based background pillar, it must be drawn on the high plane along with the foreground layer.

But wait! We've run out of background planes to draw the overlapping foreground pillar with! That bit is covered up by a couple of high priority sprites, much like the rounded corners at the bottom, because it turns out the grass and the pillar actually use two different palettes.


Rendering the plank on the same background plane as the pillar has its drawbacks. Given the angle, you would expect the characters to appear behind the pillar but in front of the plank, so while the rest of the boss has low priority, the top part is actually made out of high priority sprites.

There are also collision change objects looming over the entire field, setting the player's priority whenever they venture into the top portion of the screen. Even that doesn't cover every scenario, though.

No comments:

Post a Comment