Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    @Ariegos: Sure! That is what I've done in the 2D game example that was included in the last update. Here I used UE4's built in tile map, but importing an image file should not be a problem. However I'm not sure if you will be able to generate the appropriate collision for each tile using Campaign Cartographer, though I do not know the software. With the built in tile map I was able to only set the collision of walkable tiles to block PathTrace and in this way generate walkability automatically. I also used a similar trick to block visibility for walls. I think Tiled works well with Unreal Engine and can be set up with separate collision for each tile. Not sure with Campaign Cartographer, though. Worst case is that you will have to place invisible walls manually.

    @Rob3342421: Looks mostly right except you are checking if an attack is a hit by comparing the accuracy of the attacking unit to its own dodge value instead of the dodge value of its target. You should be able to drag a pin from the blue reroute node you have marked on the left (which gets its input from the Attack Target custom event) and find the dodge value of the target by searching for "dodge".
    Advanced Turn Based Tile Toolkit (Marketplace - Support)

    Dungeon Crawler Toolkit (Marketplace - Support)

    Discord

    Comment


      Glad to hear you got your Vive! I have really enjoyed using mines and can't wait to see how you implement the Vive controllers into this template.

      When I get home I am going to see how easy it is to add the Vive's controller support to the current version. Being able to select and aim where you want the units to go will really make my project feel more like a board game.

      Comment


        It's an impressive piece of tech! I have both the DK1 and DK2 as well, but the addition of roomscale and motion controllers takes it to another level. Getting the toolkit working with touch controllers is not very difficult and it does indeed feel like a living board game. If you run into any obstacles just ask me in this thread. It is still quite a while until my next update is ready for prime time.
        Advanced Turn Based Tile Toolkit (Marketplace - Support)

        Dungeon Crawler Toolkit (Marketplace - Support)

        Discord

        Comment


          Originally posted by Monokkel View Post
          @Rob3342421: Looks mostly right except you are checking if an attack is a hit by comparing the accuracy of the attacking unit to its own dodge value instead of the dodge value of its target. You should be able to drag a pin from the blue reroute node you have marked on the left (which gets its input from the Attack Target custom event) and find the dodge value of the target by searching for "dodge".
          Okay that has sorted it however after playing, it seems that units cannot get a hit, this effectively breaks the combat as it makes it impossible. It may need more work but I think it is technically working, it simply means that every attack is a miss. The only thing that comes to mind is that the variables of dodge and accuracy have to be set to the units? I am unsure if that is the issue but it's is what comes to mind.

          EDIT: I have found the accuracy and dodge variables in the unit details. After setting these to numbers, it is possible to attack units ingame. (I'm glad I was right, makes me feel good to fix this myself, sorry to waste time).
          Last edited by Rob3342421; 05-11-2016, 05:02 AM. Reason: solved!

          Comment


            small spelling mistake

            Hi just a heads up, I found a spelling mistake in the description of trace for walls automaticalle instead of automatically Click image for larger version

Name:	2016-05-11.png
Views:	1
Size:	266.8 KB
ID:	1106228

            Comment


              Regarding Vive support, it appears using a separate camera pawn instead of the template's grid camera is the best way to go.

              Since I am rusty on blueprints I am going to go read up the section in the official tutorial on how to implement a pawn for Vive motion controls.

              If you could give us an example of how you have the Vive pawn interacting with the template's blueprint that would be greatly appreciated!

              Comment


                @Rob3342421: Glad you figured it out! The way I suggested it each unit can have its own accuracy and dodge, as I feel is most common in games. Values should be between 0-1 representing chance of hitting and chance of dodging a hit respectively. Thanks for noting my spelling mistake. I'm sure there are many more in the toolkit, though.

                @Gugenheimer: I have used a separate pawn myself. I would suggest following Epic's tutorial on their wiki (which is what I did) here. I used the official vive motion controller meshes which can be found in SteamApps/common/OpenVR/resources/rendermodels/

                Below is my solution for touch controls at present. Note that this is something I have quickly hacked together and it is unlikely that it will look like this in the next update. It does seem to work well, however. The general idea is to send a line trace from the motion controller and have the toolkit count any tile hit by the trace as if the tile was hovered over or clicked by the mouse.

                In my VR pawn I run a line trace in the PathTrace channel every tick with a debug draw as a sort of laser pointer. If it hits something blocking PathTrace I run it through Vector to Index 3D to find the corresponding tile index and feed it to my custom Vive Hover event in ATBTT_PlayerController. Pressing the trigger does something similar, though it does not draw a debug line and instead fires the Vive Touch event. In the future I will probably want to check if BP_GridManager is actually hit before running the Vector to Index function as I do not want to run such a function every tick if it is not necessary.

                Click image for larger version

Name:	IBEPow2.png
Views:	1
Size:	322.7 KB
ID:	1106287

                The additions to ATBTT_PlayerController are very simple and are as follows:

                Click image for larger version

Name:	SVKWEV4.png
Views:	1
Size:	169.7 KB
ID:	1106288

                Click image for larger version

Name:	5wJajVJ.png
Views:	1
Size:	254.6 KB
ID:	1106289

                They are located at the end of the Mouse Input comment bubble and at the top left part of the Display path on hover comment bubble respectively.

                That's pretty much all there is too it for getting the basics working. There is lots of tweaking to be done, of course, but this is enough to get your virtual board game to come to life. I hope you find implementation easy and I'm looking forward to seeing what you make!
                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                Dungeon Crawler Toolkit (Marketplace - Support)

                Discord

                Comment


                  Thanks for the tips! I won't be able to get back into my project until this weekend but can't wait to get this implemented.

                  Comment


                    Your toolkit is amazing! One question - is it possible to make free unit selection instead of initiative-based, via next faction turn selection after previous faction ends its turn, for example? Thanks!

                    Comment


                      [MENTION=14416]Gugenheimer[/MENTION]: Best of luck!

                      [MENTION=433832]Waldesfray[/MENTION]: I'm not sure if I understand you correctly, so correct me if I'm wrong. Units can already be selected freely if the Can Player Switch Pawns public boolean in BP_GridManager is set to true. You can also split initiative into factions by making sure that all factions have initiative values in ranges that do not overlap. But maybe you mean that you want to want to prevent the toolkit from automatically selecting a new unit when a unit has ended its turn? This can be changed by removing the Activate Unit call from the End Unit Turn part of ATBTT_PlayerController. The only problem with this is that your turn will not end even if all your units have acted so you need to add a few nodes. Here is my solution to that problem:

                      Click image for larger version

Name:	ASomOIJ.png
Views:	1
Size:	222.6 KB
ID:	1106394
                      Advanced Turn Based Tile Toolkit (Marketplace - Support)

                      Dungeon Crawler Toolkit (Marketplace - Support)

                      Discord

                      Comment


                        Thank you very much! This solution partially solves my problem
                        I tried to adapt the game for situation, when the players act against AI, and generate common strategy each turn, so the main idea is to let hot-seat players choose the next acting player (faction) manually (via GUI) inside each phase of combat, as if their initiative was equal.

                        Comment


                          I got my rendering issues squared away. I can see the laser pointer from the vive controller however the pawn's path only goes to where the camera looks.
                          Last edited by Gugenheimer; 05-14-2016, 10:16 PM.

                          Comment


                            I was going through tutorial 6, Adding New Features and when I add destructible trees, they fall through the floor when I blow them up. Any ideas what causes it? Perhaps Unreal added a new setting.

                            Edit:
                            I think I've figured it out. When Default Tile Object is set to Instanced Static Mesh, the destructible mesh falls through the terrain, Static Mesh works fine.
                            Last edited by Ariegos; 05-15-2016, 01:14 AM.

                            Comment


                              One more question about the tutorial 6 video. At 33 mins 54 secs, you do a Split Struct Pin command on the Set Array Elem function, which gives you Item North, Item East, Item South, etc.

                              When I do it I get Item Edge Array Tile, so I don't know what to do next.

                              Click image for larger version

Name:	gbe9sds.png
Views:	1
Size:	164.6 KB
ID:	1106467

                              Comment


                                @Gugenheimer: Odd. Where the camera is looking should not make any difference. Maybe I've forgotten one small detail when giving you the solution. Try troubleshooting the issue by using Print Stings along the chain of nodes. Check if the custom event is actually being fired when you click the trigger, check what the location of the trace hit is etc. This is the way I do it myself when trying to find what is wrong. It is probably some very small thing since you've got most of it working.

                                @Ariegos: Some of my tutorial videos are a bit outdated because of the new update. This is one of the videos where this is particularly apparent as I have changed how the edge array works. Before each tile always had eight edges (north, north east etc.) that had values of 0 if they were not passable. In the new update tiles do not have any edges with a value of 0, so the amount of edges can vary from tile to tile. Modifying these new arrays can be a bit tricky, partially due to some limitations to how nested arrays work in blueprints. Because of this I've created some functions that should make things a lot easier. They can be found under the Utility tag in BP_GridManager. The functions for manipulating the edge array are as follows:

                                Remove Tile Edge
                                : Takes as input the indexes of the tile you want to remove an edge from and the tile you want to remove the edge to. So for instance if tile index 4 has the edges connecting it to tile 3, 5 and 8 you can input Tile Index 4 and Edge 8 to remove the edge between index 4 and 8. This means that you can no longer move from index 4 to 8. Note that if tile 8 has an edge connecting it to tile 4 you can still move in that direction. To remove edges both ways you would use Remove Tile Edge Both Ways.

                                Set Edge Cost takes a tile index and an edge as input just like Remove Tile Edge, but instead of removing it you change the cost of passing to the target tile through this edge. This can be set using the New Cost input.

                                Add Edge adds a new edge where none was before with a cost of your choice. Inputs are the same as for Set Edge Cost. Like Remove Tile Edge, Add Edge also only works in one direction, so to add edfes both ways you would use the Add Edge Both Ways function. Note that because of some limitations to how I was able to design the edge array you cannot use these functions to add an edge to a tile that has no edges at all. If you want to make a tile that is completely impassable connected to the rest of the grid you will need to use:

                                Make Tile Passable: This function connects an index to all surrounding tiles that are not themselves impassable with edge costs of 1. This is a useful function for the tutorial where you want to make the tile that was previously impassable and occupied by a tree to be passable. You can easily do the reverse by using the Make Tile Impassable function.

                                I hope this explanation makes sense, and I apologize that my tutorial is a bit outdated. I intend to make a new tutorial video in the future that explains how the edge array works among other things. For now I will add a link in the description of the tutorial video to this post.
                                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                                Dungeon Crawler Toolkit (Marketplace - Support)

                                Discord

                                Comment

                                Working...
                                X