Jump to content
  • Advertisement
Sign in to follow this  
Dinomike

Question about 2D games that allow 3D movement

This topic is 3611 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

Hello, There are some games that use 2D rendering (IE sprite based), but the characters can move in 3 dimensions. Specifically, I'm thinking of a game format like Capcom's Final Fight. Would coordinate transformations similar to 3D graphics rendering be required for such a game? Any information about this would be helpful (ie: resources, books, etc...) Thanks, Mike

Share this post


Link to post
Share on other sites
Advertisement
3D in my mind is more an issue of artistry and not so much programming. Everything in programming is one dimensional text forming 2 dimensional image trickery to make you think it's 3 dimensional.

Of course... perhaps i shouldn't be speaking on it as i can do nothing in 3D but consider that to create environ all you are do is shifting the camera and shrinking or growing an object and displaying a mathematically defined angle...

If I were to try to cheat I'd simply make 2D sprites that when the user pushed up it simply moved a background/foreground that is prerendered so that it's just a larger flat 360 panoramic background/foreground and just slowly tick it around.

It sounds odd but it would work if one did it right.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dinomike
Hello,

There are some games that use 2D rendering (IE sprite based), but the characters can move in 3 dimensions. Specifically, I'm thinking of a game format like Capcom's Final Fight.

Would coordinate transformations similar to 3D graphics rendering be required for such a game?
There is no 3 dimensional movement in Final Fight. You move up and down, and travel to the right.



The depth is just the height of the sprite in the playable area. The background is drawn at an angle, and it creates a very small illusion of depth.

Share this post


Link to post
Share on other sites
Hmmm...

I was thinking it was 3D because the character can move up and down, left and right, and also jump up and down. So I guess if it's still 2D, does that mean that no coordinate transformations (ie matrices) need to be done?

Share this post


Link to post
Share on other sites
It's just 2 different things that happen

the sprite base moves up/down and is slightly shrunk/enlarged when moving toward and away from the wall with a certain speed

when they jump they do not shrink/grow and the speed with which they go up and down is faster and non-permanent.


What you need to do is have a variable of some sort that tracks where it is on the floor so that the sprite when it jumps it know the right height to jump up to, and return back to...though i guess it would be easier to just have a loop that has a predetermined positive and negative number that it is going to count up/down to.

However if i remember right those type of games have some sort of pressure sensitivity...

so

define x and y
capture button press and length of time
apply that to the height of the jump
loop up to match that height and then down to match it as well

I think that's pretty simple.

Share this post


Link to post
Share on other sites
Durakken, your posts are a bit off.

Quote:
Original post by Dinomike
Hmmm...

I was thinking it was 3D because the character can move up and down, left and right, and also jump up and down. So I guess if it's still 2D, does that mean that no coordinate transformations (ie matrices) need to be done?
Only if you want to over complicate things for yourself.

There are no shrinking sprites. They just move up and down. There is no attempt here to maintain perspective, just like top down RPGs.

The rendering if like everything else that has some kind of depth like that. You sort the sprites by height and draw them top to bottom to keep the right objects behind the right objects. In modern times, you can just use the depth buffer for this.

Share this post


Link to post
Share on other sites
well actually final fight uses x, y, z


x = left, right

y = altitude i.e. jumping

z = depth i.e walking up and down

in your draw method for 2d sprites you would have something like this

ken->draw(x, y, z);

some sdks only have x and y in their vecttors for draw methods, in that case just override it to support z.


draw(x, y, z)
{
VECTOR2D vec;
vec.x=x;
vec.y=y+z;

SPRITE::draw(vec);
}


the y+z means that this positions are independent from each other.

Share this post


Link to post
Share on other sites
you will then sort sprites in your list via z.

jumping is pretty easy all you need to do is y-=velY for the basic jumping algorithm.

most final fight clones are not pressure sensative but you can double jump.

i am also working on a game engine which is specific to the scrolling beat em up genre.

Share this post


Link to post
Share on other sites
A vital ingredient to the 3D illusion is a shadow on the ground that only moves in 2D. Otherwise you cannot tell if your character is jumping really high in the foreground or jumping low in the background.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!