Jump to content
  • Advertisement
Sign in to follow this  
Sylon

Characters jumping over 2D isometric objects?

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

In a previous post I declared I was a newbie and that's cool with me. I want to learn programming one way or another, typically starting with easy languages like BASIC. Currently I know basically very little and I am currently going to learn DarkBASIC starting this week but I want to get some things straight, even though. I BELIEVE (though I am program-dumb) that my question is difficult to answer! My question is about 3D space within a 2D ISO game. I want to make objects (cubical, spherical, irregular like trees) that are able to be *jumped over* by characters. So, the sprite image of the character has to be able to be drawn to screen by priority in front of and behind the same object, depending on whether he is on a tile below the object, or a tile above it, at given times, right? So when he jumps, he automatically transfers from being either above the object to below it, or below the object to above it (which should trigger the priority of the tiled object to be drawn to screen before and/or after the character's "jumping" sprite). I have seen dynamic objects go "behind" ISO objects before in games, so obviously I'm not that dumb--I know it can be programmed. Take a look at what I want my game to be able to do in regards to characters jumping over isometric objects. Jumping in Isometric 2d Basically, take iso objects of all heights and sizes and shapes and pretend a character can jump over it, under it, around it, etc. from ALL angles in 3D space. All I want to know for this part is, is it possible to code this into an isometric 2D game? You DON'T have to explain to me how to do it, I will find out in the future--currently I might not be able to grasp it. All I want to know is if it is possible? Because currently I am designing the graphics to my game and I need to know beforehand. Now, I *assume* there *is* a way to do it (don't know), so this brings me to a puzzling question! Say a sprite walks behind a cube, then jumps on top of it. He lands on top of the cube. From being drawn "behind" the cube he is now drawn "in front of" the cube (to give the illusion he is on top of it). This was achieved by altering the priority of the cube sprite, right? An "IF THEN" must have been coded to say essentially "Now the cube is drawn behind/before the character sprite". So then what if a DIFFERENT character with the same priority as the first one walks behind the cube (doesn't jump on it)--is the cube going to be drawn behind THAT character, too, even though it is supposed to be in front of the new character? Is it possible to avoid this problem in coding? Obviously I haven't played that many ISO games...hehe. Just AoE2 but that didn't prove much to me in terms of jumping, because the units can't jump over houses and stuff...lol. But please don't tell me to program a 3D game because I don't want 3D! I know what I want and for what reasons I want it and I don't want to make a 3D game! Thanks for your help. [Edited by - Sylon on February 14, 2006 10:09:53 AM]

Share this post


Link to post
Share on other sites
Advertisement
Your post seems a little confusing to me. What do you want to know? If making a sprite able to appear above another at one time then below at a different time is possible? Then, yes.

Share this post


Link to post
Share on other sites
There are probably some articles discussing what you're talking about here.

In a naive first impression, I'd say to draw your map/entities based upon height, from back to front. So start with the layer 0 (floor) and draw it from back to front. Then draw layer 1 (people and objects on the ground, column bases) etc. Thusly, your character behind a column will be hidden behind it, and when on top, will be drawn after ("on top of") it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Brandon N
In a naive first impression, I'd say to draw your map/entities based upon height, from back to front. So start with the layer 0 (floor) and draw it from back to front. Then draw layer 1 (people and objects on the ground, column bases) etc. Thusly, your character behind a column will be hidden behind it, and when on top, will be drawn after ("on top of") it.


I think he just needs to draw from back to front. If his isometric tiles are actually at different elevations, then that will be more tricky. But if it's just objects that aren't part of his map, the back to front should do.

Share this post


Link to post
Share on other sites
Quote:
Original post by smr
Quote:
Original post by Brandon N
In a naive first impression, I'd say to draw your map/entities based upon height, from back to front. So start with the layer 0 (floor) and draw it from back to front. Then draw layer 1 (people and objects on the ground, column bases) etc. Thusly, your character behind a column will be hidden behind it, and when on top, will be drawn after ("on top of") it.


I think he just needs to draw from back to front. If his isometric tiles are actually at different elevations, then that will be more tricky. But if it's just objects that aren't part of his map, the back to front should do.
His image shows elevated tiles.

Share this post


Link to post
Share on other sites
Yes this can be done with relative ease. In the isometric view height is simply a translation upward on the screen. So when you draw your jumping object you draw it when your engine gets to drawing the base tile it is on. Imagine an invisible flat grid at height=0, this is how the engine decides where to position the object initially, then it simply translates upward based on the objects actual height position. So all objects on a square will be drawn at the same time as that square no matter what their height position may be.

Sorry if that is confusing, it is actually really simple. It just failed to present itself as such in writing…

Share this post


Link to post
Share on other sites
cyberfox is saying: if an object is 100 pixels tall and the player jumps onto it -> find where you would usually draw the player if the grid the object is in was flat and then draw your player 100 pixels above that point - your player should now be standing on top of the object. With the right ordering (back-front) you'll also get the effect of 'raised tiles' where tall objects block out whats behind them.

Share this post


Link to post
Share on other sites
Quote:
Original post by Brandon N
His image shows elevated tiles.


I suppose what I'm saying is that if the elevated tiles are actually tiles, instead of separate objects drawn in the same pass as the other sprites then simply drawing from back to front will get the job done.

Share this post


Link to post
Share on other sites
Quote:
Original post by smr
Quote:
Original post by Brandon N
His image shows elevated tiles.


I suppose what I'm saying is that if the elevated tiles are actually tiles, instead of separate objects drawn in the same pass as the other sprites then simply drawing from back to front will get the job done.
Ah, ok. I misunderstood you. Cheers.

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!