Elysian Shadows

Z Layering/Buffering Predicament

The biggest, most complex, multilayered scenario we wanted our engine to be able to handle was allowing the layer to climb a ladder into a treehouse (with the ladder emerging from the center of a platform) and walk across a bridge (which can also be walked under) to another platform. Full entity interaction with an elevated structure on both the top and bottom layers...

We devised a relatively complex way to do this... But I came to realize a few shortcomings with our proposed top tile layers and our overall level design.

Before you read this post, I want you to keep in mind that to this day, I have never seen a 2D RPG with multiple full-fledged layers like we have. Every effect that you have ever seen in a AAA SNES title or other 2D RPG was done with clever level design, and some kind of depth flags on a single-layer map.

edit: Note that when I say "layer," I'm referring to both terrain and object layers. So technically Chrono Trigger and Secret of Mana have two layers, while we have 4.

Top Layering Issue
I think we have developed a misunderstanding of what is and isn't possible using the top layer (and I am definitely guilty of helping spread the misconception). The original purpose of the top layer was for allowing the player to explore portions of the map at a higher elevation... We soon started using it as an additional two layers of "decorations" for the bottom layers. At first, we didn't realize there was any problem here, because neither the Toolkit nor Engine was rendering entities or object layers in the correct depth-buffered order... However, the problem now becomes quite apparent with the depth buffer implemented:

The buildng here was created as basically bare on the bottom layer, then the tanks, moss, and other objects were added to the second layer.

The top layers are [b]always rendered above the lower two layers and all entities occupying them[/b]. Which means they aren't really suited for allowing us to add additional detail to the bottom layers.

There are basically two solutions to this...
1) We do like every other RPG that I have ever seen, and require this house use only the bottom tile and object layers (that is how the art is supposed to be made), but this will admittedly sacrifice some flexibility of the tilesheet (although it arguably should have been created with this limitation in mind to begin with).
2) We [i]don't[/i] necessarily render the top layers above everything on the bottom layers... Instead of the top layers starting implicitly at elevation 16, they start implicitly at the same elevation as the layer below them... For example, an object at elevation 2 on the bottom layer would cause the top layer to begin at elevation 2, rather than 16. This would require quite a bit more work on the renderer, and it would add some complexity to the elevation system and representation within the Toolkit... Not sure if this is worth it.

Z-Transitional Planes Do Not Require Multiple Layers?
Despite what we all thought, apparently allowing the player to walk above and below a tile on a in the same map location [b]may not require multiple layers[/b]. If this is the case, we need to make goddamn sure we understand how to pull this off with the least amount of layers necessary.

Our engine has been designed to give us far more flexibility than a game like Chrono Trigger... The last thing I want to do is waste its power... If Chrono Trigger could do an effect in a single layer, we shoudln't be wasting the second layer and implementing the effect with two layers. We should be figuring out how to handle it with one as well and use the second layer to push our engine even further beyond CT.

I want you guys to have a look at some of these screenshots. I encourage you to fuck around with games like Chrono Trigger and Secret of Mana. Lets study these effects. Also, Temporal Flux, Chrono Trigger's Level Editor, is sitting in the Dropbox. You can open up actual levels from Chrono Trigger, modify them, export them to the ROM, and play through them in an emulator. This is how we dissected their (inferior) elevation attributes. This is going to be how we need to dissect their z planes and transitions...

And some noteworthy screenshots. All maps are taken from:

This is definitely a "HOW THE FUCK?" effect. Notice the overpass on the bottom right. This only uses a single layer, but it is somehow being flagged as rendered above the player (or at a higher elevation) when the player walks under it and then flagged as rendered below the player when he walks above it.

This is another VERY important effect for the engine to be able to pull off... Notice the overhanging roots above the ladder? They are rendered above the player, giving the effect of him going through them as he emerges from the ladder... Also done with a single layer.

This map isn't anything particularly special, but take note of the intricate stone bridges over the background. This is clearly done with a single layer and a background image (which we will support). Also note how many "levels" are in this mountainous structure, when it is all done with a single layer... Multiple layers are only required for when these levels are literally right ontop of each other on the map...

Discussion Topic

Falco Girgis
Falco Girgis is the founder and lead software architect of the Elysian Shadows project. He was previously employed in the telecom industry before taking a chance on Kickstarter and quitting his job to live the dream. He is currently pursuing his masters in Computer Engineering with a focus on GPU architecture.