Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Originally posted by admlsnackbar View Post
    Nope, that is exactly what I'm going for! I reverted my changes and tried again, and this time it worked...there must have been a missing node connection somewhere

    Thanks for looking into it! I'm also starting to make some Status Effects, can you give me a quick explanation of how that system works (or point me to a tutorial somewhere?).

    Cheers!
    Great! As for status effects I haven't made a tutorial yet, but here is the rundown:

    Status effects are actors. They have an event called Activate that takes a unit as input. When it is called the status effect is added to a status effect array in the ability system component of the unit (it fails if the unit has no ability system component. If you're adding a status effect through an ability you can use the AddStatusEffect function in BP_Ability. If you want something to happen when the status effect is activated you will extend the Activate function in the child blueprint (remember to call the parent event first. Check out the mind controll status effect for an example).

    After this status effect has two main events you want to care about, which is the RunOnTurnStart and RunOnTurnEnd events. These are called as part of the RunOnActorBeginTurn/EndTurn events in BP_Unit, which are again called form the turn manager. Different turn managers call these at different times. BP_TurnManager and BP_TurnManager_Strategy call these for all units when a faction starts/ends its turn, while BP_Turn_Manager_Initiative call them when each individual unit is activated/deactivated.
    Advanced Turn Based Tile Toolkit (Marketplace - Support)

    Dungeon Crawler Toolkit (Marketplace - Support)

    Discord

    Comment


      Originally posted by Monokkel View Post

      Great! As for status effects I haven't made a tutorial yet, but here is the rundown:

      Status effects are actors. They have an event called Activate that takes a unit as input. When it is called the status effect is added to a status effect array in the ability system component of the unit (it fails if the unit has no ability system component. If you're adding a status effect through an ability you can use the AddStatusEffect function in BP_Ability. If you want something to happen when the status effect is activated you will extend the Activate function in the child blueprint (remember to call the parent event first. Check out the mind controll status effect for an example).

      After this status effect has two main events you want to care about, which is the RunOnTurnStart and RunOnTurnEnd events. These are called as part of the RunOnActorBeginTurn/EndTurn events in BP_Unit, which are again called form the turn manager. Different turn managers call these at different times. BP_TurnManager and BP_TurnManager_Strategy call these for all units when a faction starts/ends its turn, while BP_Turn_Manager_Initiative call them when each individual unit is activated/deactivated.
      Awesome, this worked like a charm! I was able to make Stun and Poison effects pretty easily, complete with FX.

      Next up is Traps. I've had some different ideas about how to implement them - as specialized Units, as Status Effects, or as an entirely new BP class. Do you have any thoughts on this? It seems like a new BP class is the way to go, with OnTriggered events being called from the Grid Manager when a unit enters the Trap's grid index or when a turn countdown expires, and giving the Grid Manager a new Grid Array (GridTraps).

      Comment


        Originally posted by admlsnackbar View Post

        Awesome, this worked like a charm! I was able to make Stun and Poison effects pretty easily, complete with FX.

        Next up is Traps. I've had some different ideas about how to implement them - as specialized Units, as Status Effects, or as an entirely new BP class. Do you have any thoughts on this? It seems like a new BP class is the way to go, with OnTriggered events being called from the Grid Manager when a unit enters the Trap's grid index or when a turn countdown expires, and giving the Grid Manager a new Grid Array (GridTraps).
        There is an example map with traps included in ATBTT. Check out Maps/Experimental/InterruptedMovement. They are a separate actor (based off BP_GridObject). They are a bit hacky in their current form, but I am working on improving them in the next update.
        Advanced Turn Based Tile Toolkit (Marketplace - Support)

        Dungeon Crawler Toolkit (Marketplace - Support)

        Discord

        Comment


          Hi,

          First of all, thanks so much for your recommendation a few months ago to try Steam Remote Play for my game. It was the perfect recommendation for what I needed and I got a beta on the Steam store

          I'm thinking of taking on a C++ project to build an AI for the game. I know there is functionality within ATBTT for AI but I want to learn C++ and need to build something more complex. Couple questions:

          1) Is my assumption correct that I would be able to build a more powerful AI in C++? (obviously will also require much more work)

          2) AFAIK, for the program to be able to capture the game state, my whole project (maybe just part of my project?) would need to be represented in C++, so do you know if there is a reliable way to convert from blueprints? Or any other ideas you have here could be helpful.

          3) Alternatively, if I didn't need to convert my whole project to C++, from what I understand, I can add C++ elements to the blueprint project, and I just wanted to make sure that was also correct.

          Thanks, and hope you're well

          Comment


            Originally posted by behappyandsm1le View Post
            Hi,

            First of all, thanks so much for your recommendation a few months ago to try Steam Remote Play for my game. It was the perfect recommendation for what I needed and I got a beta on the Steam store
            Happy to hear that! Feel free to post a link

            Originally posted by behappyandsm1le View Post
            I'm thinking of taking on a C++ project to build an AI for the game. I know there is functionality within ATBTT for AI but I want to learn C++ and need to build something more complex. Couple questions:

            1) Is my assumption correct that I would be able to build a more powerful AI in C++? (obviously will also require much more work)
            Yes and no. The great benefit of C++ is of course speed. For a lot of stuff that much speed is unneeded and blueprints work just fine, but AI is one of those things that can get really resource heavy depending on what you want to do. So if you are designing the kind of AI that will be doing a very large number of calculations in a very short time C++ will let you do more.

            Originally posted by behappyandsm1le View Post
            2) AFAIK, for the program to be able to capture the game state, my whole project (maybe just part of my project?) would need to be represented in C++, so do you know if there is a reliable way to convert from blueprints? Or any other ideas you have here could be helpful.
            If all you want C++ for is your AI, then all you need to expose to C++ is whatever your AI will be using. You likely want access to the grid arrays such as GridLocations, GridEdges etc. as well as pathfinding, LoS etc. But you probably don't need access to how you are animating your units, for instance.

            Your C++ code will not be able to access variables you have declared in blueprints (without a lot of awkward workarounds), so you would want to create C++ versions of the classes you want to access in C++ and reparent their respective blueprint classes to these new classes. Then you would define any variables you need to access in the C++ version of the class and replace any references to the old blueprint variables with the new C++ variables.

            I have already converted many of the resource heavy blueprints such as these to C++. I can share them with you if you are interested. Be aware that implementing it will take some work, though.

            3) Alternatively, if I didn't need to convert my whole project to C++, from what I understand, I can add C++ elements to the blueprint project, and I just wanted to make sure that was also correct.

            Thanks, and hope you're well[/QUOTE]

            Indeed you can. It is absolutely possible to combine C++ and blueprints in a UE4 project. Epic does this for all their internal projects and blueprints were designed with this in mind.
            Advanced Turn Based Tile Toolkit (Marketplace - Support)

            Dungeon Crawler Toolkit (Marketplace - Support)

            Discord

            Comment


              Hey, so im posting in here in response to my recent comment on the ue4 marketplace about the hybrid units with the attachment issues. To describe why this would be necessary for the my game-the game functions in exploration with a third person camera but for a party of 4 user controlled players. I am setting it up so that you can switch between the four to which you are controlling and which 3 are set to follow (think similar to wasteland except the non combat camera is closer in).

              Another question I have- i am setting it up so that movement and attacks are using the same action points resource. The idea here is that if an attack costs 2 ap and you have 4 ap then you can attack twice with that one unit in the same turn. However I'm having trouble finding where exactly it calls the units turn to end on an attack. Ie by solving this i am in hopes that I can have it so that you could potentially with enough ap have a turn with one unit that goes- Attack, Move, Attack.

              Lastly as a suggestion (idk if you take them but i think it would be really great for this kit) - the only thing that feels like a disconnect between this kit and many games that emulate it are that you can't tell when a movement will put you in range of an attack. I suggest something similar to wasteland 3 where a line draw is made between a tile that is hovered over and a unit that is in range of an attack. I will try to come up with something for that as follows (and correct me if there's a better way with this kit's setup): in the hover over tile function during movement- get the current units array of abilities. Check this array of abilities for each ones range. Take the highest value and draw a line from the tile hovered over to all units within that range. (might have to separate out abilities cast to enemies and allies and draw out green and red lines respectively)

              Comment


                Originally posted by Toad N11 View Post
                Hey, so im posting in here in response to my recent comment on the ue4 marketplace about the hybrid units with the attachment issues. To describe why this would be necessary for the my game-the game functions in exploration with a third person camera but for a party of 4 user controlled players. I am setting it up so that you can switch between the four to which you are controlling and which 3 are set to follow (think similar to wasteland except the non combat camera is closer in).
                Hi Toad, this should do the trick:


                Originally posted by Toad N11 View Post
                Another question I have- i am setting it up so that movement and attacks are using the same action points resource. The idea here is that if an attack costs 2 ap and you have 4 ap then you can attack twice with that one unit in the same turn. However I'm having trouble finding where exactly it calls the units turn to end on an attack. Ie by solving this i am in hopes that I can have it so that you could potentially with enough ap have a turn with one unit that goes- Attack, Move, Attack.
                All the default abilities call the SignalAbilityExecuted event after they have been used. This in turn calls RunAfterAbilityExecute in the TurnManager, which by default ends the current unit's turn if it has 0 AP remaining. Abilities have a bool called bUseEndsTurn which causes AP to be set to 0 no matter how many remain if PayAPCost is called. You would naturally want to set this to false for your ability. Also setting MoveCostType in the ability to FromPathfindingCost will cause the AP cost when moving to be determined by the cost of moving to a tile (this can be overridden in abilities). Hope that is enough to get you started.

                Originally posted by Toad N11 View Post
                Lastly as a suggestion (idk if you take them but i think it would be really great for this kit) - the only thing that feels like a disconnect between this kit and many games that emulate it are that you can't tell when a movement will put you in range of an attack. I suggest something similar to wasteland 3 where a line draw is made between a tile that is hovered over and a unit that is in range of an attack. I will try to come up with something for that as follows (and correct me if there's a better way with this kit's setup): in the hover over tile function during movement- get the current units array of abilities. Check this array of abilities for each ones range. Take the highest value and draw a line from the tile hovered over to all units within that range. (might have to separate out abilities cast to enemies and allies and draw out green and red lines respectively)
                Thanks for the suggestion. I actually had that feature in some earlier versions, where a crosshair showed up next to the health bar of enemies that could be attacked from a tile. It got removed during a refactoring, but it is something I'll put on the list of things to add back in the future.
                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                Dungeon Crawler Toolkit (Marketplace - Support)

                Discord

                Comment

                Working...
                X