Z
Zephyr Schwarzwolf
Guest
Hi everyone !
I'm still struggling with my depth system for my top-down game in "fake" 3D.
So, here's the situation :
I set a z axis for "height" and created several collisions objects for my different levels. (My levels are based on a 32 pix height per "z unity")
My depth system's like depth = - y - (z*room_height).
You may ask "Why z*room_height" ?
When my playable object is not jumping, (only moving on x and y axis), things work pretty well. It's a simple "depth = - y".
When it jumps on a platform which is set at (z + 1 for example. 32 pix higher) lowers objects on z axis are drawn behind it. WHATEVER HAPPENS !
I know that depth system is not perfect at all, but I couldn't find a better one...
So. here's my problem :
For an object, the depth is set on the origin. Imagine a cube (32*32*32) : When my Player object is in front of this cube, there is no problem. When it jumps over it, there is no problem. When it stand behind it, there is no problem... BUT if it jumps while it stands behind the bloc, it will be drawn over the bloc before its feet reached the top of the bloc.
How could that be possible ? That's because my y_scale is not the same than my z_scale... When my player jumps then gains 32 pix in y, it gains only one unity on the z axis... That's because of that *%*$^p depth limit. With my depth system, each z unity costs a "room_height" in depth... For a 800 height room, I can ONLY set 20 levels. Imagine if I had set my z_scale on the same as y... That couldn't be possible.
If you know what can solve my problem or if you know a different depth system that could be mine, it could be sooo precious.
I've already watched for this : https://www.yoyogames.com/blog/458/z-tilting-shader-based-2-5d-depth-sorting
It could be great, but I have some troubles with the method. (Ok, excepted the shader himself, I have NO idea of how I could use it).
Thank ya in advance !
I'm still struggling with my depth system for my top-down game in "fake" 3D.
So, here's the situation :
I set a z axis for "height" and created several collisions objects for my different levels. (My levels are based on a 32 pix height per "z unity")
My depth system's like depth = - y - (z*room_height).
You may ask "Why z*room_height" ?
When my playable object is not jumping, (only moving on x and y axis), things work pretty well. It's a simple "depth = - y".
When it jumps on a platform which is set at (z + 1 for example. 32 pix higher) lowers objects on z axis are drawn behind it. WHATEVER HAPPENS !
I know that depth system is not perfect at all, but I couldn't find a better one...
So. here's my problem :
For an object, the depth is set on the origin. Imagine a cube (32*32*32) : When my Player object is in front of this cube, there is no problem. When it jumps over it, there is no problem. When it stand behind it, there is no problem... BUT if it jumps while it stands behind the bloc, it will be drawn over the bloc before its feet reached the top of the bloc.
How could that be possible ? That's because my y_scale is not the same than my z_scale... When my player jumps then gains 32 pix in y, it gains only one unity on the z axis... That's because of that *%*$^p depth limit. With my depth system, each z unity costs a "room_height" in depth... For a 800 height room, I can ONLY set 20 levels. Imagine if I had set my z_scale on the same as y... That couldn't be possible.
If you know what can solve my problem or if you know a different depth system that could be mine, it could be sooo precious.
I've already watched for this : https://www.yoyogames.com/blog/458/z-tilting-shader-based-2-5d-depth-sorting
It could be great, but I have some troubles with the method. (Ok, excepted the shader himself, I have NO idea of how I could use it).
Thank ya in advance !