Hello friends!
I am working on a game and would love to implement modding. However, this is an extremely complex topic. I think it would be cool to start a discussion on it, perhaps get some viewpoints. Here are my thoughts on the topic. Note my type of game is sort of like Elder Scrolls, so a single world and such.
Modding via Custom Scripting
One way to get modding working would be to have a sort of custom scripting language, loadable from file. For example, there is the Jurassic Javascript Runtime Interpreter. However, this means any moddable feature would need to be implemented into the interpreter. I am currently looking into a way to actually make this automatic! (Aka having an attribute over classes, functions, and variables that are accessable to the javascript engine).
What this would allow is when the game loads, being able to modify different values - for example, being able to modify scriptable objects would make anything instantiated from them modified as well. (I believe). This of course would require a lookup table for all modifiable objects, but thatās totally doable. (Already have this)
This mixed with a system like my parameter override system could allow for some more interesting systems as well. Also, assuming your game has a save system, one could imagine sorta highjacking that to make custom content.
Modding Unity Scenes
This one is a toughy. Like, very hard to imagine. Since modding scenes would mean editing in Unity, that would mean one would need both Unity as well as all of the meshes / components. Oof. Of course one way to fix this is to not use Unityās Scene editor / file type at all, and instead just make your own. This however greatly weakens Unityās greatest strength, and I personally am way too much into the project to consider this.
Modding using an Addon
There are addons such as UMod, however these are pretty simple: it doesnāt look like it supports editing of already existing scenes (Something I need to be able to do). However it looks like an amazing start, since it really embraces the idea of modding in the editor.
Modding Daggerfall Unity Style
If you havenāt heard of it, Daggerfall Unity is an AMAZING project that seeks to recreate the game Daggerfall from āscratchā using Unity. How it does this is it actually reads the original daggerfallās data, and creates the world from that. The result of this has actually meant making mods is incredibly easy to support (compared to most games at least): since all assets are automatically generated by reading data, it is then possible to create oneās own data for the system to read instead. Itās AWESOME.
Modding Bethesda Style
Bethesdaās creation engine was very clearly designed for modding in mind, and it is incredible. In basic terms, from what I gather, pretty much all data is in nice datables. This makes it super easy to look at data, from stat values to animation values, as well as saving (just save any values that have been modded), and of course, modding (Just override values that have been modified). This also allows for super easy stacking of mods as well. It isnāt perfect, (lists override lists, so a leveled item list mod will completely override another leveled item list mod) but it is for sure the best system Iāve seen involving modding. It makes nearly EVERYTHING accessible, especially due to the custom script engine (which is basically what I explained above)
Any thoughts? A lot of these ideas have been bouncing around in my head, Iām wondering if anyone else is trying to implement modding, or if you have any examples of games that have done it. Thanks!
Josh