One of the reasons DirectQ starts up (and changes game directories) slowly is because it builds a cache of "interesting things" in your Quake folder; things like maps, demos, external textures, available games, save games, skyboxes and so on. This cache is then used to populate the menus and to enable TAB autocompletion for most commands that take a file name (I think "exec" is the only one it doesn't do). It also enables faster checking for external textures so that map loads are faster.
With hindsight the way it builds this cache is kinda wrong. To take the example of maps, on startup (and game change) it opens the BSP file, has a look in the entities lump, extracts the name of the map (so that it can display "the Dismal Oubliette" instead of just "e2m6" - being player-friendly is the name of the game here folks!) and does some other checks (like looking for "info_player_" entities to ensure that it's really a map and not an ammo box).
A lot of this info is really not needed until such a time as you actually go navigate to the appropriate menu. TAB autocompletion just needs the name of the file, and the menu can "lazy cache" the data, i.e. wait until it's actually needed before extracting it and saving it out, then use the saved copy in future.
In fact, the only really useful information it extracts on startup is whether or not the map is really a map and not an ammo box (we don't want anyone typing "map b_batt0" in the console, do we?) And even that's slightly dubious because there is nothing to say that QC has to name a player start spot "info_player_anything"! It could be called "elephant" in someone's mod and the map would work perfectly, just so long as the actual QC code was correct.
The same largely applies to demos and save games. The information is different, of course, but the basic principle is the same (and in those cases we have the bonus of not needing to worry about whether a demo or a save file is really an ammo box).
So this is up for change. It's not going to happen immediately (in particular because there is quite a lot of it and it all needs to be reworked and tested) but these are all things that should be getting incrementally faster over time.
Tuesday, October 19, 2010
Slow Engine Startups
Posted by
mhquake
at
12:56 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment