Archived

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

fimpen

Need urgent help with a tile engine!

Recommended Posts

I have trouble seeing the point of tiles in direct x. Surely they bring down the storage reaquirements, but thats not really an issue. I still have to blit the same amount of information to my back buffer, and it takes longer to do all the small tile blits than just blitting a RECT from a large picture. Please explain.

Share this post


Link to post
Share on other sites
Well, look at it this way: when you blit a full-screen RECT, you blit only once. While in the case of, say, a screen composed of 32x32 tiles, you blit 1024 times. See where I''m headed?

Basically, you''re blitting many, many more times in the case of tiles. The function is called once every tile, whereas it is called only once in the case of a full-screen blit.

Share this post


Link to post
Share on other sites
well, thats my point exactly. why would all those little blits help the performance? it seems to me like using tiles would actually require more work from the graphics processor each frame.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

Well, it''s usually easier from an art production standpoint to work with tiles.

You''re also using up the same amount of fillrate either way, which is more likely to be your limiting factor than overhead from calling the blit function.

Finally, I close with 2 words:

Cache misses.

Share this post


Link to post
Share on other sites
Yes it''s more work and it''s slower. However, consider a Super Mario Bros. game. If they made each level one big picture and did one blit at a time, they would have to spend a long time on each level, and it would take up a huge amount of space.

tj963

Share this post


Link to post
Share on other sites
also remember you are going to use the same tiles over and over so you only need to load it once which is going to cut down on your memory usage. I would recomend making it so you can mix tiles with larger images.

Share this post


Link to post
Share on other sites
thanks guys, it seems I had it figured from the start. the problem is my comp cant seem to move that amount of data fast enough (30 fps). I wish I could have front/back buffers larger than the viewport and then specify a rect to flip -essentially redirecting the memory pointers a bit each frame using the same line offsets, blabla, you know what I´m gettin at

possible?...nah

Share this post


Link to post
Share on other sites