1
\$\begingroup\$

I should start by clarifying that when I say "Isometric" I am talking more broadly about top-down games that use a "cheat" to display things on a z-axis, rather than being limited to games in this style with a locked 3/4 angle like Sonic 3D Blast, Q**Bert* or Fallout (thus, I've not used the "isometric" tag on this question). This being the case, my target includes most 2D JRPGs and the 2D Zelda titles but does not address games that are truly top-down like Grand Theft Auto and Robotron 2084, nor those with true 3D like--well, most games nowadays.

But enough housekeeping. I have made an isometric JRPG system for a college project (using pygame, for full context), and have had issues with rendering order from day one. IIRC most isometric games just sort gameobjects by their y-value, but this seems to stop working when objects can stand on top of eachother. Since all my terrain is objects...there are problems.

I found a cheat that allowed me to depth-sort cubes by factoring in the z-position, but the cracks in this system show ever more clearly as the project progresses. Angled boxes show some glitches that could probably be overcome, but conical terrain seems to break it entirely. The system can be limped along for the purposes of the project, but thinking about the future (and a proper re-build of the system) leaves me unsure of what to do so that depth sorting works properly.

My first thought was to do depth mapping akin to 3D rendering. In theory would work thus: before a shape is rendered, try drawing the depths of each pixel to a depth map. Only pixels closer to the camera than the pixel they are trying to overwrite will be drawn. Any pixels that couldn't be drawn on the depth map shouldn't be drawn on the screen.

This should solve my problems, but it also sound a bit expensive. Surely suitable for modern hardware, but not something any of the old isometric games would have done--at least, not in real time. So my question is this: did old games have a more efficient method for isometric rendering, or did they just pre-compute depth values?

Also, just to clarify: yes, many old games surely solved this problem by cheating (i.e. place a trigger under the bridge that renders it above the player when colliding) or avoidance (i.e. no bridges at all). It's a valid approach, but I'd rather not.

EDIT: As per DMGregory's suggestion, here are some visual aides.

Here are the sorts of things I'm shooting for:A Link to the PastM&L: Superstar SagaPokemon Ranger: Guardian Signs

This is a traditional "Isometric" game--not explicitly what I want, but not counter to it either:Sonic 3D Blast Flickys' Island

By contrast, here's what I'm not doing:Octopath TravellerHotline: Miami

\$\endgroup\$
1
  • \$\begingroup\$ Those help show what you're aiming for, but they don't illustrate the artifacts you're seeing in your own project. "How did X game do Y thing" questions are somewhat problematic - editing to focus the question on your game by including what you've tried & what the results were is more likely to get useful answers than asking about old games. \$\endgroup\$ Commented 7 hours ago

1 Answer 1

1
\$\begingroup\$

When you have a 2d renderer simulating the classic isometric perspective where you see the world from a diagonal angle, then you have to add x, y and z values for each sprite/tile to calculate the draw order. When you are using an orthogonal perspective (like in Zelda), then draw order is calculated by adding y and z. One part that can be a bit tricky is figuring out where exactly you need to place the pivot point for each sprite/tile.

One trick classic games like SNES Zelda use is that they give the illusion of having different heights, but they actually don't. The maps are flat, with the height being faked through the design of the tiles.

But if you have access to a modern 3d engine, then you might be able to save yourself a lot of headache by creating your game as a 3d scene and then render it with an orthographic camera so it looks 2d. Lots of retro-games with an isometric perspective use that trick nowadays.

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.