Archived

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

_dot_

Ways to load resources?

Recommended Posts

I have been working on a resource loading system, and would like to know how others load their resources. Do you load all at startup? Or is it spread throughout the game? Like whenever you actually sense inactivity, you tried to load whatever you think might be needed next? When loading, do you load all into memory at a shot, or do you load and process? Or do you spread the loading into say, 1kb per time, and update the screen/game to show that it is processing? Or do you run a seperate thread to load resources? How do you show progress when loading? Via callbacks? Or updating the screen directly? Or even generate interrupts? If you call graphical function directly, wouldn''t the resource system be too tightly coupled with the GUI? Any suggestions?

Share this post


Link to post
Share on other sites
I don''t have any answers for you, but I do have a few comments. A seperate thread is one way to keep the application responsive while you read, but another is to queue the I/O and not wait for it to complete. Then each frame check to see if the last I/O completed. It is even better to queue a bunch of I/Os at once so the operating system has a chance to reorder the I/Os to reduce head movement. Reading 1k is a bit low. I would read at least 32k. I has been awhile since I''ve measured it, but I think you can get about 10mb/s with a 7200 RPM EIDE disk drive doing large sequential reads. Assuming that is right then you can get about 300k per frame at 30 frames/sec. You need to do something with it though so I wouldn''t go overboard.

Share this post


Link to post
Share on other sites