PCG Component Excluded from Cook Due to Parent Editor-Only Flag

Hi,

I’m reaching out for guidance regarding an unexpected behavior we encountered with PCG in our codebase. For reference, the issue reproduces with the vanilla PCG plugin integrated into our game codebase (no custom modifications to the plugin itself).

To manage our PCG inputs, we defined a base Blueprint class (BP_PCG_Base) where the actor and its components are marked as Editor Only. We then inherit from this base class to create various input Blueprints that contain our PCG graphs and parameters. The base class is shared between our runtime and editor tooling.

The issue is that our runtime tools were not functioning correctly, even though the child Blueprint classes met all the criteria to be included in the cooked build. The actors themselves were cooked, but the PCG components were missing. We verified the following:

  • The PCG graphs and subgraphs are not marked as Editor Only.
  • All Editor Only flags were unchecked in the child Blueprint classes.

However, the PCG component was only properly exported once we modified the PCG component on the parent class to remove the Editor Only flag.

This behavior was unexpected. We assumed the child Blueprint would override the Editor Only setting from the parent, but that does not appear to be the case. We’re trying to understand why modifying the parent class was required in order for the PCG component to be included in the cooked build.

Is this expected behavior regarding Editor Only flags and component inheritance in Blueprints, or is this potentially a bug?

Thank you for your help.

[Attachment Removed]

Hey Hugo,

I’ve brought this up with the gameplay team and they universally agreed that this approach is a “bad idea”.

The main issue here is the way how inheritance and serialization for Blueprints works, so if you have overridden components in a child BP the expectation is that there is a parent/archetype component to compare to. If that component is set to EditorOnly and stripped from the parent this doesn’t work correctly anymore.

So in general, no this is not intended to work and we expect there may be lots of possible issues and lingering problems with such a setup, so we definitely not recommend doing it this way.

Would it be an option for you to just mark the base class as abstract in the class settings?

It’s a bit unclear what your motivation for removing it is, but that would prevent it from being used/placed directly into the level and might have a similar effect.

Kind Regards,

Sebastian

[Attachment Removed]

Hi Sebastian,

It wasn’t our original intent to change the Is Editor Only flag, but we needed to do so in order to fix some bugs. I’d prefer not to go into detail about our internal workflows, as I don’t think that would be particularly relevant here.

I wasn’t previously aware of how the Blueprint serialization mechanism works, but your explanation makes sense now.

Thanks for taking the time to answer my question — I really appreciate it.

[Attachment Removed]