# 2D Isometric game - questions

This topic is 4883 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
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 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 on other sites
Well, all you have to do is loop through the array of images and draw everything, assuming the array is sorted.

##### Share on other sites
Quote:
 Original post by Programmer16If 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 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 on other sites
Quote:
Original post by jollyjeffers
Quote:
 Original post by Programmer16If 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 on other sites
There are several tutorials on gdnet.

Isometric and Tile-based Games

##### Share on other sites
Quote:
 Original post by smrThere 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!

1. 1
2. 2
3. 3
Rutin
14
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633674
• Total Posts
3013275
×