Skip to content

Performance Fish causes Vehicle Framework XML field lookup failure on winterCostMultiplier #12

Description

@phooenixdassmatte

Performance Fish causes three Vanilla Vehicles Expanded vehicle definitions to fail during XML loading.

Affected vehicles:

  • VVE_Scytheman
  • VVE_Badger
  • VVE_Burya

Opening the architect menu and under vehicles the whole architect menu crashes, or when having better architect menu mod installed, under "military", the whole architect menu crashes.

All three fail while RimWorld is resolving the following field against Vehicles.VehicleProperties:

<winterCostMultiplier>...</winterCostMultiplier>

Confirmed reproduction

Fishery enabled, Performance Fish disabled

All three vehicles load correctly.

Fishery and Performance Fish enabled

All three vehicles fail to load.

No other mods or settings were changed between these two tests.

Diagnostic result

A custom Harmony diagnostic captured the exact exception:

typeBeingDeserialized: Vehicles.VehicleProperties
fieldNode.Name: winterCostMultiplier

System.NullReferenceException: Object reference not set to an instance of an object

at Verse.XmlToObjectUtils.DoFieldSearch(
    System.Type typeBeingDeserialized,
    System.Xml.XmlNode fieldNode,
    System.Xml.XmlNode xmlRootForDebug
)

- PREFIX Vehicle Framework:
  SmashTools.Patching.Patch_XmlParsing.PreProcessAttributes

- POSTFIX Vehicle Framework:
  SmashTools.Patching.Patch_XmlParsing.ReadCustomAttributes

The affected XML nodes are populated normally:

VVE_Scytheman: <winterCostMultiplier>0.7</winterCostMultiplier>
VVE_Badger:    <winterCostMultiplier>2.125</winterCostMultiplier>
VVE_Burya:     <winterCostMultiplier>0.95</winterCostMultiplier>

When Performance Fish is active, DoFieldSearch throws while resolving these fields. With Performance Fish disabled, the same definitions load successfully.

Consequences

Because the VehicleDefs fail to load:

  • the vehicles are missing;
  • their blueprint and wreck references cannot resolve;
  • the affected vehicle section of the Architect menu can break.

Workaround

Removing the three winterCostMultiplier XML nodes prevents the errors, but this also removes their intended winter travel modifiers.

Disabling Performance Fish fixes the issue without modifying the vehicle definitions.

Versions

  • RimWorld: 1.6.4871
  • Performance Fish: 0.6.2
  • Fishery: 0.6.1
  • Vehicle Framework: RimWorld 1.6 version

Could Performance Fish’s reflection caching, particularly its patches around reflection or object creation, be returning a stale or incorrect field result during Vehicle Framework’s custom XML parsing?

Modlist:

ModsConfig.xml

Rimworld Log with custom debugger:

Log after VF XMD Debug 2.txt

Custom debug mod:

VF XML Diagnostic.zip

Custom mod patch to fix it (Temporary fix until this is fixed)
Place folder inside \steamapps\common\RimWorld\Mods
And the safest mod load order to place it would be right after the last mod that does anything with Vanilla vehicles expanded or Vehicle framework.

VVE WinterCost Diagnostic Fix.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions