Closed toebeann closed 1 year ago
Some musings about how one might solve the issue in the nexus mods forum thread for SnapBuilder:
I was waiting to see if the author of Decorations mod was going to release an update, because the last I knew they were working on a port to BZ with updates to the codebase.
However, it seems the mod has been inactive for a long time, and I'll need to re-evaluate how to handle compatibility, perhaps with a compatibility patch. It's low on my priority list at this time - I'll see what I can do, but no promises as it would be a rather large undertaking - equivalent to my making a whole new mod in scope, and that's something that I would need to budget time for.
As for elaborating on the issues -
First off, I can't guarantee I was 100% correct in my assessment at the time (a couple of years ago now). I didn't go fully digging around in their codebase, I simply spent a brief amount of time debugging what the difference is between their items and standard base game items at runtime, and I made a quick assumption based on what I found. I didn't take it any further because I had deemed the issue low priority, especially because they reportedly were working on a port and update for Deco Mod anyway. Not to mention how frustrating it would be if I spent a month or two working on a compatibility layer between Decorations Mod and SnapBuilder, only for that work to be deemed obsolete a week or two later.
Secondly, even if I was 100% correct in my assessment at the time, I can't guarantee it still stands, because I don't know if they've changed how their mod operates since then - I've never really used Decorations Mod all that much because I tend to play the game mostly vanilla but with QoL tweaks, and I haven't actually loaded up Subnautica in quite a long time. So I'd have to re-evaluate to be sure.
With all that said:
At the time I made that statement I noticed that the reasons many of their items don't play nicely with SnapBuilder is due to them not assigning properties that the game engine relies on to understand how to place an item correctly, i.e. telling the engine that this is an item that goes on the wall, this is an item that goes on the floor, this item has a bounding box that is this big, etc. etc. The items will still allow you to place them in a way that feels correct, because to make their items work, they essentially modded the game to force it (I believe) by adding a bunch of extra code of their own which mimics how the game handles it. If they had set the correct properties, then this would have been entirely unnecessary, and SnapBuilder would have worked with Deco Mod out of the box (there might still have been some issues, but they woulld have been simpler to resolve).
However, there might be other factors at play that prevented them from setting those properties - I am not sure as I didn't make their mod, and I've never made a mod which adds buildable items to the game like Decorations Mod, so I'm not sure of all of the intricacies which that entails. All I know is that when I attempted to debug the issue at runtime, the difference between the base game items and theirs is that theirs didn't have those properties set reliably, so the assumption is that this is what causes SnapBuilder to handle those items improperly.
So assuming my assessment is (still) correct, I would need to either: a) set up a PR on their GitHub for their mod, hope they accept and merge it and then release an updated version, b) set up a separate compatibility patch/mod which sets up those properties for their items and trims some of their code, or c) set up a patch/mod which hooks into where their code forces the alignment of objects, and make SnapBuilder take over instead
None of these are really all that easy to do. The preferred outcome would be method a), and would likely be the simplest fix, assuming the author of the original mod is willing. However, regardless of the chosen approach, it would require a large time investment on my part of digging through 3 code bases (the game's, my own mods', and theirs), going through every item in their mod, applying fixes and testing them to make sure it all works properly. And even though a) would be the preferred outcome, I'd probably start with b), and then do a) once b) is already working and released, so that if a) never gets merged and released, b) is still available for people to use.
If my assessment is incorrect, then I'll have to go deep-diving to figure out what the problem is, because it should "just work" if they were set up like other items in the game.
All of this is to say that it's a rather large time investment, and I make absolutely no promises that it'll ever happen.
With the release of SnapBuilder 2.1, we have introduced an API for mods to use to resolve these kinds of issues. We expect to see an update of Decorations Mod which takes advantage of this API shortly.
Reported by user DaltonB on Nexus Mods
Decorations Mod: https://www.nexusmods.com/subnautica/mods/102