Loading large background graphic

Started by
14 comments, last by Nivelo 23 years, 10 months ago
Hi, I am writing an overhead scrolling game with 360 degree movement. I want a backdrop to be displayed and I am currently scrolling a generic backdrop, overlaying specific terrain details, according to the world coordinates, as sprites. I was looking at loading a JPEG and using this but, at 800*600 resolution then a world 10 screens high by 10 wide will require a large amount of memory. I was wondering how games like Baldurs Gate does this as the whole backdrop appears to be in memory at one time. What are the minimum memory spec that is to be expected nowadays? Any thoughts/suggestions would be good, Niv
Advertisement
You should try and create smaller areas that fits in memory.
You can't possibly fit 10x10 800x600 bitmaps in memory at one time (48 million pixels), therefore why don't you store the surrounding bitmaps so it won't load everytime you pass the border of one.

The mimimum amount of RAM should be decided based on the type of game you do, but I would say more than 16 for most games and not more than 64 MB.

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown

Edited by - Spiff on 3/16/00 6:40:02 AM
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
I don''t think I can afford to have anything load up mid level as this is a fast action arcade game and so the gameplay will stutter when the next section is loaded. I might stick to the generic backdrop, with overlaid sprites but I was wondering how Baldurs Gate and Command & Conquer type games handle the maps. Maybe they are slow paced enough to allow mid-level loading?

My main problem is that, if the game was a vertical scroller, I could precache the next screen. However, with the 360 degree movement available then I would need to ensure that all eight surrounding screens were loaded into memory to ensure that they are available whichever direction is taken. This could result in a lot of disk access mid game, especially if the player moves over a loading border, does a 180 and immediately moves back in the opposite direction.
quote:Original post by Nivelo

I don''t think I can afford to have anything load up mid level as this is a fast action arcade game and so the gameplay will stutter when the next section is loaded. I might stick to the generic backdrop, with overlaid sprites but I was wondering how Baldurs Gate and Command & Conquer type games handle the maps. Maybe they are slow paced enough to allow mid-level loading?



Baldur''s Gate, much to my disappointment, loads in a zone at a time, a little like Everquest if you''ve played it. When you walk to the edge, it shows a ''Loading'' screen and loads in the adjacent zone.

Command and Conquer, on the other hand, uses a very basic tile-based system. There are a few different grass/sand tiles, enough cliff tiles to make realistic-looking, cliffs, and water tiles. Stick a few tree and tiberium objects on top and that''s about it. Tiberian Sun had a slightly more advanced engine (being isometric and allowing for several depth levels) but it is still very bleak and unvaried.

If this is all complex to you, look up the Tile-Based tutorials on this site and read though them to get an idea how these things are generally done.
Here''s something that I just thought of. If you want a big backdrop, what you can do, is cut the backdrops into small tiles, and then compress each tile in memory. The reason you will want to compress it after cutting it up, is so you only have to decompress the sections that are actually on the screen. If you use a compression algorithm similar to pcx files, you may be able to get 2:1 compression or better depending on the detail, and it will decompress pretty fast.

Domini
Also, you still may not be able to get 10 x 10 screens at 800 x 600. If I had to make the decision, I would consider lowering the screen resolution to 640 x 480. How many colors are you using? Anything more than 16bpp would be to much if you take the large bitmap approach.

Domini
Just a quick note...BG''s maps were a maximum of 1:6 of the screen size on both width and height (640x480x6^2 pixels). Now, that''d only take 21,5 MB in 16 bpp Fits in memory quite well now doesnt it


"I think, therefore I am...I think"
Thanks for the replies,

I had another look at Baldurs Gate and it does load as you scroll around the backdrop so it is loading in tiles as it goes. I''m going to implement a full tile-engine solution and see how fast I can get it.

Cheers,
Niv
> I had another look at Baldurs Gate and it does load as you scroll around the backdrop so it is loading in tiles as it goes.

Are you sure it''s not just paging from the harddrive? I did a very simple graphics engine similar to BG which used gigantic bitmaps just to see what performance I could get. It used a 640x480x6^2 big 16 bits bitmap (21,5 MB of memory). Since windows is a big hog and I ran VC during the execution it paged from the hdd when I scrolled to much, just like it does in BG and Torment.


"I think, therefore I am...I think"
Just thought I''d mention my approach worked just fine. It runs at a constant 42 fps (due to the bus speed) using the normal DirectX blit routines.


"I think, therefore I am...I think"

This topic is closed to new replies.

Advertisement