Skip to content

๐Ÿ› [BUG] - All NPC world objects turn hostile after updating server from 26.8.9.1 to 26.8.16.1 (FactionDef โ†’ FactionDefName rename breaks stored WorldObjects data)ย #312

Description

@a25580829a

Description

Summary

After updating a server from 26.8.9.1 to 26.8.16.1 (keeping the existing Assets folder, as the release notes state the versions are "fully compatible"), every NPC settlement and site on the world map shows up as the hostile "Enemy Player Settlements" faction for all players.

Root cause

Between 26.8.9.1 and 26.8.16.1, the property FL_WorldObject.FactionDef was renamed to FL_WorldObject.FactionDefName (RTShared), with no migration for previously stored data:

  1. The server persists world objects as JSON (Serializer.SerializeToFile, Newtonsoft, serialized by property name) under Assets\WorldObjects\. Files written by 26.8.9.1 contain the key "FactionDef".
  2. The 26.8.16.1 server deserializes them into the new class, which expects "FactionDefName". The key no longer matches, so the property silently stays string.Empty.
  3. The server sends world objects with an empty faction defName to clients. In the client's PM_WorldObject.AddWorldObject, the faction lookup by defName finds nothing and falls back to SessionManager.EnemyFaction, so every NPC settlement/site gets the hostile enemy placeholder faction.

Workaround (verified)

Stop the server, rename the JSON key in all stored world object files, restart:

Get-ChildItem "<server>\Assets\WorldObjects" -File -Recurse | ForEach-Object {
  (Get-Content $_.FullName -Raw) -replace '"FactionDef"\s*:', '"FactionDefName":' |
    Set-Content $_.FullName -Encoding utf8
}

Clients self-heal on next login (the sanitize/re-add flow replaces the mismatched settlements).

Suggested fix

  • Accept the legacy FactionDef key when loading Assets\WorldObjects (data migration), or update the release notes to state a world reset / manual migration is required.
  • Consider making the client fallback for an unknown/empty faction defName neutral instead of enemy, so future serialization mismatches degrade gracefully instead of turning the whole map hostile.
Image

OS

Windows

Reproduction steps

1. Run a server on 26.8.9.1 with an existing world (Assets\WorldObjects\ populated).
2. Swap the server executable for 26.8.16.1, keeping the Assets folder.
3. Connect with a 26.8.16.1 client (Steam Workshop).
4. Open the world map: all NPC settlements/sites are hostile ("Enemy Player Settlements").

Screenshots

Client logs

No errors appear in the client log โ€” the failure is silent: the faction defName arrives empty and AddWorldObject falls back to SessionManager.EnemyFaction without logging. (Player.log available on request.)

Server logs

No errors in the server console either โ€” the old JSON key is silently ignored on deserialize. Evidence from a stored file in Assets\WorldObjects\ written by 26.8.9.1, still using the old key:

{
  "Type": 0,
  "Tile": 13383,
  "Name": "ๆฃฎไปŠๅŸŽ",
  "Owner": "yummyhotpot",
  "Points": -3.4028235E+38,
  "FactionDef": "OutlanderRough",
  "MainPartDef": "",
  "PartDefNames": []
}

26.8.16.1 expects "FactionDefName" here, so the field deserializes as empty.

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