Jump to content

Question about depth and what solution Obsidian used.


Recommended Posts

Hello everyone I'm new here, I have registered mainly to ask one question that made me wondering for some time. I'm a Unity user too and was curious about Project eternity using 2d environments, so one day I wanted to try something in unity to achieve a quick half ***ed project.

 

But I was concerned about one important aspect of the whole thing, the depth in 2d. Now I'm not a big explainer so I'm gonna give you guys an example. So imagine you have an isometric 2d box room, and in the middle of it there is a pillar. Now when you are front of the pillar you see your character, when behind it should be hidden by the pillar, and thats fine. But how you really calculate the depth of the 2d space, the pilalr beign just a 2d element have no real height, so I was curious how Obsidian managed to have a fake depth on items like the pillar, how you know when something is in front of the item or behind.

 

I'm really interested in how that was done(in Unity, not just the basic concept of it), just for the hell of it.

Edited by Neurological
Link to comment
Share on other sites

From the first experimental build video where the map editor was shown it looked like all 2D elements were in a 3D map, so it has a real height and depth, it's like a 2D prop on a stage. A 3D map is being rendered with both 2D (the pillar) and 3D (characters), the 2D elements are not being directly rendered. Obsidian can also use 3D models, but for pillars 2D should be enough.

Edited by AwesomeOcelot
Link to comment
Share on other sites

Still a model of the pillar alone won't do anything as is just a bunch of polygons, so my thougth was maybe some sort of shade using your idea of a dummy model when you get behind the shader on the model hides the player geometry.

 

I always found interesting one pic on the Baldur's Gate credits video:

 

If you look around 1:40 you see they drawn some invisible polygons probably weren't polygons there, but they were used to say what is background or foreground with a base too, so I wonder if Project Eternity have this approach like Pipyui suggested with the dummy model and maybe a shader to tell when is back or front.

Link to comment
Share on other sites

The shader determines what is visible, e.g. ray tracing. The 2D elements are made like flat prop boards on a stage in a 3D map, the position in the 3D space determines whether something is rendered infront or behind another. The engine determines where a player can move with a collision mask that's semi-2D. All of this has been shown in the updates.

Edited by AwesomeOcelot
Link to comment
Share on other sites

the way i understand it, the engine calculates everything in a 3D enviroment, and then pastes the result in the 2D image on the screen.

The words freedom and liberty, are diminishing the true meaning of the abstract concept they try to explain. The true nature of freedom is such, that the human mind is unable to comprehend it, so we make a cage and name it freedom in order to give a tangible meaning to what we dont understand, just as our ancestors made gods like Thor or Zeus to explain thunder.

 

-Teknoman2-

What? You thought it was a quote from some well known wise guy from the past?

 

Stupidity leads to willful ignorance - willful ignorance leads to hope - hope leads to sex - and that is how a new generation of fools is born!


We are hardcore role players... When we go to bed with a girl, we roll a D20 to see if we hit the target and a D6 to see how much penetration damage we did.

 

Modern democracy is: the sheep voting for which dog will be the shepherd's right hand.

Link to comment
Share on other sites

We use a 2D depth map render that is separate from the final/beauty render.  The depth map has the same resolution as the final render and allows the in-game renderer to determine the depth each corresponding pixel has from the camera.  Because it's an isometric render (no parallaxing), it simply does a per-pixel comparison to sort the scene.

  • Like 1
Link to comment
Share on other sites

Oh I see, I did my own way trying to figure out what you sued, in this simple prototype:

 

http://games.neuro-lab.net/resources/Build/Build.html

 

Just wait for the cylinder to move. I did it with two cameras, one is top down and render only the 2D background, the other render only the 3d portion which are placed on top of the 2d background, but the second camera render isometrically. Surely is not pixel perfect on the colliders, especially with AA off you can see the seams.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...