x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] External Plugin Pak File - Asset Registry not being serialized

Hello,

Currently we are working on modding support for Squad, this includes adding support for the Steam Workshop. Right now we are in the stage where we are working on getting mods loaded correctly. Today, I started working on Steam Workshop support for Mods. This included me adding Steam's workshop directory to the Plugins AdditionalPaths TArray.

It seemed like everything was working, the plugin's pak file got mounted as it normally would; as if it were located in the Squad/Plugins/Mods folder, but when i went to use the content; via our map change command, I noticed that the AssetRegistry was not populated with the mods assets. Please note that only the asset registry is not populated with mods assets when the mod is located in the Steam Workshop folder. When it is inside of Squad/Plugins/Mods everything works correctly.

I then decided to do some digging, and I finally hit the root of the problem:

 IPlatformFilePak.h - FPakEntry* Find

Inside of there a check is done:

 if (Filename.StartsWith(MountPoint))

And in our case since our plugin is not located within the Squad project. That fails.

 Filename : c:/steam/steamapps/workshop/content/393380/TestingMod/AssetRegistry.bin
 MountPoint : ../../../Squad/

Since the Find function fails so does FAssetRegistry::FAssetRegistry() when it tries to serialize plugin pak file data (Around line 101 FFileHelper::LoadFileToArray fails).

alt text

At this point, i am not sure what to do to fix the issue. Any help we be greatly appreciated.

Thanks,

Zak

Product Version: UE 4.16
Tags:
302140-capture.png (95.1 kB)
more ▼

asked Nov 23 '18 at 07:35 PM in C++ Programming

avatar image

NicholasMont ♦♦ STAFF
592 3 4 6

avatar image NicholasMont ♦♦ STAFF Nov 23 '18 at 07:38 PM

Hi Zak,

By AdditionalPaths TArray<> do you mean FProjectDescriptor::AdditionalPluginDirectories?

If you are using plugins (as in there's a uplugin file, not just a lone pak file) then make sure the plugins are being found in the FPluginManager::ReadAllPlugins function and that they are enabled.

If your plugins are being found by ReadAllPlugins, but the pak file is still not being mounted, then it may be because it can't find it; or perhaps resolve the content directory within the pak file.

That code is in FPluginManager::ConfigureEnabledPlugin and it's caller, FPluginManager::ConfigureEnabledPlugins.

Once a package is found it should broadcast the FPackageName::OnContentPathMountedEvent which is subscribed to by UAssetRegistryImpl::OnContentPathMounted and should be the point at which the assets become visible to the asset registry.

Also look in your logs for LogPluginManager and LogAssetRegistry entries which could be a source to find errors in loading your plugins.

Debugging the PluginManager followed by the AssetRegistryImpl would be my next recommendation.

Cheers,

Jonathan

avatar image NicholasMont ♦♦ STAFF Nov 23 '18 at 07:41 PM

Hey Jonathan,

My PAK file is being found, and mounted. The issue is that the AssetRegistry isn't being loaded from the PAK file when the plugin is located a file outside of the base Squad folder.

In PluginManger.cpp:

 FCoreDelegates::OnMountPak.Execute(PakPath, 0, nullptr);

Is succeeding. Its later on in the program when it gets to the AssetRegistry constructor FAssetRegistry::FAssetRegistry() it fails. Inside of there it tries serialize plugins with pak files paks. And that is where it fails. Referencing above it is failing because our Filename is not in the Squad root project so the

 if (Filename.StartsWith(MountPoint))

Fails. Here are the details of the case failure.

Fail Case (This is when it is in the Steam Workshop directory):

 Filename : c:/steam/steamapps/workshop/content/393380/TestingMod/AssetRegistry.bin
 MountPoint : ../../../Squad/
 Succeed case (This is when it is in Squad/Plugins)
 Filename: ../../../Squad/Plugins/Mods/TestingMod/AssetRegistry.bin
 MountPoint: ../../../Squad/


Thanks,

Zak

(comments are locked)
10|2000 characters needed characters left

The question has been closed Dec 04 '18 at 05:53 PM by NicholasMont for the following reason:

UDNCONVERSION


1 answer: sort voted first

Hello,

You're going to need to manually add the mount points for mods because we don't have a system that knows how to find them properly. The AdditionalPluginDirectories system works for external plugins, but they are all known at cook time.

They remap themselves into the CookedContent directory so that content plugins have a consistent mount point. You'll need to do something similar but in a dynamic manner to mount "ModFoo/Content" to "c:/steam/steamapps/workshop/content/393380/ModFoo/"

Thanks,

Joe

more ▼

answered Nov 23 '18 at 07:44 PM

avatar image

NicholasMont ♦♦ STAFF
592 3 4 6

(comments are locked)
10|2000 characters needed characters left

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question