Skip to content

[BUG] Discrepancy between .yaml files when de and serializing an ESP that has already been serialized. #112

@MissCorruption

Description

@MissCorruption

While working on a mod and using Spriggit I noticed that Spriggit will change some .yaml files for my project and I finally found out how/why:

Environment

OS: Windows 11
Spriggit Version: Spriggit.CLI 0.36.14+Branch.main.Sha.a1b099fe76b087621ceb66a0641761d0085dad98.a1b099fe76b087621ceb66a0641761d0085dad98
Game: SkyrimSE
Command used: Spriggit.CLI.exe serialize --InputPath ${input:espFile} --OutputPath Source\\ESP --GameRelease SkyrimSE --PackageName Spriggit.Yaml" (it's a task in VSC)

Steps to repro:

  1. Have an ESP/L/M plugin.
  2. Serialize it.
  3. Make no changes to the serialized files.
  4. De-serialize it.
  5. Serialize it again.

It doesn't change anything major, mostly shuffles stuff around but it does sully the git history and makes it harder to spot diffs.

Here are some lines that are changed:

# Before, aka at step 2:
- Rotation: 0, -0, 5.1000247
- Value: "Key Casino - Keys and Cost Concealed:\n??? = Restraint Keys\n??? = Chastity Keys\n??? = Piercing Tools\nFor ??? "

# After step 5:
- Rotation: 0, 0, 5.1000247
- Value: "Key Casino - Keys and Cost Concealed:\r\n??? = Restraint Keys\r\n??? = Chastity Keys\r\n??? = Piercing Tools\r\nFor ??? "
Data at step 2
FormKey: 1B3400:DeviousFollowers.esp
EditorID: _DflowForceGreetAIFSEnd
Flags:
- PreferredSpeed
Type: Package
PreferredSpeed: Run
Unknown: 42
InteruptFlags:
- WorldInteractions
- 0x400
- 0x800
- 0x1000
- 0x2000
- 0x4000
- 0x8000
ScheduleMonth: -1
ScheduleDayOfWeek: 255
ScheduleHour: -1
ScheduleMinute: -1
Unknown3: 0x000000
Conditions:
- MutagenObjectType: ConditionFloat
  Data:
    MutagenObjectType: GetStageConditionData
    Quest: 1ABD14:DeviousFollowers.esp
  ComparisonValue: 30
- MutagenObjectType: ConditionFloat
  CompareOperator: NotEqualTo
  Data:
    MutagenObjectType: IsInSceneConditionData
    RunOnType: Reference
    Reference: 000014:Skyrim.esm
  ComparisonValue: 1
- MutagenObjectType: ConditionFloat
  CompareOperator: NotEqualTo
  Data:
    MutagenObjectType: IsTalkingConditionData
    RunOnType: Reference
    Reference: 000014:Skyrim.esm
  ComparisonValue: 1
- MutagenObjectType: ConditionFloat
  CompareOperator: NotEqualTo
  Data:
    MutagenObjectType: IsTalkingConditionData
  ComparisonValue: 1
PackageTemplate: 03C1C4:Skyrim.esm
DataInputVersion: 18
Data:
- Key: 7
  Value:
    MutagenObjectType: PackageDataTopic
    Topics:
    - MutagenObjectType: TopicReference
      Reference: 1B0C57:DeviousFollowers.esp
- Key: 8
  Value:
    MutagenObjectType: PackageDataLocation
    Location:
      Target:
        MutagenObjectType: LocationTarget
        Link: 000014:Skyrim.esm
      Radius: 150
- Key: 62
  Value:
    MutagenObjectType: PackageDataLocation
    Location:
      Target:
        MutagenObjectType: LocationTarget
        Link: 000014:Skyrim.esm
      Radius: 150
- Key: 75
  Value:
    MutagenObjectType: PackageDataLocation
    Location:
      Target:
        MutagenObjectType: LocationTarget
        Link: 000014:Skyrim.esm
      Radius: 150
- Key: 79
  Value:
    MutagenObjectType: PackageDataBool
- Key: 65
  Value:
    MutagenObjectType: PackageDataBool
    Data: True
- Key: 17
  Value:
    MutagenObjectType: PackageDataTarget
    Type: SingleRef
    Target:
      MutagenObjectType: PackageTargetSpecificReference
      Reference: 000014:Skyrim.esm
- Key: 22
  Value:
    MutagenObjectType: PackageDataLocation
    Location:
      Target:
        MutagenObjectType: LocationTarget
        Link: 000014:Skyrim.esm
      Radius: 5000
- Key: 26
  Value:
    MutagenObjectType: PackageDataBool
- Key: 81
  Value:
    MutagenObjectType: PackageDataBool
    Data: True
- Key: 40
  Value:
    MutagenObjectType: PackageDataBool
- Key: 29
  Value:
    MutagenObjectType: PackageDataBool
- Key: 30
  Value:
    MutagenObjectType: PackageDataBool
- Key: 31
  Value:
    MutagenObjectType: PackageDataBool
- Key: 32
  Value:
    MutagenObjectType: PackageDataBool
- Key: 33
  Value:
    MutagenObjectType: PackageDataBool
- Key: 34
  Value:
    MutagenObjectType: PackageDataBool
- Key: 36
  Value:
    MutagenObjectType: PackageDataBool
- Key: 67
  Value:
    MutagenObjectType: PackageDataFloat
    Data: 50
- Key: 69
  Value:
    MutagenObjectType: PackageDataBool
XnamMarker: 0x52
OnBegin:
  Topics:
  - MutagenObjectType: TopicReference
OnEnd:
  Topics:
  - MutagenObjectType: TopicReference
OnChange:
  Topics:
  - MutagenObjectType: TopicReference
Data after dtep 5
FormKey: 1B3400:DeviousFollowers.esp
EditorID: _DflowForceGreetAIFSEnd
Flags:
- PreferredSpeed
Type: Package
PreferredSpeed: Run
Unknown: 42
InteruptFlags:
- WorldInteractions
- 0x400
- 0x800
- 0x1000
- 0x2000
- 0x4000
- 0x8000
ScheduleMonth: -1
ScheduleDayOfWeek: 255
ScheduleHour: -1
ScheduleMinute: -1
Unknown3: 0x000000
Conditions:
- MutagenObjectType: ConditionFloat
  Data:
    MutagenObjectType: GetStageConditionData
    Quest: 1ABD14:DeviousFollowers.esp
  ComparisonValue: 30
- MutagenObjectType: ConditionFloat
  CompareOperator: NotEqualTo
  Data:
    MutagenObjectType: IsInSceneConditionData
    RunOnType: Reference
    Reference: 000014:Skyrim.esm
  ComparisonValue: 1
- MutagenObjectType: ConditionFloat
  CompareOperator: NotEqualTo
  Data:
    MutagenObjectType: IsTalkingConditionData
    RunOnType: Reference
    Reference: 000014:Skyrim.esm
  ComparisonValue: 1
- MutagenObjectType: ConditionFloat
  CompareOperator: NotEqualTo
  Data:
    MutagenObjectType: IsTalkingConditionData
  ComparisonValue: 1
PackageTemplate: 03C1C4:Skyrim.esm
DataInputVersion: 18
Data:
- Key: 7
  Value:
    MutagenObjectType: PackageDataTopic
    Topics:
    - MutagenObjectType: TopicReference
      Reference: 1B0C57:DeviousFollowers.esp
- Key: 8
  Value:
    MutagenObjectType: PackageDataLocation
    Location:
      Target:
        MutagenObjectType: LocationTarget
        Link: 000014:Skyrim.esm
      Radius: 150
- Key: 17
  Value:
    MutagenObjectType: PackageDataTarget
    Type: SingleRef
    Target:
      MutagenObjectType: PackageTargetSpecificReference
      Reference: 000014:Skyrim.esm
- Key: 22
  Value:
    MutagenObjectType: PackageDataLocation
    Location:
      Target:
        MutagenObjectType: LocationTarget
        Link: 000014:Skyrim.esm
      Radius: 5000
- Key: 26
  Value:
    MutagenObjectType: PackageDataBool
- Key: 29
  Value:
    MutagenObjectType: PackageDataBool
- Key: 30
  Value:
    MutagenObjectType: PackageDataBool
- Key: 31
  Value:
    MutagenObjectType: PackageDataBool
- Key: 32
  Value:
    MutagenObjectType: PackageDataBool
- Key: 33
  Value:
    MutagenObjectType: PackageDataBool
- Key: 34
  Value:
    MutagenObjectType: PackageDataBool
- Key: 36
  Value:
    MutagenObjectType: PackageDataBool
- Key: 40
  Value:
    MutagenObjectType: PackageDataBool
- Key: 62
  Value:
    MutagenObjectType: PackageDataLocation
    Location:
      Target:
        MutagenObjectType: LocationTarget
        Link: 000014:Skyrim.esm
      Radius: 150
- Key: 65
  Value:
    MutagenObjectType: PackageDataBool
    Data: True
- Key: 67
  Value:
    MutagenObjectType: PackageDataFloat
    Data: 50
- Key: 69
  Value:
    MutagenObjectType: PackageDataBool
- Key: 75
  Value:
    MutagenObjectType: PackageDataLocation
    Location:
      Target:
        MutagenObjectType: LocationTarget
        Link: 000014:Skyrim.esm
      Radius: 150
- Key: 79
  Value:
    MutagenObjectType: PackageDataBool
- Key: 81
  Value:
    MutagenObjectType: PackageDataBool
    Data: True
XnamMarker: 0x52
OnBegin:
  Topics:
  - MutagenObjectType: TopicReference
OnEnd:
  Topics:
  - MutagenObjectType: TopicReference
OnChange:
  Topics:
  - MutagenObjectType: TopicReference

In the details above no content changed, it was just shuffled around. Which still creates a diff in git history

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions