Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    I find that players walk through stairs as if they weren't there. I've got to be missing a setting. Does anyone have any ideas?

    Comment


      Originally posted by Dijon View Post
      I find that players walk through stairs as if they weren't there. I've got to be missing a setting. Does anyone have any ideas?
      Does the stair mesh have working collision geometry, has collision enabled and is blocking the PathTrace collision channel? It is probably one of those three things.

      Edit: Also, the Heightmap setting for BP_GridManager cannot be set to false if you want height differences between tiles.
      Advanced Turn Based Tile Toolkit (Marketplace - Support)

      Dungeon Crawler Toolkit (Marketplace - Support)

      Discord

      Comment


        All of the above look OK so there must be something fundamental that I'm missing. Thanks

        Comment


          Originally posted by Dijon View Post
          All of the above look OK so there must be something fundamental that I'm missing. Thanks
          Hmm, that is odd. A few things you can check: Import the mesh insto something like Epic's third person template and see that collision is working fine there. If that works try firing some debug line traces through the mesh and see if they are blocked. You can similarly enable debug displays for the traces used for generating the heightmap in ATBTT (the appropriate nested function in SetEdgesBasedOnTerrain in BP_GridManager) to see if they are blocked. Also, these stairs are placed in the level beforehand, right? If you spawn it during gameplay the walkability will not update unless you do so manually.
          Advanced Turn Based Tile Toolkit (Marketplace - Support)

          Dungeon Crawler Toolkit (Marketplace - Support)

          Discord

          Comment


            Hello and thank you for your amazing work! The toolkit is just great.

            I am trying to implement a combat system like the one that's in Divinity Original Sin 2, so:
            - there's no grid, but actors move freely
            - every action costs action points - be it moving or attacking
            - the turn sequence is based on individuals and not teams
            - the turn based combat begins on triggers (as I saw in your hybrid example)

            Can you please point me in the right direction? What are the blueprints that I need to modify for these customizations?

            Thank you in advance!

            Comment


              Originally posted by emmedand View Post
              Hello and thank you for your amazing work! The toolkit is just great.

              I am trying to implement a combat system like the one that's in Divinity Original Sin 2, so:
              Hi emmedand, I'm happy to hear that you're enjoying the toolkit! Divinity Original SIn 2 is one of my favorites as well. I'll do my best to answer your questions.

              Originally posted by emmedand View Post
              - there's no grid, but actors move freely
              Ok, so this is the most difficult one by far. The toolkit is built on an assumption that your game is grid based. There are things you can do to use ATBTT as a starting point and go in this direction, by modifying abilities to make use of the clicked location instead of the clicked tile, replacing RunPathfinding calls etc. with navmesh based approaches ++, but it would be a massive alteration of the toolkit. I'm not sure I can with good conscience recommend using the toolkit for a game not based on a grid. There are things you can do to disguise the grid. You can use a terrain actor instead of tile meshes to represent the world, remove grid indicators like the hover marker etc., but the game would still be grid based underneath. I hope this is still acceptable for your game.

              Originally posted by emmedand View Post
              - every action costs action points - be it moving or attacking
              This boils down to how you design your abilities. As a starting point, make a duplicate of BP_MoveAttack and set the MoveCostType variable to be "From Pathfinding Cost". Next set the move values of your units to 1 and their MaxAP and CurrentAP to some relatively high value. Also consider setting bUseEndsTurn to false in your abilities if you want to be able to move after attacking.

              Originally posted by emmedand View Post
              - the turn sequence is based on individuals and not teams
              Set the game mode of your map to BP_ATBTT_Initiative. This will set BP_TurnManagerInitiative as the active turn manager, which will order units in initiative based on the value of their Initiative variable.

              Originally posted by emmedand View Post
              - the turn based combat begins on triggers (as I saw in your hybrid example)
              Well, the code is all there in the example. What parts of it are you having trouble reproducing?
              Advanced Turn Based Tile Toolkit (Marketplace - Support)

              Dungeon Crawler Toolkit (Marketplace - Support)

              Discord

              Comment


                Thank you for your answer, Monokkel! It's of great help.

                Ok, so this is the most difficult one by far. The toolkit is built on an assumption that your game is grid based. There are things you can do to use ATBTT as a starting point and go in this direction, by modifying abilities to make use of the clicked location instead of the clicked tile, replacing RunPathfinding calls etc. with navmesh based approaches ++, but it would be a massive alteration of the toolkit. I'm not sure I can with good conscience recommend using the toolkit for a game not based on a grid. There are things you can do to disguise the grid. You can use a terrain actor instead of tile meshes to represent the world, remove grid indicators like the hover marker etc., but the game would still be grid based underneath. I hope this is still acceptable for your game.
                Yep, I guess that it can work. I'll try it!

                Well, the code is all there in the example. What parts of it are you having trouble reproducing?
                Actually none. I just mentioned it to give you a full overview


                Sounds great, I'll try to customize the blueprints as you suggested. Thanks again!

                Comment


                  Originally posted by emmedand View Post
                  Thank you for your answer, Monokkel! It's of great help.

                  Yep, I guess that it can work. I'll try it!

                  Actually none. I just mentioned it to give you a full overview

                  Sounds great, I'll try to customize the blueprints as you suggested. Thanks again!
                  Best of luck, and let me know if you have any additional questions!
                  Advanced Turn Based Tile Toolkit (Marketplace - Support)

                  Dungeon Crawler Toolkit (Marketplace - Support)

                  Discord

                  Comment


                    Hello Thank you for all your help so ran into another odd thing that is happening so if I move the gridmanger to any location other than 0 0 0 it makes it not work correct. is that correct?

                    Comment


                      Originally posted by Monokkel View Post

                      Ok, thanks for clarifying. Seems like I forgot to correct for the location of the grid in the experimental unit's SimulateMove function. Here is a version of the function where I've corrected for the grid's transform.

                      Less certain about your other issues, though, as I'm not able to replicate them. Do they still appear if you use BP_Unit_Anim_Ex instead of your own custom unit? Also, what is the precise height of the box the unit is climbing and where have you placed the ladder blueprint's 3D widget?
                      I think this might be a fix going to try and see if this works
                      Last edited by codeyhanson; 09-07-2020, 03:14 AM.

                      Comment


                        Originally posted by codeyhanson View Post

                        I think this might a fix going to try and see if this works
                        Ok I looked around to try to find out where to put this fix but im unable to find it im using the hybrid map if you could point me in the right direction so I can move that grid manager from 0,0,0 I just need to know where to put the fix sorry

                        Comment


                          Hello Monokkel.

                          I am trying to understand what I need to modify or create in terms of pathfinding in my game. You mentioned a video on pathfinding and edge costs at the very end of this one https://www.youtube.com/watch?v=r5j3...15jXKF&index=9 but I could not find it.

                          I have a Title type with a Boolean variable called Hindering (represented by the blue tiles in my screenshot). I want the pathfinding to stop movement on those tiles and not go beyond if you start from a regular tile. If you start from an hindering tile, you can go anywhere at half the speed.

                          The screenshots represents only a portion of the grid. The unit can move 4 squares in any directions. The first one shows the output of pathfinding from a clear tile. The second one shows the output of path finding if starting from a hindering tile on the second move command since the unit is half speed 4/2=2.

                          Any pointer on how to implement this would be greatly appreciated. I think I need to modify Search and Add Adjacent Tiles Custom 1 but you would save me time if you have a hint for me.

                          Thanks,
                          Chris

                          N.B. I made a mistake on screenshot 1. The unit can reach 14001 due to the diagonal entry but not beyond. Sorry.
                          Last edited by Christian Beauclair; 09-07-2020, 11:46 AM.

                          Comment


                            Originally posted by codeyhanson View Post

                            Ok I looked around to try to find out where to put this fix but im unable to find it im using the hybrid map if you could point me in the right direction so I can move that grid manager from 0,0,0 I just need to know where to put the fix sorry
                            Hi, seems like I forgot to convert from grid space to world space in one place in the experimental hybrid map. Sorry about that. This should hopefully fix things:


                            Originally posted by Christian Beauclair View Post
                            Hello Monokkel.

                            I am trying to understand what I need to modify or create in terms of pathfinding in my game. You mentioned a video on pathfinding and edge costs at the very end of this one https://www.youtube.com/watch?v=r5j3...15jXKF&index=9 but I could not find it.

                            I have a Title type with a Boolean variable called Hindering (represented by the blue tiles in my screenshot). I want the pathfinding to stop movement on those tiles and not go beyond if you start from a regular tile. If you start from an hindering tile, you can go anywhere at half the speed.

                            The screenshots represents only a portion of the grid. The unit can move 4 squares in any directions. The first one shows the output of pathfinding from a clear tile. The second one shows the output of path finding if starting from a hindering tile on the second move command since the unit is half speed 4/2=2.

                            Any pointer on how to implement this would be greatly appreciated. I think I need to modify Search and Add Adjacent Tiles Custom 1 but you would save me time if you have a hint for me.

                            Thanks,
                            Chris

                            N.B. I made a mistake on screenshot 1. The unit can reach 14001 due to the diagonal entry but not beyond. Sorry.
                            I am currently working on this problem. I will update this post when I have a solution.
                            Advanced Turn Based Tile Toolkit (Marketplace - Support)

                            Dungeon Crawler Toolkit (Marketplace - Support)

                            Discord

                            Comment


                              Originally posted by Monokkel View Post

                              Hi, seems like I forgot to convert from grid space to world space in one place in the experimental hybrid map. Sorry about that. This should hopefully fix things:




                              I am currently working on this problem. I will update this post when I have a solution.
                              Hello Monokkel.

                              thanks for looking into it. I am still a newbie when it comes to Blueprint but after some work I was able to achieve something. I just need to validate that this is a good approach if you don't mind. Attached are the modified Custom Pathfinding function in GridManager and the Move ability I use. I decided to make use of the SpecialEdges enum. The third attachment is my tile Begin Play. I just check if the tiles as a zero index specialedges that is of enum type Hindering.

                              That do you think?

                              Thanks,
                              Christian
                              Attached Files

                              Comment


                                Originally posted by Christian Beauclair View Post

                                Hello Monokkel.

                                thanks for looking into it. I am still a newbie when it comes to Blueprint but after some work I was able to achieve something. I just need to validate that this is a good approach if you don't mind. Attached are the modified Custom Pathfinding function in GridManager and the Move ability I use. I decided to make use of the SpecialEdges enum. The third attachment is my tile Begin Play. I just check if the tiles as a zero index specialedges that is of enum type Hindering.

                                That do you think?

                                Thanks,
                                Christian
                                Nice work! Pretty close to what I had in mind, though I would make a few adjustments.

                                So first what I did was to create a new integer Set in BP_GridManager which I called GridHindered, which holds the grid indexes of all hindered tiles.

                                Next I added a new type of GridObject which adds its index to the GridManager on BeginPlay:



                                I modify the Custom1 pathfinding type so that pathfinding search stops if it reaches tiles that are in the GridHindering set:



                                Lastly in the ability I am using I select pathfinding type based on if the index the owning unit is standing on is in the Hindering Set:



                                And there we are:

                                https://gfycat.com/scarcecourageouscreature

                                All in all pretty close to your implementation. I used a custom set instead of SpecialEdges, as SpecialEdges is designed to mark the edges between tiles as special, and not the tiles themselves. Also, although the way you modified the pathfinding function will work, it is not very performant. That particular function is potentially called a very high number of times during pathfinding, so it important to set it up so it does not do any unnecessarily expensive calls. You want to order the branches so that the ones that are most likely to be false are called first, which will usually be after the stored paths have been checked.

                                The reason I have not made the pathfinding tutorials yet is that I am in the middle of a refactoring which changes the pathfinding a bit. The current way of having to expand an enum and modify a function to add new pathfinding types is quite awkward, as is having to copy paste a lot of the standard pathfinding function each time you make a new pathfinding type. This is something I am fixing in the next update. It is mostly a change in organization, but the code looks visually quite different, so I did not want to make new tutorials only to have them be immediately outdated when the next update hits.
                                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                                Dungeon Crawler Toolkit (Marketplace - Support)

                                Discord

                                Comment

                                Working...
                                X