StateTree Linked Asset override parameters issue

Hi,

We’re running into what looks like a StateTree crash around linked asset overrides on UE 5.7.4.

In a State Tree, we have a Linked Asset state that normally points to one child StateTree. At runtime, we override that linked tree through the tag-based override and point it to a different child tree instead (using StateTreeComponent::AddLinkedStateTreeOverrides) before starting the logic. On StartLogic() and each subsequent tick, we trigger this check:

[Image Removed]

From debugging, we observed that the crash came from a miss match in the parameters with the linked asset. The code seems to expect all the linked assets that can go in the same slot at runtime to have the same exact GUID for the properties in the UPropertyBag. If the original linked child and the override child were authored separately, even if they can look equivalent in the editor, they won’t match as the same internal bag or struct, which what the check is looking for. So, the only way to not trigger it is if the asset is a direct copy of the original asset linked in the parent State Tree, without never modified properties of ether after the duplication.

Is it the intended requirement that an override child tree must preserve the exact parameter bag of the originally linked tree, down to the hidden GUID, instead of translating the parameters automatically? If so, would it make more sense to add validation or at least a softer runtime failure here? It would be useful for us if the requirements would be more flexible and let us override link assets that aren’t copies of each other.

We may be misunderstanding how linked asset overrides are supposed to be authored, so any guidance would be appreciated.

Thanks!

[Attachment Removed]

Steps to Reproduce[Attachment Removed]

Hello!

When you mention parameters, are you referring to Global Parameters for the overridden Linked Asset tree? Or is this the Context data for the overriding StateTree? StateTree should have a check to ensure context data is compatible, and we recently fixed a bug in some of that logic that is included in 5.8.

If you are referring to the Global parameters for the linked asset, we have a tentative fix that is awaiting full QA testing, but it is available in 5.8 and Main. That CL can be found at CL 51198950. The current approach is to prevent overrides as there is more safety that needs to be put in place for a proper fix. Our goal was to prevent the check in editor and likely memory corruption in shipping builds.

-James

[Attachment Removed]

Yes, I’m talking about the global parameters of the Linked Asset StateTree. I did some a quick test in a virgin project in 5.8 preview and I saw that checks no longer trigger with that use case. So that is a good news.

I didn’t debug it fully, but it seems that all the global parameters are defined via the FStateTreeReference pass with the override. But I’m wondering if it could be possible to be more flexible and try to dynamically merge the global parameters for both sources, the override and the calling parent tree. I would expect the parameter of the same name and type to be compatible.

I would expect this case:

[Image Removed] [Image Removed] [Image Removed] [Image Removed]to result that Child2 to have both the values to be “TEST”, “(2,2,2)” and “42”, the override having priority.

I understand there would have a performance cost, it would be useful to not block the communication between the parent StateTree and it’s Linked Assset, while having the possibility of overriding these parameters.

[Attachment Removed]

StateTree uses a FGuid for the properties to match rather than FName or type. I don’t think we will attempt to auto-fix or match up with parameters as we have been battling issues around linked asset override parameters. If it is something you want to add, we would look at a PR, but it is not something on our roadmap to address currently.

-James

[Attachment Removed]