Jump to content
  • Advertisement
Sign in to follow this  
VividCanary

Robust faux-3D in 3/4 top down perspective?

This topic is 2570 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to wrap my head around how to implement a depth/fake 3d system in a 3/4 top down style game.

I started with looking at one of the most obvious examples: A Link to the Past.

tu4wv.jpg


This seems to work via a pretty simple optical illusion and some basic one-way collision detection in regards to falling off cliffs, no big deal there.

Then I looked at the PS1 game Alundra. This game is in (more or less) the same perspective as A Link to the Past, but with one big game changer: the ability to jump.
In the world, you can jump on any piece of scenery you can reach:

JGa1C.png

You need to press forward when you reach the table's height in order to "catch" the table, if that wasn't obvious.


The sprite moves on the y-axis when you jump, but it's different than "normal" movement. For example, you can stand as close to a door as you can without going in and jump. You won't go into the door, but your sprite will move along the y-axis past the door trigger (as well as be rendered above the top of the door frame) but you will not enter the door. If you move your character forward a single unit with the d-pad (or whatever) you will of course enter the door. The game also supports horizontal slopes, but I think they are locked into a single angle, so probably not a huge mystery to solve there.

The result of all this is a really really nice 3d effect.
So naturally, my question is: What sort of options are there for this kind of "robust" faux-3D? With no real z-axis, it seems really tricky!

I'm generally just looking for a discussion on the theory behind doing 3D like this and maybe some pseudo-code, but if it matters I'll probably try to implement it with C# in Unity (forgoing their collision and physics systems more than likely).

Share this post


Link to post
Share on other sites
Advertisement
I'd guess a "Depth" variable (basically, a virtual Z-axis) is used. Typically, depth would be 0 when walking on the ground. When jump is pressed, depth is increased and decreased just like a side-scroller, and is added to the Y-axis for drawing.

I would then assume, checks are made against objects that have similar depths on the same X,Y tile, and, if matched, the user is kept on that plane, the Depth remains the same, and he walks around on "top" of whatever he is.

I'd assume the triggers also check depth, as depth of 0 is for ground triggers, and a higher depth used for "off the ground" locations.

Share this post


Link to post
Share on other sites
Note that you can have 3d gameplay with 2d graphics and vice versa.

In A link to the past, there's just a flat timemap (judging by that screenshot as I haven't really played it, at least not for many years). In that case, walls are just blocked tiles. In alundra, the tiles on the map have a height. This means each tile has a floor and wall texture/image. When you draw, you draw back-to-front. For each map 'row', you draw tiles first, then objects. If an object spans several rows, it's drawn after the last (lowest on screen) row. When you draw a tile, you must first use its height to find the y-position on the screen. If its height is lower than that of the tile in the last row, you fill in the distance using the wall texture/image.

Finding the y-position on the screen is just map_y + height.

Share this post


Link to post
Share on other sites
Alright, I think I have a pretty decent idea of how to get something similar to Alundra going now.
I had thought about having a "fake" z-axis before, but I figured I'd run it by some more knowledgeable people before proceeding.

I'll update this thread if I run into anything interesting/frustrating.
Thanks a bunch guys!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!