Archived

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

Objects on an Isometric map

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

Hi, Well, should the tiles on an isometric map, know what objects are on it, or should they not, or should the object know what tile it is on? Or should both know? The reason I ask is, that I was wondering how you should calculate what order to draw objects in. Not the tiles, but objects, such as maybe a Car, like in Simcity 3000, or a building. How do you figure out the order in which to draw the objects in as little time as possilble. P.S. I realize that you should draw them from left to right, top to bottom. Thanks

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yes, it is common for the objects to know what tile they are in, but I don''t use that info for drawing.

I loop through each tile in the map structure (L-to-R, F-to-B) and draw each tile and its contents. Or you could draw each layer all at once - draw all the backgrounds, then all the objects (etc) though it costs an extra loop.

In either case, I loop through the map structure to get to the objects, so the object doesn''t need to know where it''s at (TileX, TileY) to draw itself.

Where storing that info in the object does come in handy is actions that start from the object. Ai routines, line-of-sight routines, that sort of thing.

Of course, this is just what I do, your mileage may vary.

Share this post


Link to post
Share on other sites