Dedicated Server and World Partitioning (MissingLevelPackage)

I can confirm this fixed the issue for me in 5.4.4. Thanks so much! I believe this might worthwhile for a PR; are you interested in making the PR or shall I @alexdjq. Specifically here are the changes you need:

diff --git a/Engine/Source/Runtime/Engine/Private/LevelUtils.cpp b/Engine/Source/Runtime/Engine/Private/LevelUtils.cpp
index 94c190e10812..679026b70477 100644
--- a/Engine/Source/Runtime/Engine/Private/LevelUtils.cpp
+++ b/Engine/Source/Runtime/Engine/Private/LevelUtils.cpp
@@ -79,6 +79,26 @@ ULevelStreaming* FLevelUtils::FindStreamingLevel(const ULevel* Level)
 	return ULevelStreaming::FindStreamingLevel(Level);
 }
 
+static bool CompareRightMostSubPath(const FString& Lhs, const FString& Rhs)
+{
+	int32 LastSlashIndex = 0;
+	if (!Lhs.FindLastChar('/', LastSlashIndex))
+	{
+		return false;
+	}
+	int32 SubPathLength = Lhs.Len() - LastSlashIndex - 1;
+	bool bIsEqual = Lhs.Right(SubPathLength) == Rhs.Right(SubPathLength);
+	if (!bIsEqual)
+	{
+		if (Rhs.FindLastChar('/', LastSlashIndex))
+		{
+			SubPathLength = Rhs.Len() - LastSlashIndex - 1;
+			bIsEqual = Lhs.Right(SubPathLength) == Rhs.Right(SubPathLength);
+		}
+	}
+	return bIsEqual;
+}
+
 ULevelStreaming* FLevelUtils::FindStreamingLevel(UWorld* InWorld, const FName PackageName)
 {
 	ULevelStreaming* MatchingLevel = NULL;
@@ -91,6 +111,11 @@ ULevelStreaming* FLevelUtils::FindStreamingLevel(UWorld* InWorld, const FName Pa
 				MatchingLevel = CurStreamingLevel;
 				break;
 			}
+			if (CompareRightMostSubPath(PackageName.ToString(), CurStreamingLevel->GetWorldAssetPackageName()))
+			{
+				MatchingLevel = CurStreamingLevel;
+				break;
+			}
 		}
 	}
 	return MatchingLevel;

Note, 5.4.x (fixed in 5.5.0) also has a separate issue with connecting PIE clients to a packaged DS when using ACharacter: Unreal 5.4 problem with a packaged game! Server spawns the character and client disconnecting with 'Failed to load package' error. - #10 by NV_gnoowik

1 Like