Archived

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

narfidoo

A question about tile based games.

Recommended Posts

I''m creating an isometric tile based game using directX 7. How are tiles generally stored? I''m going to have more tiles than I''m going to want stored in memory at one time. So I''m thinking having one surface with all the tiles I currently have loaded won''t be a good idea. Is having a couple hundred small surfaces a problem in directdraw? Will it be slow and wasteful? What do you all generally do? Thanks

Share this post


Link to post
Share on other sites
What I have done in my program is create an array of tile objects. They contain various information, like a pointer to a surface, an integer for information, and so on. My screen name on Instant Messenger, or AOL, is ImmigrantMarbles and I''d be glad to go into more detail over the chat. I am also willing to give you any of my code so you can look at it and get an idea of what I''ve done if you''re interested. I really don''t know if what I''ve done is the most efficient method, but it seems to work fine for me . Good luck.

--Vic--

Share this post


Link to post
Share on other sites
It depends how many tiles you have, but you certainly want to store more than one per surface. If its a small game dump everything in a single surface, other wise organize them into logical groups: background tiles, character animation, enemies, etc.

Every tile then needs to store a pointer to its own surface, as well as its offset with in the surface.

Most video cards have lots of memory, so I am not sure how you plan on filling it all up, but if you are using many frames of animation, or very complex and unique backgrounds, then I suggest you page all of the textures in and out of memory whenever the player enters new areas that require new enemy tiles, backgrounds, etc.

Share this post


Link to post
Share on other sites