WADLib is a custom asset bundling system inspired by id Software's DOOM WAD format. It allows packing multiple files into a single WAD archive, enabling efficient game resource management. This project was created before standard asset packaging libraries were available, demonstrating low-level file handling, memory management, and real-time file access.
-
Custom File Packing & Extraction
- Store multiple game assets in a single WAD archive.
- Efficient file indexing for fast lookup and retrieval.
-
Real-Time File Access
- Read assets directly from the WAD file without extraction.
- Custom
wad_fread(),wad_fseek(), andwad_fgetc()functions to mimic standard file operations.
-
Dynamic File Management
- Add and remove files from the WAD archive.
- Adjusts internal file offsets automatically to maintain integrity.
-
Optimized File I/O
- Direct binary reads/writes for performance.
- Efficient memory handling to prevent fragmentation.
- Create a WAD File: Adds game assets into a single structured archive.
- Read Files in Real-Time: No need to extract—game resources can be accessed instantly.
- Manage Assets: Add or remove files dynamically without breaking the archive structure.
WAD.H- Function prototypes and data structures.WAD.C- Core library implementation (file management, memory handling, real-time access).
Before standard asset libraries (like ZIP, PAK, or VFS systems), game developers needed custom solutions for bundling assets. This reduced file clutter, optimized game loading times, and simplified resource management. WADLib showcases expertise in:
- Low-level file I/O
- Memory-efficient data structures
- Custom serialization & asset management
WAD myWad("game_assets.wad");
myWad.AddFile("sprite.bmp");
myWad.AddFile("music.wav");
myWad.Save();file_type *sprite = myWad.OpenFile("sprite.bmp");
if (sprite) {
// Use sprite->buffer to access the file data
myWad.CloseFile(sprite);
}- Compile with a C compiler (Borland, Watcom, or modern GCC with DOSBox).
- Run in a DOS environment (or an emulator like DOSBox).
- Link WAD.C into your game engine for real-time asset access.
This project is open-source and available for educational use.
For questions or further information, feel free to reach out.
🚀 WADLib is a great example of pre-built asset management solutions—perfect for studying real-time file bundling techniques in game development! 🎮