After a month of storm at my main work hell with all shitty one-day layoffs and rebuilding roadmaps and commitments (I’m a lead engineer there), I’m finally back to put hands on my beloved Penal Engineer.

First things first, the result of the poll:

Survey results
Survey results

Thanks for voting, and most important – thanks for all your warm and supportive comments under that post! I love you guys. Your presence inspires me to continue delivering the game, and shines the light in our quite dark times we have with IT overall in the world (and especially in U.S.).

What’s up?

As the votes split, I walked where my engineering heart drove me by: to the Mod API. It became my primary focus for past weeks.

I’ve spent hours on documenting all the APIs I managed to construct by that time. Then, I looked at that mess, and firmly decided: “Damn, this crap must never face the world.”

Okay, okay, it wasn’t so bad, actually. I preserved a lot of that stuff. But once I got genuinely focused on documenting the API to provide it to non-programmers, I saw a lot of work ahead to tame the beast. The thing is that before I started documenting I was focused on extensibility from the programming perspective: various systems, hooks, methods to add/remove factories, global registers, – all for C# guys.

But nothing was done for truly mod-friendly approach. This is what I was busy for: crafting an XML API from scratch.

While I was working on the XML API, I suddenly faced another yet unresolved challenge: storing of config file. Yeah, up to the moment Penal Engineer is mostly stateless: no configuration preserved across the runs.

Where am I on the roadmap

I shuffled the roadmap and concentrated on foundational work, again.

  • Defining API. A lot of R&D (for an indie who hasn’t yet been laid off his 40h/week job) to make the best of the XML/XSD world in .NET. But not only that. I finally determined boundaries between “safe” and “unsafe” mods.
    • Former ones are sandboxed, have fewer capabilities to harm (no access to filesystem or network), coded in XML and Lua.
    • Latter ones are purely C# code – easier for me to support, but risky for players.
    • Both flavors will be live and actively developed from now on.
  • Documenting API. Not yet ready to share, but trust me: it’s huge! I strived to organize it as a tutorial. ChatGPT evaluated it highly ☺ Hope you’ll love it too.
  • Mod-extensible configs. I basically reinvented Windows Registry on XML, and gave a clear way for mods to extend it and to provide their own subconfigs schemas and to store their own data.
  • Logging for mods. Seems minor, but trust: you won’t want to spend hours of your precious free time to make up wild guesses what could go wrong with your Lua seeing a blind screen. Logs matter, and be assured – I relate modders' pain.
  • Configs schemas migration. It shall happen once upon a time that your mod would have to break the XSD schema of config. Removal of deprecated parameter, restructuring config tree… I’m going to provide you a safe way of migration between inherently incompatible schemas.
  • File access API. Apart from configs, your mod might desire to store something else in the user’s app data folder, or (naturally) access its own files from the game installation directory. I’m going to reinforce security even for “unsafe” API flavor, making it more trustworthy for players to install your mod if you decide to go that way. Usage of that API would be optional, but a player would know whether your mod code plays outside that secure API.
  • Game exit hooks. A mod might need to know a player is about to exit the game. I’m going to implement two-phases game exit process:
    • First, all concerned mods are queried (asynchronously) whether they allow exiting. This is a moment when you mod could ask a user some confirmation.
    • Second, (if all concerned mods asynchronously confirmed) all concerned mods receive pre-exit hook. This is a moment for your mod to make clean up, save subconfig and so on.
  • XML loaders of mods. The main part of my work is yet ahead.

Once I’ll be done with those foundation, I’m planning to switch to the gameplay itself.