Skip to content

Linifadomra/Petrichor

Repository files navigation

Logo

Petrichor

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.

Dependencies

  • Luau (vendored)
  • miniz (vendored)
  • sol2 (vendored)

Architecture

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

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

Integration

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.

About

Courage Reborn's mod loader

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages