I really like this idea, and it brilliantly handles the idea of removing a mod: you just rebuild from vanilla skipping the mod-pack you no longer want.
Exactly. As well as the difficulty of removing a patch, it also avoids breaking things by removing a dependency for something else. This way, every combination the user tries is explicitly checked and rejected if it won't work.
The sequence you described would be a great starting point, but collision handling needs to happen sooner rather than later because virtually ALL custom buildings and reactions need to go into entity_default.txt. I think the responsibility for treading carefully in vanilla files should be placed on the modder, with some handholding in the launcher's documentation.
For example, it is more reasonable to tell the modder to translate his/her positioning hints into regular expressions than it is to ask the user (who may not know the first thing about raw tokens) if a partial match is valid. I do not recommend expecting the launcher to pile on special handling for umpteen different situations (inserting custom buildings, changing gaits, adjust stone tile, etc etc etc etc); pick one or two general formats.
Yeah, more intelligent handling of collisions is going to be required before too long; I absolutely agree that special cases should be kept to a minimum - or preferably avoided entirely. To avoid incompatibility there may eventually be a canonical way of doing it, but for now keep everything as simple as possible so it actually happens!
That's why I don't think 'soon' is now - if the first version usually only allows one mod to substantially alter entity_default.txt, that's OK for the first version.
-----------------------------------------------------
And an idea on how to handle mods that have been split up into modules:
Note that this is not a final idea, and for now each module can simply be treated as a standalone mod with an indicative name. This is much easier to handle, and probably more elegant overall. Despite the annoyance for modders, it might just be best to require all parts of split mods to be standalone and treat them as such. Conflicts or dependencies should be caught by the launcher anyway.
- Single folder for the whole mod
- subfolders for each part of it, each of which would be valid (if useless/conflicting) as a standalone mod
- some standard way of declaring what should be loaded by default, and in what order
- user can treat the collection as a single mod, or choose to see the more detailed settings
I think that this will require a manifest, which should not be modifiable (except obviously with a text editor). The user can adjust the settings, but this is only held until the launcher is closed. I'm leaning towards xml format; the second part of the manifest being the load order for submodules. Given that there is no top-level "raw" folder, a missing manifest will mean no modules are loaded and the collection is treated as an empty mod. The manifest can also include metadata such as name of mod, author, link to source, and description (so non-collection mods may also want one, though it's optional).
Hopefully, mods which have graphics options can put the main mod in a top-level "raw" folder - ASCII raws, graphics turned off - which will always be loaded, and then have modules which add in the graphics. This would actually handle a general case of options with shared dependencies. Thinking this through raises some issues about diffs; for consistency these mod--specific graphics should be diffed from vanilla but I can see that getting impractical or conflicted.
All of this more complex handling comes later though; for now a simple launcher that can do diffs and simply rejects conflicts will be a big step up. First the simple, then the practical, then the possible, and last of all take over the world!
-----------------------------------------------------
Currently my biggest wish for mod-manager is some sort of state tracking. I.e. I don't like how it detects if mod is already merged in.
Second in wish list is this. Namely some smarter way of adding-removing everything and being raw aware. Imho there is no silver bullet: even multi-million programming industry did not crack this problem and there are so called "merge conflicts" that need to be sorted out by hand.
The rebuild-without-thing-to-remove approach handles this nicely,
but only if the original set of mods and merge order is saved. The simplest way to do this would be to create a text file in the built raw folder; "included_mods.txt". First line includes a timestamp and ID for the launcher that created it, so people can detect if it was someone else's launcher. Second line is the base DF raws, eg "df_40_08". Subsequent lines give mods in order of application: "first_mod_applied", "why do people put spaces in folder names", "thismodlast".
I think that this is premature for this idea though, when we don't even have the basic concept implemented.