Original Post
I’ve got a question here that’s not directly related to the isometric view although the game I am working on is isometric so I decided to ask you nice folks. Ok well, this isn’t exactly my first game using direct draw or even the isometric view but yet I’ve got a rather basic question. My question is asking for theory and no more so take a shot at it if you feel upto it.
If you’re using many hundreds of tiles for a game and dynamic maps with dynamic tiles and all that how do you keep track of the surfaces for the tiles?
See, I was thinking of some sort of array of my own type. Have one thing for the tile ID and one for the pointer to that tiles surface. But to me this has a major flaw that I would hope someone has a way around. See, this method has to search the array everytime it wants to paint a tile.
When thinking about it, this game has mutliple levels so it will be passing by and drawing tiles on the screen more than once and I’m also using rather small tiles for my screen resolution in the game; 64x32 / 800x600. So there will be a lot of tiles being painted on here.
One good thing about the array method idea of mine is that the surfaces are created in an importance level. The tiles used most often would be at the top of the array while the ones used left often would be at the bottom. The only time this isn’t true is when a tile already exists in the array that needs to be reloaded for the next section.
Another good thing about the array is that I am using rather large maps and realize all of my tiles aren’t going to be used all the time. For this reason I’ll be making the code cut the map into sections and load only the tiles needed for the section of the map the user is on.
While these last two things aren’t exactly good things about using the array they do offer hope of speeding it up a little.
What do you guys think about the array method I’ve come up with for keeping track of the tiles? Happen to know of any other methods that may be faster? I would appreciate any feedback on this post.
Thanks,
Kyle LaDuke