What are some of the best benefits of Gameplay tags?
In the past I’ve always used FName as a very flexible way to define modular things.
I might have a map of FName to some definition objects, or I might add FNames as tags to some objects in my world.
I’m seeing in Lyra they use Gameplay tags a ton in ways that I normally use FName. I find Gameplay tags a bit harder to work with and slight overkill for some of the things they use, but maybe I just don’t understand gameplay tags.
For example with FName, it’s really easy to use as a key in a Map for quick lookup of things by name. Also with Gameplay tags it’s hard to arbitrarily add new tags, and its harder to work with them in C++ since there’s some work involved in defining them. With an FName I can just write it in the code directly. As I understand Unreal turns FNames into integers under the hood anyway so it’s like working with highly optimized strings.
Gameplay tags can be cool as like a property bag of booleans, or in place of Reflection and object oriented programming. Like normally I might say, is this object of class Gun.
But if I don’t have access to a class I can check if it’s gameplay tag matches the query of Inventory.Equippable.Gun.
In Lyra I see they use gameplay tags basically everywhere, like the input system, the UI attachment locations, defining ability types. What’s the benefit of using a gameplay tag versus an FName, for example, when using it in the input system?