Jump to content
  • Advertisement
Sign in to follow this  
Programmer16

2D Isometric game - questions

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

I'm making a 2D isometric game and I'm worried about depth (displaying my character correctly.) I've come up with a couple of ideas, both of which I have no idea where to start: 1)2D in 3D The way Baldur's Gate was done? 2)Orthographic projection? The first is what I'd really like to do, but I can't (because of the intensive graphics) and the second was suggested to me. Or, I could just store an array of depth values for the the map and then sort the objects. Any suggestions?

Share this post


Link to post
Share on other sites
Advertisement
If it's a pure 2D game (that is, none of this recommended "2D in 3D" stuff [smile]) then can't you just sort the draw order and effectively get depth buffering?

I'm pretty sure that's how I'd go about getting depth in an iso-tile game.

hth
Jack

Share this post


Link to post
Share on other sites
I've been contemplating on that. I've been looking for/working on a 2D drawing library. Then I could copy it to a texture and viola.

If I supply a different Z value will it be sorted correctly (my vertex structure has x,y,z, and w)?

Thanks!

Share this post


Link to post
Share on other sites
Quote:
Original post by Programmer16
If I supply a different Z value will it be sorted correctly (my vertex structure has x,y,z, and w)?

AAh, so you're using "2D in 3D" then [smile]

The Z value you specify in your Z coordinate (provided depth buffering is configured) will work as you expect. Drawing a tile with Z=0.0 will always appear in front of a tile with Z=0.5 irrespective of what order you issue the draw calls.

The only exception is for semi transparent tiles/objects, as these will need to be manually depth sorted and rendered in a seperate pass.

As I think superpig commented on a similar thread - you can create a completely "normal" looking 2D isometric game completely in 3D if you get the correct camera and projection set-up. Not sure if you fancy it, but it is an interesting route to take - particularly given the abundance of 3D algorithms these days [smile]

hth
Jack

Share this post


Link to post
Share on other sites
You're going to have to build a render list and sort it by Y value as well (top to bottom) to ensure characters "below" other characters are rendered last. I personally sort by Z, Y then Texture and don't have any significant performance problems.

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Quote:
Original post by Programmer16
If I supply a different Z value will it be sorted correctly (my vertex structure has x,y,z, and w)?

AAh, so you're using "2D in 3D" then [smile]

The Z value you specify in your Z coordinate (provided depth buffering is configured) will work as you expect. Drawing a tile with Z=0.0 will always appear in front of a tile with Z=0.5 irrespective of what order you issue the draw calls.

The only exception is for semi transparent tiles/objects, as these will need to be manually depth sorted and rendered in a seperate pass.

As I think superpig commented on a similar thread - you can create a completely "normal" looking 2D isometric game completely in 3D if you get the correct camera and projection set-up. Not sure if you fancy it, but it is an interesting route to take - particularly given the abundance of 3D algorithms these days [smile]

hth
Jack


I wanted to do ISO3D, but I can't find any tutorials. I had a small quad rendered and I had them oriented pretty good, but because of my perspective projection it looked wierd when I was moving. I think I'll go with 3D since immitating depth in 2D is quite tedious.

Share this post


Link to post
Share on other sites
Quote:
Original post by smr
There are several tutorials on gdnet.

Isometric and Tile-based Games


I've looked at all of those, but they haven't really helped with my sorting.

Thanks Jack, I'll look into those (I had thought about using an ortho projection, but I can't find any tutorials that use them.) I've never used an ortho projection, so I guess its off to experiment!

Thanks guys!

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!