Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualIcebone1000

Posted 12 August 2012 - 07:52 AM

I just finished my Isometric drawing class that can draw 2D cubic tilemaps (its not a single plane with objects on top, its a lot of cubes piled, planes divided on what I call floors (no, Im not cloning minecraft)).

I can draw in diamond shape and in the staggered shape, as described in most algorithms out there..Whats holding me up now is something I didnt find in any isometric article/topic out there, how do I draw characters/objects on it in a optimal way?

What Im doing now, as one can imagine, is traversing my grid/map ( its a 3d array) and drawing the tiles in a order so alpha blending works correctly.

Well, things are a lot easier when you just have a plane with objects on top of it, but since my grid is 3D, I cant see any other way than having to draw all my objects at the same time Im drawing the map, with screws the cuteness of the code..

I cant imagine a good way to do this, things that I can imagine is:

#1# give a list of objects(sprites and its positions) to the iso drawer, each loop iteration on the map drawing algo checks the position of all objects against the current tile on the grid....This is the most inefficient thing I ever imagined (for each tile on the map, check all the objects..)

#2# each time a object moves, insert it ON THE GRID, this is so ugly..screws everything, the isodrawer now will change a lot since now its not more a map drawer, its the entire game drawer (except the HUD)(well, this is true for #1# too)...Second problem with this approach is that objects can move freely, not per tile movement, so an object can occupy 2 tiles (be between 2 tiles), dont know how Id handle it.

#3# Forget the " iso drawer "map drawing algo" ", transform it onto a " "depth list" composer ", the list consist on [2D position, uv, Z(depth)] of all tiles on the map, then insert ..somehow..the objects on that list, then draw the list...I cant say for sure if this is feasible, youd have all tiles Z values, than you can compute all objects Z values, now totally independent, (the trick here would compute the Z of the objects considering its position on the map (i.e. object at floor 2, row 4, col 1 : Z = ? ) and the tiles Z too(giving top floors tiles higher Zs, etc.).......

Im using XNA spritebatch for doing this, I think (not sure, I just started using xna) that it can draw sorted by Z order for you, so I wouldnt need to sort the list.

Any links, tips or ideas are welcomed ;D

"why dont you do it 3D?" 3D is good for ultra realistic graphics, for simpler stuff it looks terrible, because 2D art is owsome and cant be compared with 3D, they are two different fields, not the evolution of the other, because I prefer it, because Im fan of isometric 2D for long, because programming iso stuff is tricky and is forcing my mind a lot.....IMO


Heres a screen shot of what I current have:
Posted Image

#2Icebone1000

Posted 12 August 2012 - 07:51 AM

I just finished my Isometric drawing class that can draw 2D cubic tilemaps (its not a single plane with objects on top, its a lot of cubes piled, planes divided on what I call floors (no, Im not cloning minecraft)).

I can draw in diamond shape and in the staggered shape, as described in most algorithms out there..Whats holding me up now is something I didnt find in any isometric article/topic out there, how do I draw characters/objects on it in a optimal way?

What Im doing now, as one can imagine, is traversing my grid/map ( its a 3d array) and drawing the tiles in a order so alpha blending works correctly.

Well, things are a lot easier when you just have a plane with objects on top of it, but since my grid is 3D, I cant see any other way than having to draw all my objects at the same time Im drawing the map, with screws the cuteness of the code..

I cant imagine a good way to do this, things that I can imagine is:

#1# give a list of objects(sprites and its positions) to the iso drawer, each loop iteration on the map drawing algo checks the position of all objects against the current tile on the grid....This is the most inefficient thing I ever imagined (for each tile on the map, check all the objects..)

#2# each time a object moves, insert it ON THE GRID, this is so ugly..screws everything, the isodrawer now will change a lot since now its not more a map drawer, its the entire game drawer (except the HUD)(well, this is true for #1# too)...Second problem with this approach is that objects can move freely, not per tile movement, so an object can occupy 2 tiles (be between 2 tiles), dont know how Id handle it.

#3# Forget the " iso drawer "map drawing algo" ", transform it onto a " "depth list" composer ", the list consist on [2D position, uv, Z(depth)] of all tiles on the map, then insert ..somehow..the objects on that list, then draw the list...I cant say for sure if this is feasible, youd have all tiles Z values, than you can compute all objects Z values, now totally independent, (the trick here would compute the Z of the objects considering its position on the map (i.e. object at floor 2, row 4, col 1 : Z = ? ) and the tiles Z too(giving top floors tiles higher Zs, etc.).......

Im using XNA spritebatch for doing this, I think (not sure, I just started using xna) that it can draw sorted by Z order for you, so I wouldnt need to sort the list.

Any links, tips or ideas are welcomed ;D

"why dont you do it 3D?" 3D is good for ultra realistic graphics, for simpler stuff it looks terrible, because 2D art is owsome and cant be compared with 3D, they are two different fields, not the evolution of the other, because I prefer it, because Im fan of isometric 2D for long, because programming iso stuff is tricky and is forcing my mind a lot.....IMO


Heres a screen shot of what I current have:
<a href="https://picasaweb.google.com/lh/photo/AvFu-KIFhKYG3KJnRXyfenb7WSThf7sVR0-YnKgTanc?feat=embedwebsite"><img src="https://lh5.googleusercontent.com/-pIMgk74fQGg/UCevCkXHGNI/AAAAAAAAAVg/Q793EL1sRH8/s144/isoSS_cubicTilemap.png" height="83" width="144" /></a>

#1Icebone1000

Posted 12 August 2012 - 07:50 AM

I just finished my Isometric drawing class that can draw 2D cubic tilemaps (its not a single plane with objects on top, its a lot of cubes piled, planes divided on what I call floors (no, Im not cloning minecraft)).

I can draw in diamond shape and in the staggered shape, as described in most algorithms out there..Whats holding me up now is something I didnt find in any isometric article/topic out there, how do I draw characters/objects on it in a optimal way?

What Im doing now, as one can imagine, is traversing my grid/map ( its a 3d array) and drawing the tiles in a order so alpha blending works correctly.

Well, things are a lot easier when you just have a plane with objects on top of it, but since my grid is 3D, I cant see any other way than having to draw all my objects at the same time Im drawing the map, with screws the cuteness of the code..

I cant imagine a good way to do this, things that I can imagine is:

#1# give a list of objects(sprites and its positions) to the iso drawer, each loop iteration on the map drawing algo checks the position of all objects against the current tile on the grid....This is the most inefficient thing I ever imagined (for each tile on the map, check all the objects..)

#2# each time a object moves, insert it ON THE GRID, this is so ugly..screws everything, the isodrawer now will change a lot since now its not more a map drawer, its the entire game drawer (except the HUD)(well, this is true for #1# too)...Second problem with this approach is that objects can move freely, not per tile movement, so an object can occupy 2 tiles (be between 2 tiles), dont know how Id handle it.

#3# Forget the " iso drawer "map drawing algo" ", transform it onto a " "depth list" composer ", the list consist on [2D position, uv, Z(depth)] of all tiles on the map, then insert ..somehow..the objects on that list, then draw the list...I cant say for sure if this is feasible, youd have all tiles Z values, than you can compute all objects Z values, now totally independent, (the trick here would compute the Z of the objects considering its position on the map (i.e. object at floor 2, row 4, col 1 : Z = ? ) and the tiles Z too(giving top floors tiles higher Zs, etc.).......

Im using XNA spritebatch for doing this, I think (not sure, I just started using xna) that it can draw sorted by Z order for you, so I wouldnt need to sort the list.

Any links, tips or ideas are welcomed ;D

"why dont you do it 3D?" 3D is good for ultra realistic graphics, for simpler stuff it looks terrible, because 2D art is owsome and cant be compared with 3D, they are two different fields, not the evolution of the other, because I prefer it, because Im fan of isometric 2D for long, because programming iso stuff is tricky and is forcing my mind a lot.....IMO


Heres a screen shot of what I current have:
<a%20href=

PARTNERS