Jump to content
  • Advertisement

Archived

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

Jello

Pre-"rendered" Backgrounds

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

I''m making a somewhat tile-based game with direct x. I say somewhat tile-based because I''m using entirely pre-made backgrounds, but plan on blitting from 32x32 rectangles onto my main surfaces (Creating one big surface for the background, and blitting 32x32 pieces of it as if they were seperate tiles) . I''m wondering, would it be better(faster/smoother) to just blit the entire 800x600 rectangle onto my backbuffer rather than simulate a tile based design? I''m going to use a resolution of 800x600, but the backgrounds will have dimensions larger than 800x600... _________________ MOV ax, bx asm programming written by Jello

Share this post


Link to post
Share on other sites
Advertisement
Your main problem will be with the size of the background images. If you''re going to use bitmaps around 5000x5000x24, it will take too much memory and disk space. The only reason to use tile base blitting would be if you store the large bitmap into a custom format which is tilebased in order to keep the overall size small.

Take a look at Baldurs Gate and see how it works there.

Hope this helps.


--Anthony
http://www.quanta-entertainment.com

Share this post


Link to post
Share on other sites
I think your best bet would be to take your huge 5000x5000x24 bitmap, and break it into 400x300 tiles so you can always cache an 8x8 tile set:


A B C D
E F G H
I J K L
M N O P

tiles F G J and K represent the current viewable area (800x600), but if you walk left into E, E moves to F, F moves to G, G moves to H, H is freed, and a new part of the tile is loaded into E. Your loading can be done in a secondary thread in the background so it doesn''t have to be done in one complete frame; it simply needs to be loaded before the user has walked 400 more pixels to the left.

You''d need a tool that would split the data up into those parts, but it would be pretty easy (IMHO).

Does that make sense?

Share this post


Link to post
Share on other sites
Wasn''t thinking of D3D really, but you are right. 256x256 tiles are a more sensible size to use. I guess in my haste to provide an example of the sollution, I forgot some of the more important aspects of actually drawing the data

Share this post


Link to post
Share on other sites
You could also compress your graphics if you have a
lot of repeated colors as this will cut down drastically
on the amount of required memory reads, and save memory.

Hope it helps

Mark

Share this post


Link to post
Share on other sites
Hello there,

Both, if you do it in the file as well it will reduce load times,
all you need to do is write a tool that loads in your bitmap files
and saves them to the custom format.

You need to do your own blitting routines (obviously) but these are relativly simple (depending on what you are using for output).
When I was using 2D I used DIBS as these are simple and quick to
access.

Hope it helps

Mark.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!