Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update SoftObject to include added string #34

Closed
wants to merge 2 commits into from
Closed

update SoftObject to include added string #34

wants to merge 2 commits into from

Conversation

c01dc0ffee
Copy link
Contributor

SoftObjectProperty contains an extra string value in the Abiotic Factor demo's save files. This change allows uesave to parse ABF saves, but will break existing compatibility.

@c01dc0ffee
Copy link
Contributor Author

Abiotic Factor uses UE 5.3.2:

{
  "header": {
    "magic": 1396790855,
    "save_game_version": 3,
    "package_version": {
      "New": [
        522,
        1009
      ]
    },
    "engine_version_major": 5,
    "engine_version_minor": 3,
    "engine_version_patch": 2,
    "engine_version_build": 0,
    "engine_version": "UE5",
...

I'm not sure if this change comes from 5.3 or if it's exclusive to Abiotic Factor, but I'll try to keep this updated if I find out.

@Egaliterrier
Copy link

Thanks so much for this. Still can't parse WorldSave_*.sav files though. Except Worldsave_MetaData.sav. The others fail with:

offset 1653: StructType for ".SimpleDoorMap.Value" unspecified, assuming Struct(None)
Error: at offset 1970: unknown property type: "DoorState_16_FC20B6E3483FF18E4FBDF19E39E880E9"

WorldSave_Facility.zip

@trumank
Copy link
Owner

trumank commented May 13, 2024

@Egaliterrier I've updated the SoftObjectPath struct to have the same change (I believe one is simply a wrapper of the other) which fixes that save.

I took the liberty of finding the serialization code in the UE source and it looks like the format did indeed change, so I'll add some version checks and merge this at some point.

void FSoftObjectPath::SerializePathWithoutFixup(FArchive& Ar)
{
	if (Ar.IsLoading() && Ar.UEVer() < VER_UE4_ADDED_SOFT_OBJECT_PATH)
	{
		FString Path;
		Ar << Path;

		if (Ar.UEVer() < VER_UE4_KEEP_ONLY_PACKAGE_NAMES_IN_STRING_ASSET_REFERENCES_MAP)
		{
			Path = FPackageName::GetNormalizedObjectPath(Path);
		}

		SetPath(MoveTemp(Path));
	}
	else if (Ar.IsLoading() && Ar.UEVer() < EUnrealEngineObjectUE5Version::FSOFTOBJECTPATH_REMOVE_ASSET_PATH_FNAMES)
	{
		FName AssetPathName;
		Ar << AssetPathName;
		AssetPath = WriteToString<FName::StringBufferSize>(AssetPathName).ToView();

		Ar << SubPathString;
	}
	else
	{
		Ar << AssetPath;
		Ar << SubPathString;
	}
}

@c01dc0ffee c01dc0ffee closed this by deleting the head repository Jun 7, 2024
trumank added a commit that referenced this pull request Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants