🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How to render 2-3 layers of tiles...

Started by
13 comments, last by granat 24 years, 6 months ago

I just looked at your Artifact homepage. It seems to me that that Artifact is a type of game which does not rely on fast framerate.
But an actiongame like a platform game the framerate can mean either success or failure when trying to do precision jumps.

20+ frames on a 266 mhz pentium ? I would say that for a platform game it should be at least 30 frames. Maybe thats too optimistic ?
BTW your "entire visible map" is not that big is it ?Because you use a lot of space for other stuff. But it sure sounds like you blit like a madman

I just discovered this site recently.. BOY DO I LIKE IT!!
People actually answer my posts....GAMEDEV Rules !!!!

-------------Ban KalvinB !
Advertisement
Thanks for checking out the game.

No, I don''t need "monster" frame rates. I was just pointing out that I do actually get decent framerates...even with all that blitting and *without* using DirectX. If you just looked at the screen shots, BTW, a quick caveat: Those are made at the 640x480 size to keep them small. It''s possible to run the game maximized at 1024x768 (and a number of players do...they like all the extra visible map).

So if you use DirectDraw and judicious use of video RAM, you should be able to achieve the results you want.

Today''s PCs can do a simply incredible amount of processing in what seems an impossibly short time. Take advantage of it. =)

Welcome to GameDev, BTW.


DavidRM
Samu Games
In response to your first question, it is completely possible to get fast frame rates using multiple layers. Just design the maps where there is no overdraw. If a tile completely obscures another, then just don''t draw that obscured tile. There''s no coding secrets like pixel-by-pixel checking. Just regular blits will do.

Another thing - you realistically only need to draw one layer, and as you''re drawing it, scan to see if any tiles exist on layers above it. Flag that and when it comes to draw that layer, use a faster method since you already know which sections have, and don''t have, tiles to blit.

If you check out our old TLB demo at my page, it''s only 640x480x8, doesn''t use DirectDraw on tile drawing, and it has 8 layers at certain parts, and it flys.



Jim Adams
Game-Designer/Author
tcm@pobox.com
http://www.lightbefallen.com
http://basicelectronics.com
Actually... You would have to draw all the layers one over another in the right order. You cant skip the base layer and draw an object over it for one reason. Obviosly your objects arent all blocks so you will need transparency. That means youll have to draw all the layers completely, you can''t have a chair with no floor below it. =)

-Bryan
Maybe I didn''t make myself clear there - you only need to process a complete layer (the first), which usually has at least one tile per map section. During that first layer scan, you''d setup pointers to where the tiles are on the above layers, thus saving the need to scan every single layer looking for something to draw.

Hence, it would tremendously increase the speed at which you render multiple layers...




Jim Adams
Game-Designer/Author
tcm@pobox.com
http://www.lightbefallen.com
http://www.basicelectronics.com

This topic is closed to new replies.

Advertisement