From db854e95df1c5acbe0b9aea1bba1fe410c326124 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Sat, 18 Feb 2023 22:51:58 +0100 Subject: [PATCH] Add 'Bundle Patcher Architecture' --- Bundle-Patcher-Architecture.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Bundle-Patcher-Architecture.md diff --git a/Bundle-Patcher-Architecture.md b/Bundle-Patcher-Architecture.md new file mode 100644 index 0000000..5b93e8f --- /dev/null +++ b/Bundle-Patcher-Architecture.md @@ -0,0 +1,25 @@ +This is an (likely incomplete) documentation of how dtmm's process to deploy mods and patch game bundles works and what data it writes. + +## settings.ini + +The game's `application_settings/settings-common.ini` is changed with + +```diff +-boot_script = "scripts/main" ++boot_script = "scripts/mod_main" +``` + +This allows us to run our own entry point before the game's code, without touching the actual `scripts/main` file. + +## packages/boot + +Several files are added to `packages/boot`: + +* `scripts/mod_main.lua`: The very first file of code that the game will run at startup. This sets up mod handling and then calls Fatshark's actual `scripts/main` entry point. +* `scripts/mods/mod_data.lua`: This file mod metadata and the load order, all of which the mod manager will use to load the installed mods. +* `scripts/mods/manager.lua`: An adapted version of `ModManager` from VT2 that handles loading and initialization of mods. +* `packages/mods.package`: The `.package` file that points to the separate mod collection bundle + +## packages/mods + +This bundle serves as the root package from which all mod packages can be reached. Collecting them here avoids bloating `packages/boot` too much. \ No newline at end of file