Skip to content

Mod System#

Courage Reborn mods use two libraries:

  • Petrichor, loads mods from mods/ and reads mod.json.
  • Augment, hooks game functions at runtime (before, after, replace).

Loading sequence#

game starts
  ├─ load augment.bin (symbol map for hooks)
  ├─ register host Luau modules (e.g. Courage.Shaders)
  └─ petrichor_run(host)
       ├─ initialize mod backend
       ├─ scan mods_dir/
       │    └─ for each subdirectory
       │         ├─ read mod.json (PetrichorManifest)
       │         ├─ check engineVersion & hostVersion compatibility
       │         ├─ find backend that handles manifest.type
       │         └─ backend.load(dir, manifest)
       │              ├─ compile + run entry file (mod class table)
       │              ├─ Class.new() (init runs here)
       │              └─ store instance for tick / shutdown

each frame (Courage Reborn calls petrichor_tick)
  └─ for each luau mod instance: tick(delta)

game exit / mod shutdown (petrichor_stop)
  └─ for each luau mod instance: shutdown()

All luau mods share one Luau VM. Your entry file returns a class from mod(). Hooks you register in init or new stay for the session.

Sections#