$ show Laupetin/OpenAssetTools
OpenAssetTools is a native C++20 modding toolchain for older Call of Duty games (IW3-IW5, QOS, T4-T6). It provides CLI tools (Linker, Unlinker, ImageConverter, RawTemplater, ZoneCodeGenerator) and a desktop GUI (ModMan) for manipulating game 'zone' (fastfile) archives. The system supports round-trip conversion: extracting binary assets to raw formats (JSON, DDS, IWI, CSV, GLTF, etc.) and compiling them back into custom zone files. It incorporates a sophisticated per-game abstraction layer with factories for loading, writing, compiling, and dumping assets, alongside a reusable parsing framework used for menu scripts, techsets, state maps, and structured data definitions. The codebase is large (2500+ files) and shows signs of active development despite being a work-in-progress, with high code duplication across game versions and some reverse-engineering fragility.
The LLM identified 6 files worth highlighting for reuse:
Core generic parser using a sequence-based approach: parser states drive matching and consumption of tokens via reusable matchers and sequences. This template is the foundation for all domain-specific parsers (menu, techset, state map, zone definition, etc.). It decouples grammar specification from parsing machinery and can be extracted for any line-oriented DSL.
A lightweight, case-insensitive key-value map used as the intermediate format for many game asset definitions (physpresets, tracers, vehicles, weapons). It supports serialization to/from raw strings and is the backbone of the InfoString conversion pipeline. Self-contained and easily reusable in any project needing a simple config map.
Abstract interface for virtualized file system access (filesystem, IWD archives, multi-input streams). Enables searching across multiple search paths with caching. Provides Open/Read/Exists methods. The implementation hierarchy (SearchPathFilesystem, IWD, SharedSearchPaths) allows transparent composition. Reusable in any tool needing moddable resource lookup.
Zone-aware memory manager that mimics game engine allocation (XBlock, aligned buffers). It manages allocations via a MemoryManager instance tied to a zone's lifetime, with sub-allocators (Block, Stack). Used pervasively to replicate game memory layout for asset serialization. The pattern is reusable for emulated memory pools.
Robust parser for DDS (DirectDraw Surface) files supporting multiple DXGI/D3D9 formats, volume textures, cubemaps, and mip chain detection. Handles pixel format conversions and has extensive validation. Self-contained and could be used in any image processing pipeline needing DDS input.
Base class for converting key-value info strings to C structs using a field table (cspField_t). Supports int, float, enum, string, color, and asset reference fields with automatic validation. Per-game subclasses add game-specific fields. This pattern drastically reduces boilerplate for parsing text-based asset definitions.