Loading the Map

Started by
7 comments, last by KalvinB 23 years, 9 months ago
I''ve got a huge map I need to save to disk and then reload in a decent amount of time. It''s approx 74megs of raw data. The compressed data file is only 3k but loading takes 10+ minutes on the average computer. An older 200mhz takes 3. Because the map is so large it''s storing the raw map on disk instead of in memory. Is there an easy way to improve the speed at which the map is loaded? I''m assuming it has to do with the cache size of the main drive. Ben
Advertisement
How do you manage to have a 3k file on disk but then blow it up to 70+megs? Why do you need such a huge map file? Plus, if you can compress it down to 3k, can you just use the compressed version in memory? Obviously, with compression like that, your map doesn''t contain much unique data. Maybe a bunch of 0 bytes?
Some of your numbers seem kindof fishy but assuming they''re correct...

This is a total guess here but I''m guessing that the 3k version isn''t an actual image file, and rather is some kind of file that tell the program which kinds of tiles go where. And I''m guessing that the 74 meg thing is some kind of huge image file or something that your program builds upon reading the 3k?

First I''d recommend that you figure out how to scale that overall 74 megs down any way you can... that''s an absolutely huge amount for just a map.

Also, would it be possible to divide the very large map up into smaller pieces? Similar to Baldur''s Gate works, almost? (If you''re familiar with it)

Or maybe you don''t really need the entire map to exist in memory all the time, maybe you could just de-compress (or build) depending on what part of the map you have to display. This would depend on what type of game it is though, if it''s RTS or something similar I doubt that''d be fast enough.

===========================================

As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they do not refer to reality.

-Albert Einstein
try using tile maps.........
it seems you are making one HUGE bitmap for the map which isnt going to work, especially if it is 74 megs.
What about peopl who only have 64 megs of ram or heaven forbid only 32. You need more then that just for that one image, what about the rest of the game?

"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

The 3k is like a pkzip file but not nearly as good. My map files can be zipped up further about 98%. A map with a mathmatically generated floor used in testing is a little over 1meg. 3k is an empty map. My old compression algoritm did an empty map in a little over 1meg.

What I need to know is how to boost the cache on the local drive to speed up load time. Basically what it''s doing is that as it''s uncompressing the map it writing the raw data to the HD since actual RAM can''t hold it.

Since one computer can do the whole process in 3 minutes I just need to figure out how to get the others to do the same.

I am programming this with 32megs of ram on a P200. And yes it works. I''m using esssentially a test pattern while I figure out the load time problem.

The compressed data is unuasable because it would take too much time to figure out what is being seen by the user and where it is in the file.

Breaking it up is fine for saving but eventually the whole thing has to be loaded.

Ben

It''s an array. Not an image. And yes the information in the map points to other information which contructs the map seen on the screen from tiles. One array stores the tile numbers (the map). Another stores the actual tile information which is pointed to by the tile numbers in the map.

Ben
Here''s a method you can try if your map engine is flexible enough to handle it:

Load the map asyncronously. First load up the section of the map that you need and a large area around it. Then create a seperate thread to finish loading up the rest of the map. If your map is laid out in a nice organized fashion, then this shouldn''t be a problem. If it isn''t, then you got more than speed issues on your hands.

Good luck and let us know how it turns out.

Dino M. Gambone

Good judgement is gained through experience. Experience, however, is gained through bad judgement.

Dino M. Gambone
Good judgment is gained through experience. Experience, however, is gained through bad judgment.

Currently working on Rise of Praxis MUD: http://www.riseofpraxis.net/

Well 74Megs stored in an array seems really HUGE number.
How many tiles does the array hold?

And how much info for each file?
I mean if you store walkability info or maybe some other special info apart from the usual.

Voodoo4
Here these words vilifiers and pretenders, please let me die in solitude...
That sounds like an abnormally huge map. UO''s wasn''t even that big.

However, if that''s true, then you should only need to load part of it at once.

Load the other parts dynamically as the player moves around.

This topic is closed to new replies.

Advertisement