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"

RequestAsyncLoad can't find assets in packaged game

Hello,

I can't load objects from a pak file in a packaged game.

I tried this:

 UAssetManager::Get().LoadAssetList(Lib00SoftObjectPaths, FStreamableDelegate::CreateUObject(this, &AYagUIBranchMain::AuthorizeCircle00));

and this:

 Streamable.RequestAsyncLoad(Lib00SoftObjectPaths, FStreamableDelegate::CreateUObject(this, &AYagUIBranchMain::AuthorizeCircle00));

In both cases i get the following error:

 LogStreamableManager: Error: RequestAsyncLoad called with empty or only null assets!

It works well in PIE and in Standalone Game, but not in the packaged game (using pak file, didn't try wihout).

I have added the directories to cook in the packaging settings and i can see them being cooked in the logs.

I can check that Lib00SoftObjectPaths.Num() contents exactly the number of assets in the directory.

So i am quite sure that the assets are present, yet i get this error.

In case it helps, i am using the UObjectLibrary::LoadBlueprintAssetDataFromPath function to load the asset data in a FAssetData Array, on which i apply ToSoftObjectPath (on each element in a loop).

I couldn't get UAssetManager::GetPrimaryAssetPathList working (still don't know if it's a bug or me incorrectly using it), that's why i still use UObjectLibrary.

Thanks

Cedric

Product Version: UE 4.18
Tags:
more ▼

asked Nov 25 '17 at 09:51 AM in Bug Reports

avatar image

uced
850 75 91 360

avatar image uced Nov 25 '17 at 10:20 AM

Continuing my tests, i tried to not use a pak file.

I still doesn't work.

I can see my assets in their directory, but their size is significantly reduced and each of them comes in 2 files, .uasset and .uexp.

As an example, here are some sizes:

  • original: horse.uasset => 123 ko

  • packaged: horse.uasset => 8 ko

  • packaged: horse.uexp => 3 ko

I don't know whether this is normal or not.

In any case, it seems that my problem is not related to the pak file.

Cedric

avatar image uced Dec 01 '17 at 06:23 AM

I'm confused, the following post seems to imply that aync load is not supposed to work in 4.18 and maybe in 4.19 ?

https://answers.unrealengine.com/questions/702804/async-load-primary-asset-class-type-wont-load-afte.html

If so, what AsyncLoad function can i use in a packaged game ?

Cedric

avatar image uced Dec 05 '17 at 06:41 PM

So i have been making tests more carefully and my results are a bit different from what i previously described.

In fact, my assets are blueprints having quite some components, one of them being a skeletal mesh associated with its own blendspace.

My previous problem was that i wasn't cooking (and hence packaging) the blendspaces, which are "primary" object in the reference viewer sense.

So i made two things:

  • test with simpler blueprints (replacing skeletal meshes with static meshes)

  • actually add the directory containing all the blendspaces in the "directories to cook" settings.

In both cases, the blueprints still don't load in the packaged game, but now i don't get the "null assets" messages.

So the "null assets" message was due to uncooked objects (my mistake) and is now corrected.

Still, the (now assumed correctly cooked and packaged) assets won't load in the packaged game, but now i have no error message.

RequestAsyncLoad seems to do nothing: it starts and stops instantly and loads nothing with no message in the log.

So i still don't know if it's me wrongly using it or if it's a bug.

My game still doesn't work when packaged, any help appreciated.

Thanks

Cedric

avatar image M0xim Dec 06 '17 at 10:47 PM

FYI, the message that you probably get is .18+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 6647] LoadPackageAsync failed to begin to load a package because the supplied package name was neither a valid long package name nor a filename of a map within a content folder: ''. I have see this message on "laucher settings" window

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

2 answers: sort voted first

Ok, i found a working solution.

I was doing this (works in PIE only):

 for (int i = 0; i < Lib00SoftObjectPaths.Num(); i++)
 {
     UBlueprint* ThisObjBP = Cast<UBlueprint>(Lib00SoftObjectPaths[i].ResolveObject());
     if (ThisObjBP) BPToLoad.Add(ThisObjBP->GeneratedClass);
 }

And the solution was to do this (works in PIE and packaged game):

 for (int i = 0; i < Lib00SoftObjectPaths.Num(); i++)
 {
     FString BPRef = "Blueprint'" + Lib00SoftObjectPaths[i].GetAssetPathString() + "_C'";
     UClass* ThisBPClass = LoadObject<UClass>(NULL, *BPRef);
     if (!ThisBPClass) continue;
     BPToLoad.Add(ThisBPClass);
 }


What i don't understand is why is the engine making things so difficult with blueprints ?

Knowing that there is a way to load them dynamically, why not make as simple as FSoftObjectPath::LoadBlueprint() ?

All the best Cedric

more ▼

answered Dec 06 '17 at 06:53 PM

avatar image

uced
850 75 91 360

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

Hello mate! And thanks for your solution. I have the same problem. Just I would like to ask if you use your above code, after requestAsyncLoad ( in a callback) . Or you ignore it completely? Because i am looking for an asynchronous solution.

more ▼

answered Dec 06 '17 at 10:30 PM

avatar image

M0xim
16 2 3

avatar image uced Dec 06 '17 at 11:02 PM

Hey,

Actually, i'm currently using UAssetManager::Get().LoadAssetList to fill my FSoftObjectPath array, but i have been trying both this one and RequestAsyncLoad and couldn't see any difference between the two, so it's your call.

If anyone knows a good reason to choose one over the other, i'm all ears :-)

Anyway, whichever you choose, the solution provided here is in their callback, and the loading is done asynchronously.

Cheers

Cedric

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question