Mods are currently loaded through their mod folder name which I declared as modId in this document and code.
Due to Linux folder names being case-sensitive while on Windows they are case-insensitive there should be a warning or note at least in documentations.
The example code included is the work I did so far for the mentioned parts, as I didn't want my work / time to be completely wasted.
For a nicer mod overview each mod should ship with an manifest.json file
which contain basic information about the mod and author as well as dependencies.
For my current implementation please check here.
{
"manifestVersion": 1,
"name": "Display mod name",
"version": "v1.0.0",
"gameVersion": "0.10.0",
"authors": "Mod Developer",
"description": "BBCode supported through RichTextLabel",
"license": "MIT",
"repository": "VCS link like github",
"tags": ["QOL", "Device"],
"dependencies": [
{
"modId": "some-core-lib",
"version": ">= 1",
"type": "required",
"loadRelation": "before_me",
"reason": "Reason why this dep is used / needed"
}
]
}| Field | Allowed types | Required / Default | Example values | Comment |
|---|---|---|---|---|
| manifestVersion | string / int | true | "1" / 1 | Due to json parsing in godot int if always parsed as float, so there is a check which only allows x.0 but not x.1 to not make it look like a version increase |
| name | string | true | Display Mod Name | The mods display name for nicer naming than just the folder name |
| version | string | true | v1.0.0 | The v in the begining is optional otherwise strict semantic version notation |
| gameVersion | string | true | 0.10.0 | The game version this mod was created for, just informative for users to highlight the possibility of mod breakages |
| authors | string / string array | "" | "Author" / ["Author1", "Author2"] | Allows to credit the author or in case of collaborations the authors |
| description | string / string array | [] | "Simple/ndescription" / ["line1", "line2"] | Displayed using a RichTextLabel which should support BBCode, Array for easier writing longer descriptions |
| license | string | "" | "MIT" | Just informative, for mods that might use tools, code that need license notes |
| repository | string | "" | "github link" | Was born when it was intended for my own mod manager to allow checking for updates through githubs api. Could still offer a homepage or repo link |
| tags | string array | [] | ["QOL", "Device"] | Tags can help to search for mods if a user has a longer list of mods |
| dependencies | dependencies array | [] | array of dependencies |
| Field | Allowed types | Required / Default | Example values | Comment |
|---|---|---|---|---|
| modId | string | true | "needed-dependency" | The modId (mod folder name) of the other mod needed |
| version | string | "*" / all | "1 - 2" | The version needed of the other mod, nice for warning users of potential unexpected behaviour if not matched |
| type | string | "required" | "required" / "optional" / "incompatible" | Informations about the relation and offering a way to warn about incompatibality |
| loadRelation | string | "before_me" | "before_me" / "after_me" / "any" | To offer autosort and with that the highest chance of no breakage |
| reason | string | "" | "Nedded because xyz" | A nice way to declare why another mod is needed, optional or incompatible |
Fore more information about the mods version and dependencies version please check the readme of versioning under code-examples here.
Through something like ImageTexture.create_from_image(Image.load_from_file(icon_path)) as Texture2D a wide variety of image types could be offered to display a logo or preview for a mod.
Could be either defined by a fixed name like icon.png, though that would need to check for multiple file endings that are supported like png|jpeg|jpg|svg Godot supported image formats.
Or by adding another optional field to the manifest for icon / preview images.
Presets are a saved list of enabled mods, this allows to create custom gaming experiences, support developer in quickly creating a new preset with only their mod enabled and users if mods break.
A preset should be easy to be duplicated.
By default, an empty preset should be available to quickly switch to native gameing experience.
If mods can change nodes that aren't reloaded / created on game change a notification for a needed restart should be considered.