Page 1 of 1

Suggestions for modding compatability.

Posted: Thu Mar 10, 2022 8:55 pm
by Deathawaits4
Just so we have an official Post about it

I already suggested this in the Roadmap thread but i think it might deserve its own thread incase other people want to add to this


"Hello Elliot,

Its me, that annoying guy that was harrasing you for code mods the last few months. Thanks for the headsup!

I also have a suggestion for modding compatibility espacially for XML.

Rimworld is one of the best examples on how it should be done. Basically there is something called "patch operation" and "xpathing"

You can create a new xml that has certain operations and requirements attached, that get read by the engine and modify xml files on runtime. (this is only a simple explanation, but the things that can be done with it are huge)

I would highly suggest checking out this post: https://rimworldwiki.com/wiki/Modding_T ... Operations

once you read into it, you will realize that its basically the holy grail of compatibility between many mods and has proven to be the foundation of rimworlds modding scene. I dont know of any other game that uses this system, atleast not in xml.

One example is: PatchOperationFindMod. With this you check for loaded mods and only if another mod is present, the actual operation runs. This can be combined with many others like: Patchoperationconditional, basically this will check for a xml node and if present it will atach itself to that xml node

"PatchOperationConditional can branch logic based on a match/nomatch. The following example patch adds a <comps> node if it does not yet exist, and adds itself"

This basically allows mod authors to create cross mod compatibility and also allows mod authors to attach their own xml snippets to other mod authors xml node. Depending on load order you could add snippets to snippets indefinetly.

The whole system is also fairly easy to implement code wise compared to some very complex api that is supposed to handle this and provides much deeper control for authors.

Hope i could be of some help!"

Any other suggestions to make modding as great as it can be? Just pump them out. I think it is always good to make suggestions that benefit everyone.

Re: Suggestions for modding compatability.

Posted: Thu Mar 10, 2022 9:45 pm
by brucethemoose
Going to upvote this here too ^.


I cannot understate how useful XML patching is in Rimworld.

Re: Suggestions for modding compatability.

Posted: Sun Mar 13, 2022 11:52 am
by Nilserich7
Just agree with what you write. Hopefully, such a system, or at least similar, will be added. So that the modding community can get the maximum out of this game. I really don't see any disadvantages. Would also be okay with it if it takes a little longer to implement these things.

Re: Suggestions for modding compatability.

Posted: Sun Mar 13, 2022 10:33 pm
by StormingKiwi
I think that it also needs file shadowing, by which I mean when you make a mod, you don't alter the original game file, but a copy, and as part of loading the mod the game loads the copy.