LevelSequence BindingReferences causing maps to be cooked

I found this question about basically the same thing, but it was so long ago that I was wondering what the current state of things are?

[ULevelSequence::BindingReferences causes unnecessary files to be [Content removed]

I’ve just been debugging why some of our maps are being pulled into the build despite not being referenced by our MapsToCook list (or sublevels of those).

I noticed that a few of our level sequences actually had soft references to maps. This seems to be from some old possessable bindings when they were set up in LevelA, but are now played in LevelB, and I guess the sequence was never re-saved and/or had ‘Rebind possessable references’ run on them relative to the new level.

It feels like this shouldn’t really be necessary in the first place though? Since I can see why a possessable would need a reference to the map path for it to resolve its bindings, but since the sequence wouldn’t ever cause that map to be loaded in of itself, it shouldn’t be the thing causing the map to get included in the cook. Whatever would end up causing the map to be loaded before the sequence is played back should be the reference that adds it to the cook instead.

I’ve tried marking the `FDirectPathObjectLocator`'s Path property as `Meta=(Untracked)` (after grabbing a recent fix CL for that meta not working properly from UDN), but that didn’t seem to prevent the maps being pulled in (even re-saving the sequences which were shown as Instigator in the cook log).

I wondered if you had any advice on how to prevent this?

We may have to just go through and re-save all of our sequences with the ‘latest’ levels as context, but it’d be great to have a systemic solution anyway, since people may end up rebinding possessable references in the player anyway, so it would be wasteful to still cook whatever map the possessable referenced by default.

Cheers,

Geordie

Steps to Reproduce

  • Create a level called MapDontCook
  • Create a level sequence in that level, with possessables that references an actor from MapDontCook.
  • Copy that map as DefaultMap, but don’t re-save the sequence or anything.
  • Set DefaultMap as the game startup map, and add it as the only entry in the MapsToCook list of project settings too.
  • Cook the project, check the cook log or UFS manifest afterwards and observe that MapDontCook got dragged in due to the LevelSequence::BindingReferences DirectPathObjectLocator’s soft object path referencing it.

Hello Geordie,

Soft references are still pulled in for cooking. So, you’ll need to clean up the soft references to the maps if you don’t want those maps cooked.

I did some tests on my end to confirm this and to confirm this also happens without Sequencer in the mix. The test I did without Sequencer was a variation of yours:

  1. Create a map called MapDontCook
  2. Create a blueprint with a soft object reference and assign the value to an actor in MapDontCook
  3. Add that blueprint to MapDontCook
  4. Create a map called DefaultMap, add that blueprint to it
  5. Make DefaultMap the only map that is cooked (GameDefaultMap and list of maps to include in a packaged build)
  6. Cook and notice that it the log indicates MapDontCook is being pulled in.

Also, I found this related forum post as well:

There is an option you can pass to the cooker: -SkipSoftReferences but that looks to be only for debugging purposes. I tried to run it with your test case, but it gave me a few errors so I don’t think it’s a viable option. There’s documentation about it here:

https://dev.epicgames.com/documentation/en\-us/unreal\-engine/cooking\-content\-in\-unreal\-engine