GameMode not found when loading a level from dynamically mounted PAK

Hey everyone,

I’m working on a collaborative viewer app in UE 5.3 and I’ve run into an issue with loading levels from PAK files. Let me explain my setup and what’s going wrong.

I have two separate projects. The main one contains all the game logic - the GameModes, GameInstance, PlayerControllers, UI, everything code-related. When I package this, it creates the executable that the user runs.

Then I have a second project that’s purely for content - just maps, meshes, textures, materials, etc. I package this into separate PAK files that get loaded dynamically at runtime. The idea is to keep the game logic separate from the world content.

Here’s the problem: when I mount one of these content PAKs and try to open the level, it can’t find the GameMode even though it’s in my base project. The logs show:

LogStreaming: Error: Couldn't find file for package /Game/CollaborativeViewer/Blueprints/GameMode/BP_CollaborativeViewer_GameMode
LogLoad: Game class is 'GameModeBase'

So it just falls back to the default GameModeBase instead of using my custom one.

I’ve tried a few things already. First, I configured GameModeMapPrefixes in DefaultEngine.ini like this:

[/Script/EngineSettings.GameMapsSettings]
+GameModeMapPrefixes=(Prefix="MainMap",GameMode="/Game/CollaborativeViewer/Blueprints/GameMode/BP_CollaborativeViewer_GameMode.BP_CollaborativeViewer_GameMode_C")

I also tried passing the ?game= parameter in the OpenLevel call but it doesn’t work either. I even added a 2-second delay to make sure the Asset Registry finishes scanning. But it still doesn’t find the GameMode.

My best guess is that when OpenLevel does its async loading for a level from the content PAK, it only searches within that specific PAK and doesn’t look in my base project where the GameMode actually is.

So my question is: is there a proper way to make this work? Can the level loader find a GameMode that’s in the base executable when opening a level from a dynamically mounted PAK?

I really want to avoid putting the GameMode in every content PAK because that defeats the whole point of keeping game logic separate from content.

Any advice would be super helpful. Thanks!

Engine Version: UE 5.3.2
Platform: Windows
Build Config: Development

This is unlikely. Although I’m not familiar with async loading (maybe you should try without) but I’m pretty sure the loader never searches into a specific pak file - the loader doesn’t even know about pak files it just abstractly asks the FileManager/PlatformFile.

In this case I suspect you are mounting the new PAK into a virtual path that overrides and breaks the default one. Engine doesn’t support one virtual path pointing to two different locations. For example :

  1. default /Game/points to /MainProject/Content/
  2. you mount second pak and re-point /Game/to /SecondProject/Content/
  3. now all references to /Game/…somethingcannot reach main assets anymore
1 Like

Thank you so much for your help! You were absolutely right about the issue.

The problem was indeed that I was overwriting the virtual path by registering my PAK’s mount point to /Game/, which was breaking access to my base application assets (including the GameMode).
I’ve now successfully resolved it by registering the PAK to a different mount point name (e.g., /GamePaks/ instead of /Game/), which allows both my base application content and the dynamically loaded PAK content to coexist without conflicts. The GameMode now loads correctly from the base application while the PAK level loads properly.
I’m still working through some asset reference issues within the level itself, but your insight about the mount point overwriting was the key to solving the core problem.

Thanks again for taking the time to explain how the virtual path system works!

This is definitely gonna be a big issue. In the editor, your level references its assets via /Game/path, and references are cooked/packaged that way. But once loaded in your project, /Game/points to the main code and not to the assets.

I can think of two approaches to solve this :

  1. Use the same project name for second project as main project. This way ALL content (main game and levels) can be reached via /Game/. You will however have to be careful to avoid conflicts. This is a decent solution if you can easily manage conflicts, and if you are loading paks dynamically and don’t need asset registry shenanigans (otherwise the asset registries will conflict).
  2. Put your level(s) into content plugins or mods (same thing) and package them as such. Those have their own virtual path (eg: /MyPlugin/pointing to Plugins/MyPlugin/Content/…) so you can just mount the plugin pak and mount the correct virtual path and it should all be well.

I tried creating an additional mount point (/Game/Paks/) for the internal asset references within the dynamically loaded PAK, and it’s working quite well so far. The “longest prefix match” behavior is handling the routing correctly.

However, I can see it’s a bit fragile - you really need to be very organized and aware of exactly how the asset paths are structured, otherwise references can break easily.

My ultimate goal is to connect these dynamically loaded worlds to a multiplayer system using PlayFab. Do you think the plugin/mod approach you mentioned would be more robust for handling these multiplayer synchronization concerns? I’m worried that the mount point solution might cause issues with network version checking or asset reference consistency between server and clients.

I haven’t worked with content plugins before, so I’m not sure how they would interact with multiplayer connections and whether they would solve these networking concerns.

Any insights on best practices for dynamic content loading in multiplayer would be greatly appreciated!