Suggestions for modding compatability.

Please post here for questions and discussion about data, event, art and sound modding and the game editor for Distant Worlds.

Moderator: MOD_DW2

Post Reply
Deathawaits4
Posts: 20
Joined: Mon Mar 01, 2021 9:26 pm

Suggestions for modding compatability.

Post 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.
brucethemoose
Posts: 46
Joined: Fri Feb 18, 2022 6:14 pm

Re: Suggestions for modding compatability.

Post by brucethemoose »

Going to upvote this here too ^.


I cannot understate how useful XML patching is in Rimworld.
Nilserich7
Posts: 23
Joined: Fri Mar 11, 2022 8:33 pm

Re: Suggestions for modding compatability.

Post 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.
StormingKiwi
Posts: 309
Joined: Thu Feb 11, 2021 6:35 am

Re: Suggestions for modding compatability.

Post 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.
Post Reply

Return to “Design and Modding”