Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Hi eviltenchi, there isn't actually any spacing between the tiles (in terms of the undelying blueprint logic). The reason there seems to be spaces between the tiles is just because of the meshes I've chosen. Use flat planes for the default tiles or increase the scale of the Tile In Move Range and Tile In Sight Range meshes and you can lessen/remove the space between them.
    The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

    Comment


      Originally posted by Monokkel View Post
      It seems I forgot to add one thing to the Spawn Unit function. It actually has nothing to do with the grid anchors (so you can remove that bit). I'm guessing your grid manager is not placed at location 0,0,0? The reason you're having this issue is that the function is not taking the location of the grid manager into consideration when spawning units, and thus the function only works if the grid manager is zeroed out (I really should stop testing with the grid manager placed at 0,0,0 as I keep making this mistake :P ). Add this to the function to make it grid location agnostic:

      [ATTACH=CONFIG]56281[/ATTACH]

      To explain further the grid manager thinks the units are at one location, since the pathfinding and other functions are already made to take the Grid Manager's location into account. The Vector Field Arrray hold vectors that store the location of tiles relative to the grid, so when you spawn a unit directly from a vector from this array it will show up in the wrong place if the grid manager is not zeroed out.
      Thank you for the precious help, it works perfectly now.
      Fantasy Turn-Based Tactical Game
      STEAM: https://store.steampowered.com/app/9...Arcane_Legacy/
      IG: https://www.instagram.com/arcanelegacyofficial/
      FB: https://www.facebook.com/ArcaneLegacy/
      WEB: http://www.arcanelegacy.com

      Comment


        Originally posted by preetlove
        Good information dear.... thanks for share and am use it for sure.
        You're welcome!

        Originally posted by Wisdom-HELLy View Post
        Thank you for the precious help, it works perfectly now.
        Good to hear! Sorry that I missed it the first time.
        The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

        Comment


          @Monokkel - Do you have an ETA on when you release a 4.9 version? With the infinity blade collection released it looks like there are a lot of really nice assets that I would like to import into the tool kit to spice up the appearance.

          Comment


            That stuff looks awesome! They're a fantastic fit for the toolkit too! The next update is stille some ways to go, but just convert a 4.8 project to 4.9 and it should still work. There are some errors in the log, but they are inconsequential.
            The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

            Comment


              I've sent a minor update to Epic that makes the toolkit fully updated to 4.9. The 4.8 version worked fine in 4.9, but now it should give no errors in the log. The large content update is still being worked on. Here is the changelog of the new, minor patch:

              v1.43 (being processed by Epic)
              1. Changed all Set Visibility nodes of markers to Set Marker Visibility Functions to prevent an error in the log.
              2. Removed Clear all Instances from the Clear range array, reachable pawns array and path meshes collapsed graph in the Find Tiles in Range function in BP_GridManager to prevent an error in the log.
              3. Changed all Get World Location/Rotation And Distance Along Spline nodes to the newer Get Location at Distance Along Spline (with coordinate space set to “world”) nodes.
              4. Removed unnecessary cast in HUD_Faction_Turn and changed the name of Tile Spawner 2 to Grid Manager Ref to make it consistent with other blueprints.
              5. Replaced the landscape in the landscape example level as it was having some collision issues.
              The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

              Comment


                @Monokkel - Hi, I'm new to unreal and blueprint. When I bought the toolkit I was glad to be able to make a game in the genre that I love. Even my friends were interested and jealous. So far, I have been able to follow most of the things you taught in the tutorials.

                Right now, I am trying to make 3 custom blue prints but can't seem to grasp. I was wondering if you could help me. What i need is...

                1. A pickup or power up.
                2. When an AI dies they drop power up
                3. An AI that walks away from player unit in range.

                So far, I have made a health pickup that seems to respond when I step on it. However, I don't know how to get reference for current health or range, movement or damage so my pickup works as string only. Unfortunately, I don't know how to begin with the other 2. Here is the blue print I have so far. Could I ask for pointers?



                Click image for larger version

Name:	Pick_up_blue_print.png
Views:	1
Size:	618.7 KB
ID:	1087512
                Attached Files

                Comment


                  @deflip007:

                  There is quite a bit to explain for what you are trying to do and it all really depends on how you want to handle those power ups in the future.
                  If you would like to make a power up/heal/buff/debuff/etc the best thing to do is create the actor as you have done, but also attach that to a new Tile_Parent Child Blueprint so that you can reference it later for any AI logic. (Take a look at the page before this one for some more in depth explanation on how to reference those 'Consumable' type tiles.)

                  Apologies as I am not at home so I can not provide example screenshots, but hopefully this will help.

                  Originally posted by deflip007 View Post
                  1. A pickup or power up.
                  As far as this goes, the quickest and easiest way would be to create a new Custom Event on the Unit Parent called something like "Receive Heal" with a variable input for the Amount. Once you have done this, you will need to get 'Current Health', add the Amount, check that the new Current Health is not Greater than the Max Health, and set the new Current Health Value to either what has been added or the Max Health. Then inside the Power Up Actor, you will need to setup a reference to the GameMode so that you can get the 'Current Pawn'. When the event 'ActorBeginOverlap' is executed, you can call 'Game Mode' -> 'Current Unit' -> 'Receive Heal' and include the Amount that the Power Up will provide for healing.

                  Originally posted by deflip007 View Post
                  2. When an AI dies they drop power up
                  In the Unit Parent blueprint there is a 'Destroy Unit' handles the Death of the Unit. In this you will need to check if the Faction of the Unit is Equal to 'Enemy', if so, 'Spawn Actor' with the class dropdown selection of your power up blueprint. (Location will be the Current Pawn Index, which you will need to run through the Grid Managers 'Index to Vector' function)

                  Originally posted by deflip007 View Post
                  3. An AI that walks away from player unit in range.
                  This is quite complicated and will require a bit of math and other logic depending on how you want to handle this. When you use 'Find Tiles In Range' it creates an array called 'Pawns In Range Array'. Checking that can give you the Index and Distance of any enemy that is within the range you set for 'Find Tiles In Range'. The complexity here will be how to handle the actual movement of the AI. Will it be going away from the closest Player, but also away from all other player units that could be surrounding it? In which direction will the Unit go for each case will have to be handled independently. I would start with the 'Pawns In Range Array' and play around with what you find there.

                  Also, @Monokkel has created a lot of really great Blueprint Tutorials that I would highly suggest you watch!

                  Something along the lines of this
                  Click image for larger version

Name:	receive_heal.JPG
Views:	1
Size:	279.6 KB
ID:	1087607
                  Click image for larger version

Name:	receive_heal_2.JPG
Views:	1
Size:	97.2 KB
ID:	1087608
                  Last edited by EricCorso; 09-14-2015, 05:21 PM. Reason: Screenshots Added.

                  Comment


                    @ - isthisbad

                    Thanks so much for the help. Quick nube question. The Top pick is in the Unit parent and the bottom is in the actor blueprint? Also how to get the green ball nodes and custom event to have heal? I put an orange arrow in areas I don't know how to get.



                    Click image for larger version

Name:	receive_heal.JPG
Views:	1
Size:	254.6 KB
ID:	1087616

                    Comment


                      Hi deflif007, I replied to your question by e-mail yesterday and said I would reply in more detail on the forums when I had the time. I wrote a post earlier to day, but for some reason it doesn't seem to have been posted. Thanks for stepping in again, isthisbad! Great solutions as always. I'll write a new post where I take isthisbad's suggestions into account.

                      Making a receive heal event in Unit_Parent is probably the way I would have done it myself. This is pretty flexible since you can easily add things like healing powers from other units etc. now that you have a dedicated event. You might not need to run it through the game mode, though. Something simple like this does the trick:

                      Click image for larger version

Name:	Ihbtscz.png
Views:	1
Size:	73.8 KB
ID:	1087614

                      Here's a quick .gif of it in action.

                      For this to work, you need to make sure that you have collision enabled properly, though. I would enable collision of the skeletal mesh of all units, set their object type to WorldDynamic and enable generate overlap events. Then set both the WorldDynamic collision of the skeletal mesh and your powerup to overlap. The default units don't have collision enabled for performance reasons, but the impact is minimal unless you have vast amounts of units.

                      For AI units dropping powerups you could again do something like isthisbad suggested. You can again make it slightly simpler if you know that units will never be between tiles when they die (which never happens in the default toolkit), in which case you can simply spawn the powerup at the current location of the actor without running it through Index To Vector. It's also generally advicable to get an index from the Vector Field Array instead of using the "Index to Vector" functions, as it is agnostic to the grid type.

                      As isthisbad has mentioned and I mentioned in my e-mail, your third question is the trickiest bit by far. If you have a situation where you have complex terrain and multiple player to escape from you will need to know all possible paths for the next turn for all player units so that the AI can avoid them. This is not trivial to solve; especially if you want to avoid any drop in framerate. What I would probably do is to create a modified version of the Pathfinding function that initially adds the location of all player pawns within a reasonable distance of the AI to the open list. This way you would have a pathfinding that simultaneously spreads out from all candidate player units. You would run this for a fairly large move range (I think the movement range of the AI unit plus the movement cost between the AI and the closest player unit should be sufficient).

                      You would need this function to write to a different aray than CanMoveToArray so the two can be compared. The new array would function sort of like a threat map. You would then look at all locations that the AI can reach in one move from the CanMoveToArray and compare it to your new ThreatMap array. The AI should choose to move to the tile with the highest cost in the ThreatMap, as this would be the tile within the AI's reach that takes the longest for all player units to reach. That's the best solution I can think of currently. Like I said it's a pretty tricky thing to do, and there might be much easier ways to fake it if you need a less generic solution for a few specific scenarios.

                      edit: The green ball is a float output. You can add it to the custom event in the details tab like so:

                      Click image for larger version

Name:	DBTXnWY.png
Views:	1
Size:	79.1 KB
ID:	1087617

                      The second ball is a reroute node. You can place it by dragging out a float from an output and letting go anywhere in the graph editor. A dropdown appears where you can select "Add reroute node". The third is a simple float / float node.
                      Last edited by Monokkel; 09-14-2015, 06:27 PM.
                      The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                      Comment


                        @deflip007: I would definitely do it as @Monokkel suggested. Mine was just a quick pass to help you along the way, mostly trying to help you understand the relationship between blueprints

                        Little Awesome Trick: You can also add Reroute Nodes by double clicking any existing line

                        Comment


                          @ Monokkel & isthisbad - Thank you guys for helping .
                          I got it to work. The HP gauge kinda lags a bit but it does fill up.

                          Comment


                            Ok, great! What exactly do you mean by lag? Is the powerup destroyed and then it takes some time for the HP gauge to fill up or is it also destroyed later than you intend it to?
                            The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                            Comment


                              @ - Monokkel

                              Hello, sorry for delayed response. By lag, I mean that the health bar does not increase until somewhere between the AI's turn or the next player's turn.

                              Comment


                                @ Monokkel & isthisbad -

                                Thanks for the advice on the previous questions. Right now, I am trying to get a teleporter to work but so far all I have to go on is tutorials for 3rd person games. Do you guys have any suggestions to get this to work? So far, I have been using trigger boxes and target points to accomplish this. Also, the square Tile_empties like to sit on top of the trigger boxes. Is there a way to fix this?



                                Click image for larger version

Name:	teleport.png
Views:	1
Size:	616.1 KB
ID:	1087922

                                Comment

                                Working...
                                X