garyttierney / me3

A framework for modding and instrumenting games.
94 stars 7 forks source link

Infrastructure for a provably stable me3 #10

Open garyttierney opened 7 months ago

garyttierney commented 7 months ago

It's useful to think of me3 in terms of a regular software project, despite it not actually doing anything on its own or being a library to be consumed. Let's think of what it means to be "stable"

Now, let's think of what it means to make these points "provable" in real concrete terms for me3.

Each of these are technical challenges on their own, but here are some proposed solutions:

Automated integration testing

We want this to happen in CI, not manually. The base requirements to do this are:

With this we can at the very least script the interactions with me3 and Steam and do some basic interactions, however that quickly grows cumbersome and is too limiting to really do anything. Instead we can leverage the existing cargo test harness framework. The basic idea of this is the following:

Doing this would let us reuse everything that comes with tooling that already integrates with cargo test (reports, retrying, timing, etc.)

Well defined mod format

The current config.toml of me2 is very loosely defined and is used both for me2 configuration and mod configuration. This should be split into configuration and mod "profiles" so we can better decide which options should be overriden and which should be appended. Where this gets tricky is when we want to evolve the schema and replace existing features/options.

The kubernetes project has a good solution to this with its apiVersion property. See an example of how this would work in practice.

me3Version = "0.1.0"

[core]
external_dlls = [ "1.dll", "2.dll"]

In the future we might want to make the external_dll options richer:

me3Version = "0.2.0"

[dlls.dll_1]
name = "1.dll"
init_function = "mod_init_func"

This approach allows code assistance in most editors with language server support to work as soon as you fill in me3Version and will give you all the versions to select from, also telling you if your file is valid or not.

Well-defined package outputs

The packaging of me2 was a bit fast and loose, requiring manual steps after building with cmake to package up the application in something users can consume. Instead, we should ship platform-specific packages that contain all dependencies and handle any additional install steps. Once we do this, we can also verify the packages work correctly when we release new packages.

Prior art for this involved a WiX toolset based MSI installer using CPack. Starting this work back up would be beneficial and provide a simple verifiable definition of what should be included in one of those packages.

E.g., for an installer we should be able to test that: