• Advertisement
Sign in to follow this  

Isometric engine

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

Hello, I have recently been working on a isometric engine in XNA. I have rendering working but on large maps (on my computer at about 500x500) is starts getting sluggish. The problem is the fact that all tiles are drawn regardless of whether they are on the screen. Right now I am looping through the entire array of tiles and checking whether the destination rectangle intersects with the graphics window rectangle. If so, then the tile gets drawn. I would however like to be able to determine beforehand which tiles are drawn and which are not so I don't have to loop through the entire array which is where I am losing the most performance right now. I haven't got a clue on how to start implementing this though. Any pointers would be greatly appreciated. Cheers!

Share this post


Link to post
Share on other sites
Advertisement
You could implement some hierarchy like a quadtree

This way, at the top level, you'll have 4 nodes to test for visibility, and rejecting one will reject 1/4 of all the tiles in your world


Alternatively, and probably a better approach is to calculate the tile at the top-left and bottom-right of the screen, and loop over those - that way you won't even need to test anything off-screen. Hopefully you can easily address tiles by X,Y so this is trivial

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement