Announcement

Collapse
No announcement yet.

Gameplay Tags Interface

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Gameplay Tags Interface

    Hey Hey!

    I'm trying to use EQS gameplay tag conditions versus some actors in my scene.

    The actors in the scene have a variable of the type "Gameplay Tag Container" and contain various tags imported from a data table in the project settings.

    My EQS check doesn't pick up these tags.

    I have noticed that IGameplayTags Interface needs to be added to the class defaults when querying using C++ but I cannot find that interface option when editing my class defaults of a blueprint actor or character etc.

    The tag system would infinitely help modulate my AI and query system where units need to query based on the tags of TypeAttack or TypeDefensem, rather than hierarchical queries containing search for actors of each child class MeleeDefender, RangedDefender, Griffon Defender.... although that seems where im heading if i can't get this game play tag interface to work.

    Please help!

    @agamedevguy twitter
    Renn Farnell Website

    #2
    Haven't used this before but I had a quick look at the source code:

    UINTERFACE(Blueprintable, MinimalAPI, meta=(CannotImplementInterfaceInBlueprint))
    class UGameplayTagAssetInterface : public UInterface
    Seems like you can't add it in Blueprints. Your best bet is to make a base class which all your AI inherits from in C++ and make sure that class implements the interface.

    Otherwise you could make an actor component instead of a base class if you need a more flexible system but I'm not sure if that would screw up any of the EQS stuff.

    Ultimately seems like you're going to need to use C++ to fix this.
    Blueprint Assist Plugin: Mouse free blueprint creation and quality of life features
    Auto Size Comments Plugin (FREE): Auto resizing comment boxes

    Comment


      #3
      Thanks for the reply!

      I think jumping into c++ to make a single child of character and then reparenting my current classes to that will be quick enough to get this system back on track.

      Cheers again i'll let you know if that works!

      @agamedevguy twitter
      Renn Farnell Website

      Comment


        #4
        Originally posted by fpwong View Post
        Haven't used this before but I had a quick look at the source code:



        Seems like you can't add it in Blueprints. Your best bet is to make a base class which all your AI inherits from in C++ and make sure that class implements the interface.

        Otherwise you could make an actor component instead of a base class if you need a more flexible system but I'm not sure if that would screw up any of the EQS stuff.

        Ultimately seems like you're going to need to use C++ to fix this.
        Hey again, I've just tried to create a C++ class which implements the interface but I get a bunch of errors, would you have a minute to look?

        Click image for larger version

Name:	tdeqs.JPG
Views:	1
Size:	129.8 KB
ID:	1124169

        @agamedevguy twitter
        Renn Farnell Website

        Comment


          #5
          I found this post:

          https://answers.unrealengine.com/que...-eqs-test.html

          They say it's as simple as "implementing the interface" but im unaware how to do this in c++.

          Most places seems to say you just add it after the class declaration, but i just get errors

          @agamedevguy twitter
          Renn Farnell Website

          Comment


            #6
            Click image for larger version

Name:	tdeqs2.JPG
Views:	1
Size:	123.7 KB
ID:	1124170

            This is what I would like to work in essence.

            Different AI may have different EQS ranges and rules around picking the furthest enemy or closest etc. But generally the tags is where time is saved, rather than repeatedly creating something likes this for every enemy i'd ever add to the game:

            Click image for larger version

Name:	tdeqs3.JPG
Views:	1
Size:	171.9 KB
ID:	1124171

            ^ Imagine this with different classes in each query as part of a single query, which at present is called somewhat often to keep enemies on track, but with the above implementation / workaround, wouldn't performance just tank?
            Last edited by RennJan; 03-01-2017, 01:55 PM.

            @agamedevguy twitter
            Renn Farnell Website

            Comment


              #7
              Originally posted by RennJan View Post
              I found this post:

              https://answers.unrealengine.com/que...-eqs-test.html

              They say it's as simple as "implementing the interface" but im unaware how to do this in c++.

              Most places seems to say you just add it after the class declaration, but i just get errors
              Go into the GameplayTagAssetInterface.h file, you can see where it's located here https://docs.unrealengine.com/latest...ace/index.html or by searching the solution explorer.

              You need to "implement" all the functions in that file by copy and pasting them them into your character's header file. Then let visual studio add them to your source file by hovering the function and pressing (ctrl+,).

              If it takes too long you might want to manually do it. Hopefully that should fix it.
              Blueprint Assist Plugin: Mouse free blueprint creation and quality of life features
              Auto Size Comments Plugin (FREE): Auto resizing comment boxes

              Comment


                #8
                I gave the C++ inheritance a shot but had no luck with EQS, i'm now able to call blueprints with the functions in the new character class but I was really looking to just make the EQS Gameplay Tags work!

                I used this shooter tutorial to give me more info for anyone with the same goal: http://shootertutorial.com/2016/09/2...-gameplaytags/

                For now, im a day or two behind my targets, so I'm just going to try creating new contexts, and see how I get on.

                I may post more info.

                @agamedevguy twitter
                Renn Farnell Website

                Comment


                  #9
                  SOLVED

                  Okay so, this is solved thanks to the helpful comments.

                  In order to get eqs tests working with gameplay tags:

                  1) Create a new C++ Character class.

                  2) Open the new Class and add Gameplaytags inclusion, a return / override for the setting of tags, and also a new variable to edit within blueprints:

                  Click image for larger version

Name:	EQS Fixed.JPG
Views:	1
Size:	65.4 KB
ID:	1124231

                  3) Open the ProjectName.Build.cs file and add "GameplayTags" to the modules:

                  Click image for larger version

Name:	EQS Fixed 2.JPG
Views:	1
Size:	41.4 KB
ID:	1124232

                  Click image for larger version

Name:	EQS Fixed 3.JPG
Views:	1
Size:	24.0 KB
ID:	1124233

                  Now in engine you will see this gameplay tags variable (which was added in C++, and when used with eqs, works!)

                  Click image for larger version

Name:	EQS Fixed 4.JPG
Views:	1
Size:	92.8 KB
ID:	1124234

                  You can edit this on construction or begin play, (setting in construction allows EQS test pawn to work for debugging queries)

                  Click image for larger version

Name:	EQS Fixed 5.JPG
Views:	1
Size:	20.6 KB
ID:	1124235

                  All you need is the local variable of a TagContainer in order for this to work - like so:

                  Click image for larger version

Name:	EQS Fixed 6.JPG
Views:	1
Size:	34.0 KB
ID:	1124236

                  Then you do the regular checking based on tags - https://www.unrealengine.com/blog/us...content-in-ue4

                  This is going to help a lot with the game i'm working on and I really appreciate the help, now my minions can focus certain types and not others, next step is scoring with prioritisation / order of tags in individual ownedtags arrays... this could potentially be a custom EQS test that I develop in C++ over the coming weeks.

                  I'll let you know how that goes

                  Best R

                  @agamedevguy twitter
                  Renn Farnell Website

                  Comment


                    #10
                    Wait.. is it still an issue? Is Add gameplay tag not working in blueprints?!
                    I have similar problem I have a gameplay tag container and it has a length of 0 no matter how many tags with what authority and how I add :/

                    Comment


                      #11
                      This was helpful for getting behavior tree decorators working with gameplay tags. I'm not sure why Rennjan has you declare both a gameplay tag container AND a gameplay tag. When I did my behavior tree stuff, it only recognizes the container version. Do I need the singular GameplayTag for anything or was Rennjan just using that to test with or compare old tags???
                      Consider supporting me on patreon

                      Weapon Master and VRE Merge TUT

                      Life Art Studios | Discord | End of Days - VR Zombie Survival

                      Comment

                      Working...
                      X