Ways to load resources?
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?
I use a seperate thread to load the resources, and have callbacks to supply the player with progress information. This seems simplest (and most portable, since with my new engine I can load via http)...
ill-lusion.com
ziggy@ill-lusion.com
ill-lusion.com
ziggy@ill-lusion.com
laxdigital.com
[email=ziggy@laxdigital.com]ziggy@laxdigital.com[/email]
[email=ziggy@laxdigital.com]ziggy@laxdigital.com[/email]
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.
Keys to success: Ability, ambition and opportunity.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement