Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

So I got my isometric renderer working, it can draw diamond or jagged maps...Then I want to move on...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) and drawing the tiles in a order so alpha blending works correctly.

So, anything I draw in this map must be drawed at the same time the map is being drawn, with sucks a lot, screws your very modular map drawer, because now everything on the game (but the HUD) must be included on the drawer..

I was thinking whats the best approach to do this, comparing the position of all objects(not tile stuff) on the grid against the current tile being draw seems stupid, would it be better to add an id ON the grid(map)? this also seems terrible, because objects can move freely, not per tile steps (it can occupies 2 tiles if its between them, etc.)

Dont know if matters, but my grid is 3D, so its not a plane with objects poping out, its a bunch of pilled cubes.

share|improve this question
    
So, anything I draw in this map must be drawed at the same time the map is being drawn - Can you elaborate on this? I don't understand how that could be possible. –  Cypher Sep 11 '12 at 16:16
    
Well, the map cant be entirely drawn, then draw the objects after, because objects can be in front of some map tiles(cubes) but behind others, so everything should be sorted and drawed in the same "pass" –  Icebone1000 Sep 11 '12 at 23:45
    
You'll need to use a technique called z-buffering or depth buffering. You can then sort and draw all your sprites based on a z-buffer to draw them in order. That's what @Luke B. is talking about when he talks about giving sprites a "Z value". –  Cypher Sep 12 '12 at 16:08

1 Answer 1

Instead of having the map drawer traverse the grid, make it traverse every drawable object and make no distinction between tiles or whatever else you have on the screen. There's no need for the drawer to know about tiles, it should know only about sprites and their position on the screen. You can also add a Z value to your screen objects and have an ordered list based on that Z, so the drawer can just draw from the first to the last in that list and they will be in the right position in the screen.

share|improve this answer
    
So you saying 100% of the algorythms for drawing isometric maps out there are unfeasible for objects? –  Icebone1000 Aug 12 '12 at 11:27
    
Do you have a specific algorythm in mind? I can't help much without code. –  Luke B. Aug 13 '12 at 11:51
    
@LukeB. I'm making an strategy, medieval-themed, tiled, isometric (dimetric) game and it will have both "city-building" (CMS) and combat aspects. I need a 3D system (XY and Z) for the coordinates of units and projectiles in the world, and I'm worried that, if the render-order is based on the 3D coordinates, if a terrain tile at position [0,0,0] and a unit is also at that coordinate, the unit might be rendered first, thus under the terrain it's supposed to stand above of. --- How do I proceed? –  TheLima Oct 4 '13 at 17:00
    
@TheLima You should make a new question, your problem is different from this question and I'm not sure I understood everything. –  Luke B. Oct 4 '13 at 17:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.