Users browsing this thread: 1 Guest(s)
Strange Effects in 3D Space
#1
I've seen the classic footage of Sonic Generations, how the side-scrolling works in a #D environment, and I noticed something that I noticed in DKCR and other 2.5D games.

Characters can jump through from under platforms, however they pass IN FRONT of the object rather than passing through them like in say... Smash Bros.

[Image: effects.png]

See in Returns you go in front of the object while in Brawl you pass through it like it was made of gas.

This is easy to do in 2D space, but with 3D environments I wonder how they are able to pull this off? Sonic Generation also does this, but even more interesting that they also have hills in the background that you can jump on like in Genesis games.

[Image: effects2.png]

So does anyone know how this is done? Is the camera only making it look that way? Is the character model moving forward and back without us knowing it?

Thanked by:
#2
You can change the order in which things are drawn to the screen and how they interact to cover and not cover various other objects in the scene.

So, for SSBB, they just have everything work by default, with things clipping through each other as they should. Meanwhile, DKCR would have platforms always be drawn under the player without regard for clipping so they would never obscure him at any time.

Though it may entail just a little bit of extra work, it really isn't all that hard.

As for the case in Sonic Generations, I'd have to watch a video to see if the environment isn't flattened any. Also, since the camera is pretty much always at the same level as Sonic, I suppose the player might not notice if he suddenly shifted in towards the screen when on those background platforms.
Thanked by: Chris2Balls [:B]
#3
Ah so you are saying the platform pops behind DK's model and then pops back into place?

Thanked by:
#4
The platform doesn't really move at all. It's just drawn behind the player.

Just like how you can simply draw one sprite right over another sprite or background, you can draw one 3d object right over another 3d object without any regard to their relative distances to the camera.
Thanked by: Chris2Balls [:B]
#5
Okay I see, that's why Smash doesn't do it because you are able to rotate the camera around.

Its sort of like how they are able to trick your sense of depth here right?

[Image: 3d_room.jpg]

Thanked by:
#6
Displaying DK takes priority over displaying the platform?
[Image: Dexter.png]  [Image: Bubbles.png]  [Image: SNWzHvA.png]   [Image: SamuraiJack2.png] [Image: kQzhJLF.png]  [Image: Pikachu.png] [Image: tSCZnqw.png]
Thanked by:
#7
It's really piss-simple in OpenGL. Just enable GL_DEPTH_TEST, draw the entity, disable GL_DEPTH_TEST, make sure that everything that IS supposed to go in front of anything is drawn after the rest, and you're set. It's all about drawing priorities.
Big sigs are for scrubs.
Thanked by:
#8
(06-11-2011, 02:50 AM)Koopaul Wrote: Its sort of like how they are able to trick your sense of depth here right?

[Image: 3d_room.jpg]
my sense of depth wasnt tricked to i get a prize or something for not being a complete retard

Thanked by:
#9
(06-11-2011, 02:50 AM)Koopaul Wrote: Okay I see, that's why Smash doesn't do it because you are able to rotate the camera around.

Its sort of like how they are able to trick your sense of depth here right?

[Image: 3d_room.jpg]

What does looking at some picture cross eyed have to do with this?
Thanked by:
#10
I played this Sonic fangame (Sonic GDK) which pulled that off in a pretty simple way, dunno if it's the same way that DKCR and other "2.5D" games pulls it.

When Sonic jumped, and there was a platform on a plane behind his (much like the example you posted), he'd move to that plane when he got near landing it (sort of like being pulled to this plane, or like a tweening)



you can see it at 1:16 (although you should watch the whole video, it's pretty good)
Thanked by: Chris2Balls [:B]
#11
it's simple layering.
sonic/donkey kong is drawn on top of everything else.
[Image: ndsMEF0.gif][Image: sig.gif]
Thanked by: Chris2Balls [:B]
#12
Um just one more question.

Everyone: "sigh"

If I was to rotate to camera around Sonic and DK, would they be standing on nothing while the platform is in the distance?

Thanked by:
#13
no
they're all occupying the same plane
sonic appearing in front of things is simply the order that the game draws them in
if you were to rotate the camera, it would be like in smash bros where you stand on the platform
[Image: ndsMEF0.gif][Image: sig.gif]
Thanked by:
#14
Actually, yeah, I can see this being a problem in the sonic example, because he's not talking about plain platforms like in Brawl, but rather, solid objects that are in the background. He wants to know if the character is actually standing on those, too (since they're actually on a different plane). This gets especially weird when the player is constantly moving between the two planes; how does the game know where to place the player on the Z axis (in and out of the screen)?

And really, I don't know. The simplest idea is like that vid Rokkan posted.
Thanked by:
#15
Oh, I see.

The sonic (genesis) example obviously used depth and lighting tricks to make it look as if you were jumping into the background.

I would assume that in a modern game, you'd still be using those same depth tricks and you aren't actually moving on the Z-axis at all; as far as the game is concerned, you're just higher up on the X axis.

edit- But as far as moving on the Z-axis, Rokkan's example makes the most sense.
[Image: ndsMEF0.gif][Image: sig.gif]
Thanked by:


Forum Jump: