NPC Records, Nullability (ocassional lack thereof) and change detection. #433
-
Fist of all let me thank you for this awesome project, found it recently and I love it so much. My current intent is to try to implement some sort of "bundled patching" of everything NPC related (Appearance, AI, Inventory, so on). Do I need to compare all values in such fields with the data from the "master" file to determine if a change has occurred? Thanks again! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Nullability is not meant to indicate records that are deviating from the default values (or the previous values). Instead, they're meant mostly for communicating whether the data exists when stored on disk or not
Yes, to determine what has changed from the previous override, you would need to look at and compare all field's content and see what changed. You might want to lean on the Equality concepts, like GetEqualsMask. They haven't been fully tested and confirmed correct, though #211 However, the equality systems Mutagen will provide with its built in Equality and GetEqualsMask is going to be a gritty interpretation: Eg, -any- difference, however minute, will mark it as not equal. So if you have a more subjective interpretation of what fields "matter" and how, then you might need to implement your own equality checks with those subjective bits in mind Lastly, if you find yourself writing, by hand, hundreds of lines of verbose equality code for every field of every object, then I would suggest considering some alternatives such as reflection, code generation, or some other means of avoiding hand writing tons of error prone code like that. |
Beta Was this translation helpful? Give feedback.
Nullability is not meant to indicate records that are deviating from the default values (or the previous values). Instead, they're meant mostly for communicating whether the data exists when stored on disk or not
https://github.com/Mutagen-Modding/Mutagen/wiki/Nullability-to-Indicate-Record-Presence
But this is unrelated to whether RecordA in OverrideMod.esp has a value that is different from how it looked in BaseMaster.esp