• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

ronhatch

Lt. General
5 Badges
Feb 23, 2018
1.304
2
  • Stellaris
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • Crusader Kings III
I'm reserving this first post with the intention of always keeping a copy of the latest details here. The initial version of the format will follow in my second post.

(The package format is official in the sense that the community will come to a consensus single correct format, unofficial in the sense that modding is allowed but not supported by HBS.)
 
All mods will be placed in the [Install location]/BattleTech_Data/StreamingAssets/mods directory. Within that directory, each user that creates mods will have their own directory, and each mod they create will be placed in another directory within the user's directory. For example, if I were to create a "house-rules" mod, it would go in [Install location]/BattleTech_Data/StreamingAssets/mods/ronhatch/house-rules.

How to prevent duplicate usernames is TBD, but it will likely be your username on whatever platform we end up using to officially distribute mods. For now, your username on the Paradox forums will do.

Each mod will contain whatever JSON and Asset bundle files are needed, along with the following two mandatory files for bookkeeping:
  • ModManifest.csv will contain lines to be appended to VersionManifest.csv. In case of lines that conflict with the original VersionManifest.csv or other mods, it is up to the mod manager/installer to remove duplicates based on the listed id. Mods will always be installed in a specific order, and the last conflicting entry will always be the one kept.
  • ModInfo.json will contain version information and a short description of the mod. This is primarily for future features, but we're specifying it now so that we can rely on some basic information being available. The contents of the ModInfo.json file should be something like this:
{
"PackageFormat" : 0.1,
"ModVersion" : 1.2,
"ModDescription" : "A collection of changes implementing my house rules."
}
PackageFormat is the version of this specification that was used, the version described here is 0.1.
ModVersion should be a number, but can be anything the author wants as long as newer versions always use numbers greater than the previous versions.
ModDescription is freeform text intended to be displayed on a single line. Keep this to under 80 characters as a rule of thumb.​
Additional files that are not required can be included, such as a ReadMe.txt file. All files can be zipped up for easier distribution, but that is currently not part of this specification.

Lastly, please keep in mind that for Linux and Mac users lowercase and uppercase are NOT treated the same in filenames. So if you have a file named AwkWaRdNamING.json in your mod, do not list it as AwkwardNaming.json in your ModManifest.csv file. Always use the exact same capitialzation as what you're seeing in your directory listing, and the mods directory should be all lowercase. Eventually it should be possible to run a script that will verify your mod follows all of these rules, but that tool has not been written yet.

And... now open for discussion...
 
Last edited:
Incidentally, the two main future features I'm thinking of for that ModInfo.json file are:
  • Listing mod dependencies, where one mod won't work unless another has already been installed.
  • JSON overlays, where a file is not replaced entirely but instead only the parts that change are listed.
 
I agree. You may also want to hit up the modding wiki and edit the "Mod Distribution" page to fit. I may or may not push out a new AMP mod pack in the next week or two and I'll convert it to this formatting. I acquired some beta 1 files and can use them to reactivate the dynamic Lance roles and maybe some other things as well.
 
I agree. You may also want to hit up the modding wiki and edit the "Mod Distribution" page to fit. I may or may not push out a new AMP mod pack in the next week or two and I'll convert it to this formatting. I acquired some beta 1 files and can use them to reactivate the dynamic Lance roles and maybe some other things as well.
Yeah, the Wiki is definitely on my list of places to publish this... took long enough to write up already, so I figured I'd let it sit here for a little while and see if anybody chipped in with modifications to make.

Hmm, and come to think of it... until we have a mod manager that actually works, it's probably a good idea to include a full copy of the VersionManifest.csv file in cases where there are a lot of replaced files. Don't know that I want to put that in the spec, and in any case hopefully I'll have that mod manager before too long. (Although I have way too many things I want to spend time on right now.)
 
But writing an update to the NMM might be easier than writing a mod manager from scratch. I've not looked into it, though.
For me, personally... writing a mod manager from scratch is far easier than modifying NMM. Because the first step would be understanding a boatload of code that's doing a variety of things that we don't really need.

Edit: Granted, many of the things we don't need are also in the "nice to have" category.
 
Should we also debate which mod site to use?
I'm hoping for NexusMods, but I'll follow suit with whatever the community decides.
I looked at NexusMods some... one thing I haven't seen on there is any information on how to add a section for a new game.

Plenty of instructions about how to add a mod for a supported game, just not anything about saying "Hey, BattleTech is here!".
 
I looked at NexusMods some... one thing I haven't seen on there is any information on how to add a section for a new game.

Plenty of instructions about how to add a mod for a supported game, just not anything about saying "Hey, BattleTech is here!".
I took the time to look into it. I was under the impression that NMM was publicly developed and open source, but it seems this is not the case. We'd be far better off developing our own community mod manager.
 
I took the time to look into it. I was under the impression that NMM was publicly developed and open source, but it seems this is not the case. We'd be far better off developing our own community mod manager.
It is open source, actually:
https://github.com/Nexus-Mods/Nexus-Mod-Manager

In any case, it doesn't run on Linux or Mac... so I'd rather find a solution that will work for everyone. Particularly one that will work for me, in fact. :)
 
Personally, I will probably be uploading my mods to my Google Docs folder and sharing the links here. That is the simplest thing I can think of.
Yeah, that works.
I want to figure out some central repository where anyone can publish mods, but it doesn't matter much until we have a mod manager capable of getting mods directly from that central location. And I've got too much on my plate already just trying to get basic functionality working before release. (Yeah, I'd have plenty of time if I focused on it, but meanwhile baseball season has started and oh, yeah... I'm trying to find a job. That last bit might be kinda important, I suppose.)
 
Jobs tend to be important. Good luck!
We still have a few weeks before the game even launches.
Even if we don't have a central location to store the mods themselves, we can create a centralized list of available mods with links to where each one is stored. It would be a good thing to have on the wiki (either the regular or modding wiki, maybe both).
 
I looked at NexusMods some... one thing I haven't seen on there is any information on how to add a section for a new game.

Assuming you have a Nexus account, it's the very first thing you see when you try to submit a new file - https://www.nexusmods.com/mods/add/

If the game does not already have an existing Nexus profile then you request to add it and the mod submission (when finished) is passed along to moderators/admins for approval to create a new entry for the game. Once the first mod for that game is approved, then the game will be listed publicly for everyone else to select for their mod submissions.

From the Nexus mod submission page:

Is the game you want to add a mod for not listed above? No problem. Use the text field below to add a new game to our database.

We manually approve each new game that users suggest to ensure the game name and other information is correct and to cut down on people making duplicate games. We aim to act on game suggestions within 24 hours of the suggestion taking place. Until we've approved the game your file page will not be visible to others.

Please make sure you add a working file for the game and publish it as soon as possible. We will not launch a new Nexus site for a game until there is a working, published file for it.
 
It occurred to me that a mod to skip the tutorial campaign missions would likely require removing entries in the VersionManifest.csv file and the current mod format supports substitutions, but not removing entries without any replacement in place. Also, we need to allow for database changes. So I'm proposing version 0.2 of the format before the game has been released (if just barely).

I don't want to take the time right now to do a full write up, but here are the changes from version 0.1:
  • ModManifest.csv will now be considered optional, since some mods might not modify any of the JSON or asset bundle files.
  • ModMetadata.sql will be a list of SQL statements to run, modifying the MetadataDatabase.db file. This file is only included in mods that change the database. (Any mod manager can accept this file as part of a valid mod package even if the package format is marked as 0.1.)
  • ModInfo.json will have the following changes:
    • "PackageFormat" will be set to 0.2, obviously.
    • "RemoveFromManifest" will be a new optional key with a value set to an array of IDs to remove from the VersionManifest.csv file.
So a valid ModInfo.json might look something like this:
Code:
{
  "PackageFormat" : 0.2,
  "ModVersion" : 1.3,
  "ModDescription" : "Throwing out the trash[can]...",
  "RemoveFromManifest" : [
    "chassisdef_urbanmech_UM-R60",
    "hardpointdatadef_urbanmech",
    "mechdef_urbanmech_UM-R60",
    "movedef_urbanmech_UM-R60"
  ]
}
:p

I plan to update the first post with a complete description of the 0.2 format after the game has been released and people have had a chance to point out any potential issues.
 
By the way... for anyone developing mods longer than a few lines, I highly recommend using github. Definitely a learning curve if you haven't used version control before, but on the plus side... you'll have version control. In other words, you will have a record of every change you make and will easily be able to revert to a prior version if you find that you broke something.