Description

Currently, using the string "None" as a hierarchical node identifier inside a Gameplay Tag (for example "A.B.C.None.D.E.F") is not disallowed by the engine, but results in some incorrect behaviors. Although NAME_None is treated as an invalid Gameplay Tag, the usage of "None" as just part of a Gameplay Tag could be handled better (or disallowed altogether).

Interestingly, the FGameplayTagNode hierarchy is built correctly in this case, with FGameplayTagNode::ParentNode being set as expected. However, FGameplayTagNode's constructor also builds the transient "ParentTags" array of its "CompleteTagWithParents" internal container, which is meant as a cache to accelerate parent searches, and this process gets interrupted midway because of the check "RawParentNode->GetSimpleTagName() != NAME_None".

With an incomplete "ParentTags" array, FGameplayTag::MatchesTag() and FGameplayTag::GetGameplayTagParents() return incorrect results, even though FGameplayTag::RequestDirectParent() always returns the correct result.

Steps to Reproduce

=== Repro Project ===

1. Run Editor Utility Widget "EUW_TestTags"
2. For "Tag", select tag "A.B.C"
3. For "Test Parent", select tag "A"
4. Note on the right side that:
    4.1. The tag is valid
    4.2. Its direct parent is correctly "A.B"
    4.3. Tag "A" is correctly identified as a parent
    4.4. The list of parents correctly lists 3 tags
5. Change "Tag" to "A.B.C.None.D.E.F"
    5.1. When selecting this tag, note that the editor UI does not check all expected boxes
6. Note on the right side that:
    6.1. The tag is valid
    6.2. Its direct parent is correctly "A.B.C.None.D.E"
    6.3. Tag "A" is not identified as a parent
    6.4. The list of parents is incomplete

=== Blank Project ===

1. Create a Gameplay tag "A.B.C.None.D.E.F"
2. Check that FGameplayTag::RequestDirectParent() works correctly for it
3. Check that FGameplayTag::GetGameplayTagParents() returns only 3 items instead of the 7 expected
4. Check that FGameplayTag::MatchesTag() incorrectly returns "false" for tag "A"

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-230806 in the post.

0
Login to Vote

Unresolved
ComponentUE - Gameplay
Affects Versions5.3.25.55.4.4
Target Fix5.6
CreatedNov 19, 2024
UpdatedDec 6, 2024
View Jira Issue