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"

Default AssetManager setup for maps doesn't work in packaged builds

The default setup of the AssetManager does not function in packaged builds: the Map asset type functions in PIE but not in a packaged build.

Repro:

  • Create a new project (suggested: FirstPersonBP)

  • If necessary, edit the "Maps" Primary Asset Type in the Asset Manager of the project settings to point at a directory with maps in it (for example, Game/FirstPersonBP/Maps for the FirstPersonBP template)

  • On some sort of event which will fire (for example, on the shoot event in the FirstPersonBP character) add a GetPrimaryAssetIDList blueprint node, and log the size of the array it outputs to see how many maps it's able to find. (Attached: picture of blueprint setup)

  • Run the game in PIE. Activate the event. Verify that the log reports that there is one map. (Or however many maps were in the folder your specified.)

  • Package the game and run it. Activate the event. Observe that the number of maps will always be reported as zero, indicating that the AssetManager is unable to locate any maps.

I haven't been able to fully figure out why this is happening, but it appears that the problem is probably related to the difference between UWorld and ULevel objects.

For the asset manager to be able to use an asset type as a Primary Asset in a packaged build, the asset's type has to implement a GetPrimaryAssetID function. For some reason this isn't the case when running in editor. (This is probably bad as it leads to nasty surprises when you package a build.) By default, the AssetManager is set up to locate all UWorld assets in the specified folder (Game/Maps by default). UWorld was modified with the addition of the AssetManager to have a GetPrimaryAssetID member to make them work with the AssetManager.

The problem is that UWorlds aren't assets. Maps are ULevel objects, which have a UWorld outer, but are not UWorlds themselves. As far as I'm aware, you'll never create a UWorld asset in the editor, they're created at runtime to house one or more ULevels.

It looks like there's some code somewhere which causes the AssetManager to find maps in the maps folder despite the fact that it's looking for UWorlds and the maps are ULevels. I'm not sure whether this was a specific exception for UWorlds, or if there are transient UWorlds created for the ULevels in editor, or what, but the magic stops as soon as running in a packaged build. (The packaged build failure to find any maps whatsoever is actually what I would expect to happen in all cases, since the AssetManager has been told to look for UWorlds and not ULevels, but whatever.)

To make matters worse, this isn't an easily fixable problem even in code, since there doesn't appear to be any way to reparent a ULevel to a new class. (If you were, for example, to create a new class which inherits from ULevel which implemented a GetPrimaryAssetID member.)

To get this to work, I think you'd currently have to add a UPrimaryDataAsset wrapper for ULevels in order to make them function. But basically all the work to make the AssetManager work out of the box for maps does nothing ATM outside of the editor, and furthermore since UPrimaryDataAsset is not a BlueprintType, it makes the AssetManager impossible to use at all in Blueprint-only projects.

Product Version: UE 4.18
Tags:
blueprint.jpg (43.4 kB)
more ▼

asked Nov 11 '17 at 12:06 AM in Bug Reports

avatar image

Teiwaz
629 26 28 55

avatar image Teiwaz Nov 13 '17 at 06:47 PM

I moved the select level menu over to use the old Asset Registry system (as opposed to the new Asset Manager) since all I wanted was a level list and didn't need to manage async loading. The Asset Manager works fine in packaged builds, but it's reporting all the ULevels as being UWorlds, so I guess that levels are packaged or cooked into worlds at some point, apparently, so the Asset Manager looking for them and not levels may be okay. The problem's still there, though, and now I have even less idea about what might be going wrong with it.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Teiwaz-

The reason the maps aren't showing in the packaged build is the "Is Editor Only" checkbox in Project Settings. This means that maps are excluded from primary assets when the game is packaged. Unchecking this box should give you the list of maps you're looking for in your packaged game.

Cheers

Doug E

more ▼

answered Nov 20 '17 at 07:51 PM

avatar image Teiwaz Nov 20 '17 at 08:19 PM

Hmm, yep, that was it. I was sure that I tried turning that off, but it may have been while I was experimenting with making ULevels primary assets instead and so broke it in other ways at the same time.

Can I point out that it seems like this option is a really bad one to have turned on by default? Especially when there's no tooltip.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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