663a47273093f

663a472730e9e
2 Guests are here.
 

Topic: Outline for a new mod manager Read 9508 times  

663a472731836
There are several reasons why we need a new mod manager. The fact that it cannot deal with the newer MTL files could probably be fixed if I poked TheBrain. But it is a general problem that the program only deals with files it "knows" instead of blindly copying what it finds in a mod. What's more important though is, that for historical reasons the current mod manager does its job inefficiently and messy, leading to unnecessary screwups.

For those who don't know, here's how the current mod manager works. Otherwise skip this paragraph:
When a mod is registered with the manager it unpacks the original archive, then repacks it into a new archive in the MODS folder. And when a mod is activated it unpacks this new archive into the game dir, making backups of all files it replaces. If another mod is activated whose files overlap with the first one, it gives a warning and then overwrites the first mod's files. This leaves the game in an uncertain state. If the first mod is deactivated now and original files are restored from backup, the second mod, which is still active, may not work anymore, because some of its files have been replaced. This is for two mods that are actually compatible with each other. The main problem here is that several mods are supposed to be loaded from the same place, the game dir, where lots of original files already exist.
 
Now the Dark Engine (bless it's dark soul) allows us to load resources from many places, they just have to be mentioned in install.cfg. So a better mod manager would therefore not copy files around but simply add or remove mod folders from install.cfg.
All mods would sit in their own folders inside a MODS folder. The new mod manager reads all folder names inside MODS and presents them as "available mods" in an interface. The user can then drag some of these over into the "active mods" area and even sort them there as they like by dragging.
In the background "active mods" is just an array. Once the user is done, the mod manager writes this array into install.cfg. That's it.
Since no files are being physically moved, none are ever overwritten. Saving mod profiles would be easy: Just write the array to some file that can be loaded again at some later point. Technically this is all rather simple, the hardest part will be the drag-and-drop interface.

If you have decent programming skills and you think you could do this, now would be a good time to step forward. I've got enough on my plate as it is and although I could write this in PHP and Javascript, there are more appropriate languages which I just don't happen to know as well. Preferably this would be written in C++ as an independent executable. Or in VisualBasic. Or maybe even Python, if it's true that you can create standalone Python apps now.
663a4727319ab
How is mod compatibility checked, or is it even an issue anymore? I may give it a go and see what I can come up with in C++. Now I'm not entirely experienced with graphical programming but I need to learn somehow; so if anyone else wants to step up and make it, go for it.
663a472731b51
This could be checked of course, but it's not part of the outline above, nor does the existing mod manager have actual compatibility checks. It warns when any mod file will overwrite another, but that is usually not a compatibility issue.
Mod compatibility only becomes an issue when two mods replace the gamesys file (shock2.gam), or when they replace the same original mission file (*.mis) with wildly differing versions, which is rare.

Basically a check for more than one shock2.gam existing in the active mods would beat most compatibility problems.

663a472731cd2ZylonBane

663a472731d28
I agree. A warning on MIS/GAM conflict should be all that's needed.

Something else I've been thinking about is the procedure for "installing" mods in the mod manager. The SS2MM method where it copies the .ss2mod file to a central repository does have the advantage of being very user-friendly, not requiring users to navigate to a specific folder buried somewhere.
663a472731e47
If it would only copy them, yeah. But during registration it unpacks any new mod and repacks it in the central mod directory.
The reason is that it needs to keep track of what files exist in any mod, so it can create the necessary backup files. Which are only necessary due to the way it dumps everything into the main game dir.

663a472731ee4Shinobi

663a472731f2e
I'm thinking something along the lines of what the FMSelect does. But for mods. Would this suffice?
663a472732035
So what should the application change in install.cfg, precisely?  If I'm reading you right, the proposed system would deviate from installing all mods on top of one another in the DataPerm/TempMods folders, yes?  If so, then should this application write the array to all the lines that reference those folders within install.cfg?
663a472732165
In fact, scratch that, since the install.cfg options reference different things entirely.  I'm just trying to figure out how it would elegantly adapt to the other options.  I guess adding "\res" for resname_base for each mod folder (and so on) would be one way.  Just seems.. messy.. but then I suppose it's less messy than heaping file upon file in one folder.
663a4727322fa
The idea is that you would have one MODS folder and inside it the various mods, each in a folder of their own.

MODS
|_A
|_B
|_C

When the user activates mod "A" the following gets added to install.cfg:
load_path .+.\MODS\A+.\DataTempMods+.\DataPermMods+.\misdml+.\Data

When the user also selects mod "B" but places it after mod "A", the line looks like this:
load_path .+.\MODS\A+.\MODS\B+.\DataTempMods+.\DataPermMods+.\misdml+.\Data
« Last Edit: 19. February 2013, 01:29:09 by Kolya, Reason: more thought »

663a4727323b4ZylonBane

663a472732405
Is that safe? I thought there was a hard limit on load_path lengths.
663a472732504
There may be a limit, I haven't tested it.
663a4727325ff
So there's no need to modify "resname_base" or "script_module_path", for example?

663a472732738voodoo47

663a472732786
no, don't touch the config files unless you know exactly what are you doing.
663a472732864
Okay then, I'll have it modify load_path only.
663a47273294a
@v47: If this was a support request, I'd agree. But not in this context.

@VF2013: load_path should suffice.

663a472732ac8Johannes

663a472732b15
Someone start an open source project at sourceforge,...
I suggest
IDE VS2010 Express -  because free
Language C# -  because free
GUI WPF -  because modern MVVM
Testing NUnit -  because free

663a472732baevoodoo47

663a472732bfd
yeah -all we need now is someone who would actually make it.
663a472732da7
I am working on a version using C++ and wxWidgets in CodeBlocks now that I have a little more free time on my hands to work on something. Github page here: https://github.com/zeebok/SS2MM

Currently it just creates a basic layout, scan adds a hard coded item to the available mods list and you can drag and drop between the lists. Will get to work on it more by the end of the weekend with the aim of a proper directory scan and possibly reordering within the active mod list. Will try to keep you guys posted.
663a472732f73
@Zeebok: I did a bit of testing and reading in the new dark docs last night. As a conclusion the preferred path to add mod resources to would probably be mod_path (Doh!) in cam_mod.ini since it loads all kinds of resources.
663a472733083
I might be able to help a bit with this if you need it, Zeebok. I work on a wxWidgets-based launcher for FreeSpace 2 Open.

Why wxWidgets, by the way, as opposed to, say, Qt?
663a4727331b7
@Kolya: Luckily I haven't got to the point of changing ini files yet but thanks for the heads up.

@jg18: If you'd like to help that's fine, so far I've been doing ok (outside of having free time) but I will certainly get in touch if I run into problems. As for why I chose wxWidgets; just curious how the library was. Wanted to mess with some kind of C++ GUI library and heard this was one of the nicer ones. I certainly am interested in seeing Qt more but perhaps for a different project.
663a472733554
Once you're done with the mod manager, what about adding something to set all the stuff which you can only be set through config files?
IMHO it would be a nice addition.

My idea would be something like this.
2 Guests are here.
You are standing in an open field west of a white house, with a boarded front door. There is a small mailbox here.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
663a472733679