GameplayTags and tags

It seems that they have similar usage, so what’s the difference of gameplaytags and tags? Which should I choose in diffenrent situations?

tags: array variable in actor

gameplaytags : link text

Tags are just an array of FNames that each actor stores; you can put any FName into that array and then check whether an actor has a tag or not. Gameplay tags serve a similar purpose, except that (a) they support hierarchical names out of the box and (b) you define beforehand which gameplay tags you want to use and then use only tags from this set. (This is not entirely accurate, because you can dynamically define new gameplay tags, but I don’t think that is how they are supposed to be used.) Having a fixed, hierarchical set of tags means that the editor can provide better support for tags (you can pick them from a special widget), and you reduce the probability of debugging mysterious problems caused by a misspelled tag. Personally I use gameplay tags for a lot of things where I want something like an enumeration but with a bit more flexibility and extensibility, and this seems to work pretty well. I’ve written a bit more about this in this post.

However, gameplay tags are relatively new, and there are still a number of rough edges, e.g., currently actors provide no support for gameplay tags out of the box. So you have to spend some time implementing stuff that should be in the basic framework. Furthermore, there are a number of bugs in the gameplay tags implementation (for my use cases, this bug is particularly annoying), so unless you build your engine from source you won’t get all their benefits right now.

1 Like