Archived

This topic is now archived and is closed to further replies.

coderdude

Need Help With Isometric Maps

Recommended Posts

I am trying to write an isometric graphics engine like the one that is used in SimCity. However, rather than being totally tile based, I would like to have sprites (much larger than regular tiles) moving around on my map. Can anyone help me out by pointing me towards some resources on how to use sprites with an isometric map? Sample code would be great! Thanks!

Share this post


Link to post
Share on other sites
Aren''t your tiles sprites? Just blit them where you want them and you''re done.

e.g.

1. draw the map tiles
2. draw the monsters (or whatever)

The only difference is your tiles happen to be shaped like diamonds.

Share this post


Link to post
Share on other sites
Guess I wasn''t clear enough...

By sprites I mean objects that aren''t limited to tile constraints (such as only having an X,Y coordinate that is divisible by 64 or whatever the size). The minions in Diablo are a great example of this. They can be offset from a tile.

The only way I can think of drawing the sprites into an isometric view would be...

While I am drawing my isometric map (tile by tile)... I would scan through every single moving sprite to see if it is on that tile... If so, I draw the sprite. If not, I don''t.

A 10x8 size map would have a total of 80 tiles. If I had 300 moving sprites on my map, that would come out to approximately 24,000 calculations I would have to make per frame.

This doesn''t seem very efficient to me. Maybe I''m wrong. Maybe there is no better way to do this.

Share this post


Link to post
Share on other sites
Well, if you don''t want your sprites to be subject to the tile restrictions, just don''t use the tile coordinate system. Lay down all your tiles first, and then determine the pixel coordinates of your sprites and do them second. For efficiency''s sake, you may want to make any tile that a sprite covers for refreshing when the sprite moves, so that you only redraw the tiles that were overwritten instead of the whole screen.

Share this post


Link to post
Share on other sites
different question but u could do what ive done and do it purely 3d but still from a iscometric viewpoint, thus enabling u to zoom in/out of the map.

answer to your questiopn:

just workout what tiles are on the screen at the time and draw those and anything else that may be upon them

Share this post


Link to post
Share on other sites