Petrichor is an opinionated game-agnostic C++ modding framework written for:
- Embeddability
- Flexibility
- Simplicity
- Safety
- Power
- Speed
The language we chose is Luau, a fork of Lua 5.1. We chose this language for its sandboxing, native compilation, dynamic typing, and overall elegance when writing mods.
- Luau (vendored)
- miniz (vendored)
- sol2 (vendored)
petrichor_run(IPetrichorHost& host, std::vector<std::string> formats)
↓
Loader ← Iterates through mods folder
↓
Compilation ← Compiles preludes, host modules, and mods with Luau
Library structure (built here)
Petrichor/
├── tests/ ← test suites
├── cmake/ ← cmake modules (e.g. dependencies)
├── include/
│ └── augment/
│ └── petrichor.h ← public-facing API
├── src/
│ ├── backends/ ← Luau backend + modules
│ ├── archive.cpp/h ← miniz archive extraction wrapper
│ └── loader.cpp ← Top-level API implementations
├── tools/
│ └── bin2h.py ← helper for Luau to C++ header conversion
└── CMakeLists.txt ← configuration + installation script
Simply wire in your project information & implementations of IPetrichorHost, and call into the functions documented in petrichor.h. Clean documentation can be found on our ReadTheDocs page.