Hooks for providing alternative means of fetching game resources - e.g. a map, image, sound, model, from custom or even proprietary formats like PNG, GIF, MP3, 3DS. Enable the community to extend default resource loading from a PAK or ZIP archive, as well as adding additional archive formats (outdated WAD, WAD2, WAL, new BZ2).
Advantages:
Disadvantages:
The resource handling is part of the engine, used by client and server. Implementing fallbacks and extensions in the Game DLL does not change the client. While certain load features might make sense server side only, most demands for alternative resource files are made with respect to data used for rendering: images, sounds, cinematics, models. Further, a server-side only modification would require two different archives, one for server load, one for client load.
Effort:
ZIP handling code is being added to Q3, replacing the PAK format is out. Hooking into custom code could be handled in a two ways :
resource_t * (*LoadResource)(char *resourcename, char* type); typedef struct resource_s { int size; byte* data; } resource_t;Here, the engine indicates the desired format of the raw data stream as a MIME type, e.g. "image/tga", "sound/wav" or "application/x-q3map". The plugin identifies the actual format of the resource (file extension or more sophisticated means), reads, and converts.
Comments:
It is possible to implement different search patterns (CLASSPATH-like, see Path Flexibility) for resources as part of the extensions. This would be a mere workaround if the builtin search is not adequate.
Server-side only implementation (e.g. as part of the Game DLL) could be combined with an autodownload mechanism to transfer data chunks to the client, with the known problems related to autodownload from a dedicated Game Server in general. It would still ease development of textures, models etc. in proprietary formats, as autodownload in single player would not come with a penalty, and conversion of a given file to a Q3 format could be delayed till final distribution.
A project like Q2Java would be enabled to use the powerful builtin networking mechanisms to get files from potentially anywhere, even threaded in parallel, and return it to the game engine.
Submitted 980430, revised 980508, revised 980509, revised 980510, contact Withnails.