[CTP] Call to Power 1 & 2 New Mod Manager

Blake00

CFC Mod Archivist & Social Media Helper
Super Moderator
Supporter
Joined
Sep 24, 2016
Messages
3,232
Location
Australia
While Call To Power 2 had an simple mod swapper back in the day the CTP fans Discord owner Ninjaboy has informed us that over the last year he's been working on a new mod swapper for both CTP games with a larger scope of improvements that will hopefully make installing, swapping & using mods with CTP games much easier as well as improving the overall gameplay experience! I'll keep an eye on his progress and post more here...

More details here...
https://discord.gg/mVBDgyVRhT
https://discord.com/channels/924072012295585842/924076901557997598/1122049288181129267 (use join link above first for this link to work)

Basically, I'm making an all-in-one mod manager for CTP (focusing on CTP2 at first). Here are some of the standout features it WILL have:
  • it will be open sourced (it is currently closed-source because it isn't in a state to take contributions yet - still scaffolding the linter, setting up CI/CD, writing tests, etc.)
  • it will be able to tell exactly which files are modified for each mod installation (allowing us to know which mods are compatible with each other and pointing out incompatibilities with a diff-view)
  • it will store the initial state before mod installation, allowing you to revert back to the non-modded state easily
  • it will access known mods from an online bucket of some sort (something like S3) for easy, one-click installation
  • it will allow the specification of an install script similarly to Wrye Bash (though probably with a few specified commands such as "mv", not necessarily all of bash)
  • it MAY also play music from links you supply (no guarantee here, but it's an idea that would help us listen to the original soundtrack in-game again)
  • for the convenience of contributors, I set up Electron and React to use Vite for the bundler (super fast HMR!)
Currently, it is able to auto-detect installations of CTP2 on your system, show it within a pretty handy menu within a program window and it has permissions to modify the files. The next steps are adding the GUI for adding mods, allowing you to add install locations, tracking state with a file similar in functionality to package-lock.json for npm and ensuring that the files can be reverted (the most important part).

This is my first Electron project and I took the time to really learn about inter-process communication (plus, I've been scaffolding testing and stuff) so that's why it's been taking a while - I've been learning a ton along the way.
Oh - one last thing! I am focusing on Windows at first, but I plan to allow compatibility for Linux and Mac as soon as possible since I know we have a few players on those platforms
There's a pretty strong chance that I may make it open-source within the next month or two, but I am definitely going to prioritize a CI / CD system and general quality control systems before accepting PRs. It's also currently a bit of a mess, so I'ma make sure to clean it up a lil (for example, the Electron backend is currently plain JS, while the React parts are TS - if only Electron accepted TS for input... may just have to hit it with tsc)
I'm also aware that this whole thing is vaporware at this point (basically just being a glorified menu at this point), I just wanted to let you all know what I have been working on since I gave that very cliff-hangery message back in May and have NOT elaborated since
 
Last edited:
19/12/2024
Wanted to give a quick update about the Mod Manager. I have found that I have unfortunately not been working on it as much as I would like, and as a result of this I plan to open-source it soon. Right now, I'm also cleaning it up with some test coverage so that any possible contributors are aware of how much progress has been made (there is a surprising amount of progress that has been done, actually).

Anyway, keep an eye out for that! I'll probably make more channels for updates for that project once I do open-source it [...] so that I can keep myself working on it often and so that the whole community can see the progress.

This is how the mod manager looks right now, just for extra information. It looks very barebones, but the actual functionality is basically entirely there (minus applying the mods to the installation and then going backwards - it installs them fine, but I need to add the "reverting" functionality still)

I'll clean up the looks at a later point once it can actually manage mods :)

Once I have session management working properly, I'll make an example client in C++ and SDL2 to demonstrate how to interact with the server's API and create a login screen. I will post about that when I have created it. The example client will not ever become a real client though (with anything past a login screen), since I would be much better off creating that in Go (because my server and the client could share types). As a result, the example client will only show the auth flow to give an example of how to interact with the API.
1743311209527.png

21/12/2024
Lots of progress today on the Mod Manager - went from a whopping 0 tests to 56 (thanks to AI, of course). I'm adding tests to help stabilize the mod manager before making it open-source, as well as to maintain my own bearings while trying to finish off the implementation (so hopefully we can have mods that both apply and un-apply, as well as stack on top of each other properly). Fingers crossed that'll be soon 🤞

10/01/2025
I've been working quite frequently on the mod manager, and I believe it is getting quite close to working as originally planned. I have revamped the mod application system, so now mods that are applied are first diff'ed (the changes are made and stored) and then the diffs are resolved in a chain. This, when it is 100% completed, will mean that multiple mods can be checked for compatibility, as each difference is applied individually. This also means that the mods can be un-applied, something I am looking forward to implementing soon.

I have a few tasks still head of me:

1) Ensuring that changes that remove lines from files can be successfully applied (right now, I simply haven't implemented that logic)

2) Ensuring that each change is written to a file and stored before the application begins (so it can be done in reverse when un-applying each mod)

3) Implementing the un-applying logic (should be easy, given it would just be doing removals where additions were done previously, etc.)

4) testing all of the above

5) open-sourcing the repo

6) using a web worker to ensure that the main thread is not blocked when applying large mods

Once all of this is done, the mod manager should be ready for a proper release. I believe it's quite close - not close enough to give a proper timeframe, but really close. I'm hoping its release will allow us to craft some really awesome modpacks.

06/03/2025
I've been working a lot on the mod manager. I'm now at over 110 tests, been trying to QA the backend as much as possible.

Just today, I've added a backup restore button and got the mods to apply without throwing errors (though CTP2 did not run after the application). The new backup restoration button will make development way easier from now on (no more deleting and un-zipping the files over and over every time that I brick the CTP installation with a botched mod application).

As a reminder, I had the mods applying successfully before, but I am currently in the process of making each individual change applied by the mod be written to the files.

That process will allow us to apply multiple mods on top of each other (if they are compatible) and have them work together, which will be super cool.

Though I'm running into lots of issues right now, I'm still very confident in how this is working out and believe that (some day) we will be able to have a great alternative to modswap on our hands.

24/03/2025
Coming very soon as an alpha to Windows, Linux and MacOS (with quite a few themes to choose from)...
1743311718403.png 1743311738078.png
 
Back
Top Bottom