Archived

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

Loading the Map

This topic is 6358 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''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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites