Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Hey Knut, currently attacks are only processed when clicking directly on the ground tile - I was figuring out how you can redirect the click event from the clicked actor/unit mesh to the tile.
    It Seems to work for now - but I was wondering wether this is a legit solution for this case?

    Added a custom click notification event to BP_Ability_Attack that communicates the grid index of the clicked unit to the event ServerInteract.
    And in the BP_Unit (in our case the character which is a child of the unit) I added this logic to find out wether we clicked on an enemy during a user controlled player's turn.

    Comment


      Originally posted by Dan.Ott View Post
      Hey Knut, currently attacks are only processed when clicking directly on the ground tile - I was figuring out how you can redirect the click event from the clicked actor/unit mesh to the tile.
      It Seems to work for now - but I was wondering wether this is a legit solution for this case?

      Added a custom click notification event to BP_Ability_Attack that communicates the grid index of the clicked unit to the event ServerInteract.
      And in the BP_Unit (in our case the character which is a child of the unit) I added this logic to find out wether we clicked on an enemy during a user controlled player's turn.
      Your solution should work, but I have a simpler one that you might prefer. You can change the CheckHoveredLocation function in BP_AbilityBase so that it also checks for units before it checks for tiles. You will need to enable collision for the meshes of units first (they should not block PathTrace, RangeTrace, CoverTrace or WallTrace). This channel also needs to be one that GridManager blocks. Then in CheckHovered location, change the TraceChannel from PathTrace to the new trace channel you are using. This should work well unless you have units with meshes that extend beyond the area of the tile they are positioned on.
      The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

      Comment


        Originally posted by Monokkel View Post

        In other news I've played around with creating a hybrid Real Time Third Person/Turn Based Strategy mode. I'll probably include this in the Experiemntal folder for the next update. I got inspired by Dan.Ott 's project and wanted to see what I could cook up. Still a ways to go, but what I've got is already pretty fun, I think. Take a look!


        Hey, all. Long time reader, first time poster. I'm still wrapping my head around ATBTT, but I'm loving it so far. I'm writing regarding the new hybrid move as referenced above.

        I don't seem to have the hybrid folder in my maps/experimental folder. Did it not make it into the latest release?

        Just spent the last couple days reading through (most!) of the messages on this epic thread.

        Keep up the great work!

        Comment


          Originally posted by PaulBellow View Post

          Hey, all. Long time reader, first time poster. I'm still wrapping my head around ATBTT, but I'm loving it so far. I'm writing regarding the new hybrid move as referenced above.

          I don't seem to have the hybrid folder in my maps/experimental folder. Did it not make it into the latest release?

          Just spent the last couple days reading through (most!) of the messages on this epic thread.

          Keep up the great work!
          Hey Paul! If you've read through most of the messages I think you can safely call yourself a long time reader! We're just one page away from 200 at this point

          Make sure that you have the most recent version installed. The hybrid map can be found in Maps/Experimental/Hybrid.
          The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

          Comment


            Originally posted by Monokkel View Post

            Hey Paul! If you've read through most of the messages I think you can safely call yourself a long time reader! We're just one page away from 200 at this point

            Make sure that you have the most recent version installed. The hybrid map can be found in Maps/Experimental/Hybrid.

            Learned quite a bit reading, I must say!

            Okay, I haven't updated to 4.23 yet, so it was downloading an older version, I think. I grabbed the 4.23 engine version and it has the hybrid folder.

            Thanks!

            Comment


              Thanks for this amazing tool, Knut, it's been fun looking through your blueprints the last few days. I'm mostly interested in just using the hex grid system and pathfinding, not so much the turn-based aspect. Is there a way to have the AI-controlled units all take their turns at the same time (or with minimal delay between turn starts) rather than waiting for each enemy to move to it's position one-by-one? I'm also wondering if there's a simple way to have AI-controlled units pathfind towards a goal rather than only to their nearest enemy unit (pathfinding towards a flag or zone for example).

              Basically I'm hoping to have a hex grid with one AI faction marching towards an end-zone, and another AI faction trying to stop them. I realize this isn't the purpose of your pack but it's the closest marketplace asset I can find. Thank you for any insight you can give me!

              Comment


                Originally posted by PaulBellow View Post


                Learned quite a bit reading, I must say!

                Okay, I haven't updated to 4.23 yet, so it was downloading an older version, I think. I grabbed the 4.23 engine version and it has the hybrid folder.

                Thanks!
                As long as you're aware that some of the older suggestions in this thread might not be ideal in the newer versions there is hopefully a lot to learn in this thread. Glad you found the hybrid folder. Hope it helps you add the feature you want.

                Originally posted by paulbeaudry View Post
                Thanks for this amazing tool, Knut, it's been fun looking through your blueprints the last few days. I'm mostly interested in just using the hex grid system and pathfinding, not so much the turn-based aspect. Is there a way to have the AI-controlled units all take their turns at the same time (or with minimal delay between turn starts) rather than waiting for each enemy to move to it's position one-by-one? I'm also wondering if there's a simple way to have AI-controlled units pathfind towards a goal rather than only to their nearest enemy unit (pathfinding towards a flag or zone for example).

                Basically I'm hoping to have a hex grid with one AI faction marching towards an end-zone, and another AI faction trying to stop them. I realize this isn't the purpose of your pack but it's the closest marketplace asset I can find. Thank you for any insight you can give me!
                Hey Paul, good to hear you're having fun with the toolkit. As you've guessed the kit isn't really geared towards the sort of game you're describing, but you can hopefully make use of some of the features nonetheless. You would of course throw away the turn system and probably scrap the ability system for your own implementation.

                The general grid logic would of course still be using (storing and accessing data on the grid). Stuff like pathfinding and visibility gets more tricky, though. The included blueprint implementations for this are not performant enough that I would recommend using them if you are to use them multiple times a second for multiple units at the same time.

                For a real time game I'd recommend rewriting the RunPathfinding, GetIndexesInRange and FindTilesInRange functions in C++, as you would likely need the performance boost for your game. You can leverage a trick to improve performance if all your AI units are heading towards the same goal, though. In that case you can run pathfinding in reverse, with the start index at the target. You run the pathfinding to a large enough distance that it reaches all the units heading towards the same target, and they all use the same pathfinding graph to navigate towards it. You can then rerun the pathfinding periodically (perhaps as often as the shortest time it takes a unit to move from one tile to an adjacent one). If your game as multiple targets this becomes less and less viable, though.

                In the default toolkit it is simple enough to make it so the AI has targets other than enemy units. You would search for these custom targets in a similar way that units are searched for, perhaps using the GridObjects TMap instead of GridUnits (though this can be used as well if you targets cannot be occupied by a unit). However, as mentioned I don't believe the ability system is a good choice if you have multiple units acting at the same time

                Hope my answer made sense. The summary is that you can use some of the features, but be prepared to tear a lot of stuff out and rebuilding a lot from scratch.
                The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                Comment


                  Originally posted by Monokkel View Post

                  As long as you're aware that some of the older suggestions in this thread might not be ideal in the newer versions there is hopefully a lot to learn in this thread. Glad you found the hybrid folder. Hope it helps you add the feature you want.



                  .
                  Yeah, I was confused at first because of the older documentation videos, but I'm starting to wrap my head around your system. I just started learning UE4 about six weeks ago, so just hearing you explain things from the older version helped out some. I was more just curious about the hybrid feature. I think I'm gonna go the route with an overland map that pops open smaller battle levels kinda like Forged of Blood.

                  I'm a LitRPG author working on ways to tie books into games.

                  This is about how far I got with your toolkit so far...

                  https://www.youtube.com/watch?v=QUjmKm494Dk

                  This is my first UE4 project that's just about done. While waiting on beta tester feedback, I'm thinking about my next project which will be turn-based likely.

                  https://www.youtube.com/watch?v=SZuYAr_gE-M

                  Thanks again.

                  Comment


                    I haven't checked in for some time and I'm curious if there's been a fix for the bug where killing a unit with overwatch never ends the turn.

                    Comment


                      Originally posted by MercJones View Post
                      I haven't checked in for some time and I'm curious if there's been a fix for the bug where killing a unit with overwatch never ends the turn.
                      Hey, long time no see! This has indeed been fixed. A couple of updates ago I added a new way to insert new actions into the ongoing action queue, which was a good fit for the overwatch ability. The ability is currently residing in the Experiemental folder, though it should be ready for primetime.
                      The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                      Comment


                        Hi Monokkel,

                        I just started with ue4 and im still going through your tutorials. A lot of questions came to my mind but right now I´d like to ask something general.

                        In general I´m wondering if it would be possible to trigger the turn based aspect only when we have spotted an enemy or if an enemy has spotted us - would that be complicated?

                        On the other hand I thought about MouseOverEvents - how can I tell the engine that something should happen when I hover my mouse over a hostile pawn? (I currently have no idea how to match the mouse location with the pawn I am for example aiming at)

                        Another idea was an inventory for the pawns and one inventory for the map. For the pawn inventory I´d have to store which pawn holds which items, right? And for the map inventory I´d have to store which items are dropped by slain pawn on the specific grid location, right? Futhermore I would use functions like Add Object and Remove Object from the Grid Manager to get it working, wouldn´t I?

                        Looking forwad to your reply.

                        Comment


                          Hi Monokkel,

                          I was wonder what manager in the toolkit handled the attack selection. To be more clear, after you move when it highlights red to attack a target i was wondering what handled that as i need it to identify this elemental weakness I've implemented into my project, so when it finds a unit it'll know what unit type it is as tagged through an enum.

                          Thanks, EagleEyeGamma.

                          Comment


                            Originally posted by freeman4882 View Post
                            Hi Monokkel,

                            I just started with ue4 and im still going through your tutorials. A lot of questions came to my mind but right now I´d like to ask something general.

                            In general I´m wondering if it would be possible to trigger the turn based aspect only when we have spotted an enemy or if an enemy has spotted us - would that be complicated?
                            Not that complicated, no. Take a look at the "Hybrid" example map in Experimental. In this map the game switches between turn based top-down and real-time third person when the player enters a trigger or ends a combat. Instead of using a box trigger you can implement whatever code you want for an enemy spotting the player.

                            Originally posted by freeman4882 View Post
                            On the other hand I thought about MouseOverEvents - how can I tell the engine that something should happen when I hover my mouse over a hostile pawn? (I currently have no idea how to match the mouse location with the pawn I am for example aiming at)
                            You can use abilities for this. Make sure to look through my ability system tutorials to understand this better. In all abilities there is a Server Hover event, which includes a reference to the tile being hovered over. Within this event you can check the GridUnits TMap in BP_GridManager for enemy units and run whatever code you want if this returns true.

                            Originally posted by freeman4882 View Post
                            Another idea was an inventory for the pawns and one inventory for the map. For the pawn inventory I´d have to store which pawn holds which items, right? And for the map inventory I´d have to store which items are dropped by slain pawn on the specific grid location, right? Futhermore I would use functions like Add Object and Remove Object from the Grid Manager to get it working, wouldn´t I?
                            There are many ways to do this, sure. For individual items you could create an inventory array in BP_Unit (or whatever derived blueprint you are using as a base for your own units), or create an inventory component similar to the ability system one. Or you could store it all in a data table. Depends on the requirements of your game, really. For storing stuff on the map you can take a look at the HydrasLair example map, where I do just this (using Add/RemoveObject as you suggest).

                            Looking forwad to your reply.[/QUOTE]
                            Originally posted by EagleEyeGamma View Post
                            Hi Monokkel,

                            I was wonder what manager in the toolkit handled the attack selection. To be more clear, after you move when it highlights red to attack a target i was wondering what handled that as i need it to identify this elemental weakness I've implemented into my project, so when it finds a unit it'll know what unit type it is as tagged through an enum.

                            Thanks, EagleEyeGamma.
                            This is done within the abilities. Check out BP_Ability at the PlayerActivate event to see how the ability searches for nearby units and display them. When the ability loops through these units and place markers you could add a check that looks up their elemental weakness enum and places a custom marker based on the value. You would probably want to do this by overriding some of the PlayerActivate code in a derived ability blueprint.
                            The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                            Comment


                              Going to start looking into pathfinding performance next week. Need it faster for very long movement like 18-24 tiles and also perhaps moving multiple units at once.

                              Going to look into nativization first and was wondering if there are any known issues with it?

                              After that i will look at a full remake in C++ then if thats still not fast enough a completely new method for pathfinding.

                              Comment


                                Originally posted by elec2ron View Post
                                Going to start looking into pathfinding performance next week. Need it faster for very long movement like 18-24 tiles and also perhaps moving multiple units at once.

                                Going to look into nativization first and was wondering if there are any known issues with it?

                                After that i will look at a full remake in C++ then if thats still not fast enough a completely new method for pathfinding.
                                Have you run into performance issues or are you anticipating future issues? 18-24 tiles should be well within what the toolkit has been designed for. If you have encountered performance problems make sure you are testing in a packaged project. Blueprints run significantly faster in a packaged project compared to playing in editor.

                                If you do need a performance boost, blueprint nativization does not play well with the toolkit's pathfinding. This is due to Engine issues with blueprint structs and TMaps. The best approach is generally to manually convert what you need to C++ in any case. The good news is that I've already done this for many of the toolkit's expensive functions. So when you need it let me know and I'll format the code and share it.
                                Last edited by Monokkel; 10-11-2019, 12:36 PM.
                                The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                                Comment

                                Working...
                                X