Technical Info - hakasapl/PGPatcher GitHub Wiki

THIS PAGE IS A WIP

Overview

This page serves as a technical guide for how PGPatcher works under the hood, for those that are curious, or for those interested in contributing to the project.

PGPatcher Components

This section will go over the individual modules that make up PGPatcher. If you are not planning on contributing to the project, you can probably skip this.

PGLib

This is the meat of this tool. It contains all of the library code required to run the patching process. This includes:

  • BethesdaDirectory - An instance of a bethesda game folder, allowing for reading from loose or BSA files transparently
  • BethesdaGame - An instance of a bethesda game. It contains info on paths of relevant locations, and things like helpers for obtaining plugin load orders.
  • ModManagerDirectory - This class is responsible for mapping files to mods and offering several helper functions to access this information, and later to populate conflict information for each mod.
  • PGGlobals - Static global storage for a lot of these objects where a singleton is needed across the whole app.
  • ParallaxGen - This is where the main patcher code lives. Public functions for patching NIFs and populating mod info exists per NIF, as well as a global runner for the entire list of meshes/textures.
  • ParallaxGenD3D - Responsible for the GPU acceleration related code. It uses the DirectX11 library and offers several helper functions used throughout the application.
  • ParallaxGenDirectory - A superclass of BethesdaDirectory, adds some additional helper functions for PGPatcher specific operations, mainly like mapping textures from NIFs.
  • ParallaxGenPlugin -

PGMutagen

PGPatcher

This is the module that produces the main PGPatcher.exe file. It is responsible for:

  • The GUIs
  • Config loading and saving
  • Calling backends in PGLib for the patching process

You can think of this as the "motherboard" for the whole patching process. It itself does not contain the components but it decides when to call them, and it passes relevant information to them.

PGTools

Similar to PGPatcher, the pgtools module is a more barebones variant of pgpatcher that acts only on the present working directory, but is still responsible for calling the backend and passing information to it.