View Full Version : illusion of Z-axis
Reanimated
07-14-2004, 10:43 AM
Hi
Im working on a 2D game. The backgrounds are tiled. I need some help with giving the illusion of a 'Z' - axis. If I wanted to the give the illusion of running sideways, I would move the tiles horizontally. If I wanted it to look as if the user is falling or moving upwards, I would move the tiles vertically. But, what do I do to make it look like the users moving INTO the screen? How would I give the illusion that the user is moving into the screen bearing in mind that this is a 2d game?
Thanks for any help
Straightarrow
07-14-2004, 11:02 AM
If your game is top down, then there's a good way: Draw the characters shadow on the ground. The higher the character is over the ground, the farther his shadow should move. That's a good visual clue.
But, since you wrote moving "into" the screen, I assume we're talking something resembling a sidescroller, viewing the character from the side? Perspective scaling the sprite comes to mind. As about the only thing.
Unless someone else can come up with better visual cues, I hope you're not basing to much of your gameplay on this idea (moving on the Z-axis), since it's hard to discern for the player in the heat of battle. In that case, you'd probably be better of going to a 45-degree side/top-down view of your game world.
I hope someone else has better ideas : )
If you want to give the illusion of a fixed camera and the user moving into the screen, scale the player's avatar down and darken it up a bit and (if applicable) change his drawing order such that he is drawn behind the topmost scrolling things (if you have like trees and such).
But this only realistically gives you a few different 'Z' levels. Any more than 2 and the player will probably just get confused.
If you want full 'Z', well that's why they invented 3D.
Fenix Down
07-14-2004, 12:15 PM
Depending on what you want, it can be very simple to do this. Games like Double Dragon (http://web.ttes.ylc.edu.tw/oldgame/oldgame/images/Double%20Dragon%202%20-%20The%20Revenge.gif) and Ninja Turtles on the NES drew the background to look like it had depth. Then they created the illusion of moving into and out of the screen by moving the sprites up and down on the pre-drawn background. Of course you can do more these days as Gfm mentioned, but the basic idea would be something like that.
Reanimated
07-14-2004, 12:28 PM
98% of the game will be a side scrolling platform game. however, theres one scene in which the character jumps off a cliff and the next level begins. The character is falling head first to the floor. I want the camera to be attached to his back so to speak. Hopefully this "diagram" should make it slightly clearer :D
"So called diagram :)" (http://www.realitywarped.pwp.blueyonder.co.uk/s1.JPG)
Obviously, the user would see the game through the camera viewpoint.
I dont want to make it 3d simply because the rest of the game is 2d. Im trying to make it the game work on as many PCs as possible so, I thought 2D would be quite good since 3D isnt required.
EpicBoy
07-14-2004, 01:44 PM
A simple solution would be to change that sequence to something else if that's the only time it happens.
Anthony Flack
07-14-2004, 04:08 PM
The only other option would be to build a custom sequence with lots of complex graphical tricks. Seems more trouble than it's worth, and it might look funny if it is the only time you break the 2d perspective.
If you really want to do this, perhaps a short FMV sequence would be the least painful way.
wazoo
07-14-2004, 08:36 PM
Why not do what the Wing Commander (II??) team did..
Create the scene and pre-render the action..
Is there no way you could "simulate" the scene in a toolkit like Maya or some other type of animator program and just pre-build the scene to make it look the way you want?
Or if it's a side-scroller, what about viewing the scene from the bottom of the cliff looking AT the cliff-bottom??
Okay that made no sense.
Position the camera on the same depth as the floor of the cliff, but back it up WAAAY back (ie. so the guy falling becomes small)...then just have him splat to the ground (or whatever) in a 2d way?
*shrug*
As another poster mentioned, doing this 3d view might be real jarring when the rest of the game is in 2d..
just my 2 cents..
98% of the game will be a side scrolling platform game. however, theres one scene in which the character jumps off a cliff and the next level begins. The character is falling head first to the floor. I want the camera to be attached to his back so to speak. Hopefully this "diagram" should make it slightly clearer :D
"So called diagram :)" (http://www.realitywarped.pwp.blueyonder.co.uk/s1.JPG)
Obviously, the user would see the game through the camera viewpoint.
I dont want to make it 3d simply because the rest of the game is 2d. Im trying to make it the game work on as many PCs as possible so, I thought 2D would be quite good since 3D isnt required.
Nemesis
07-15-2004, 12:17 AM
If your requirement is simply a sprite-based animation scene, I think that all you need is sprite scaling functionality.
So basically you have an image illustrating the cliff edge as viewed from above, with sprites viewed form above, with a slight isometric perspective (like an RPG e.g. early Final Fantas series). You would then scale down the sprite as the character jumps off the cliff.
The effect can be imprived by darkening the sprite while scaling down. If you have alpha blending, all you need is to have a black version of the sprite that is drawn over the original coloured sprite with increasing opacity. For this effect make sence, the cliff floor and lower parts of the cliff walls need to darken progressively with depth as well.