Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Hi Wisdom-HELLy,

    I've given this some thought, as I plan to implement similar features in an upcoming example map. There are of course several ways to do what you ask, but here's how I'd do it. Since you already have a cover array that knows the direction of the cover (pregenerated I assume, since that would be most efficient), finding whether the attacker is between an attacker and the target should be very easy. Just subtract the X and Y locations of the attacker from the targets X and Y location. If X is positive the attacker is to the east, if Y is negative the attacker is to the north etc. No trace needed in this case.

    For cone tracing I think that might also be more complicated than what you need. What I would do is to periodically do line traces to all enemy units currently on overwatch. Doing this on tick is probably overkill, but probably not that bad on performance, since there will probably not be a massive amount of units on overwatch in a given level. Either way I'd probably set it up to fire an event every time a unit enters a new tile. If any of the traces (using range trace) are not blocked (get hit result returns false), check the look at rotation between the unit on overwatch and the target. If it is a reasonably small number, trigger your overwatch event. The result should be pretty much identical to a cone trace, I think.
    Advanced Turn Based Tile Toolkit (Marketplace - Support)

    Dungeon Crawler Toolkit (Marketplace - Support)

    Discord

    Comment


      Hi Monokkel,
      Great ideas, as usual

      Your solution is about firing an overwatch event, and that's really great even if I will maybe reduce line trace check during tick event, creating an increasing index integer and firing the line trace only when index % 4 = 0 (or more than 4, if needed)
      That's should increase system overall performance, even if a line trace is not an expensive operation.

      My actual concern, unlike XCom, is to create a mobile and rotating sight area selection when you select overwatch special ability (by displaying, for example, 2 red lines that simulate the unit view field), so that I am concerned about the altitude. That's why I think I'll need a cone trace, or maybe I need to create an invisible cone mesh. When I apply that view field, using your idea, I will just change the unit rotation and apply a boolean value (isInOverwatch) to true, then continue to check line trace on tick % 4 = 0.

      But can line trace be useful when attacker and victim are at different altitudes?
      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 Wisdom-HELLy View Post
        Hi Monokkel,
        Great ideas, as usual

        Your solution is about firing an overwatch event, and that's really great even if I will maybe reduce line trace check during tick event, creating an increasing index integer and firing the line trace only when index % 4 = 0 (or more than 4, if needed)
        That's should increase system overall performance, even if a line trace is not an expensive operation.

        My actual concern, unlike XCom, is to create a mobile and rotating sight area selection when you select overwatch special ability (by displaying, for example, 2 red lines that simulate the unit view field), so that I am concerned about the altitude. That's why I think I'll need a cone trace, or maybe I need to create an invisible cone mesh. When I apply that view field, using your idea, I will just change the unit rotation and apply a boolean value (isInOverwatch) to true, then continue to check line trace on tick % 4 = 0.

        But can line trace be useful when attacker and victim are at different altitudes?
        My solution works equally well for different altitudes. Just check both pitch and yaw. If either is below a certain threshold, fire your overwatch event. Or use only yaw, since I don’t think you’d want players to specify the pitch of their units heads when putting them in overwatch. My solution does not allow you to display a visible cone, of course, even though the result will be similar to a cone. If you want to display the cone you could of course use a semi-transparent cone mesh with the same angles as you’ve set as the cutoff for checking yaw. This wouldn’t visually account for cover, though. In that case you’d probably want to shine some sort of conical light from your pawn.
        Advanced Turn Based Tile Toolkit (Marketplace - Support)

        Dungeon Crawler Toolkit (Marketplace - Support)

        Discord

        Comment


          A small update on some features I'm working on. Visibility can now also be displayed as a frame, just as for movement. More importantly, pawns can now figure out what is the optimal tile to move to for attacking a target. They can be set to prefer long or short ranges or whatever takes the least amount of movement. This is useful for AI, where ranged units might want to keep their distance, or enemies will want to move minimally in a game with shared action points between movement and attacking.

          Click image for larger version

Name:	btaTBEn.jpg
Views:	1
Size:	52.2 KB
ID:	1078846

          Note: The new features work equally well for 3D games.
          Last edited by Monokkel; 05-24-2015, 06:15 PM.
          Advanced Turn Based Tile Toolkit (Marketplace - Support)

          Dungeon Crawler Toolkit (Marketplace - Support)

          Discord

          Comment


            Hello Monokkel,
            I bought your toolkit but i have some issues. Every time i try to add this asset to my project and i try to create the grid it crashes my unreal or when it not crashes, the blueprints loses some Events. What is the best way to import to my project? Sorry for the question i'm totally new to unreal, but i love the asset.
            Thank You

            Comment


              Hey Monokkel,

              Got a few questions -

              1. Does this work with the World Composition feature that comes with Unreal 4? I am currently building a large scale environment that I would like to turn into a Turn Based Strategy game Proof of Concept. If you are unsure I can send you over my environment so that you can test it out.
              2. Do you plan on adding a Asynchronous Turn Based Game Mode to your Turn Based ToolKit? Basically both players take their turns at the same time, then they lock in their moves and then the game plays out or simulates the turn.
              3. Does this support more than one player on the same computer?

              I know that this sounds dumb but I am basically making an "Mixed reality Wargame" Similar of that of Supreme Commander or Total Annihilation for the CastAR and Microsoft Hololens when they come out. In the mean time I am laying the ground work for the game.

              Thank you for your time,

              HeadClot

              Comment


                Originally posted by Pitchohavers View Post
                Hello Monokkel,
                I bought your toolkit but i have some issues. Every time i try to add this asset to my project and i try to create the grid it crashes my unreal or when it not crashes, the blueprints loses some Events. What is the best way to import to my project? Sorry for the question i'm totally new to unreal, but i love the asset.
                Thank You
                Hi Pitchohavers, I'm sorry that you're having issues. The toolkit was originally designed so that almost all functionality was contained within BP_GridManager, so that the toolkit could be easily added to other projects just by placing the grid manager in the level.

                I later split up the functionality over multiple blueprints, which has a lot of benefits, but does make it harder to add the toolkit to a preexisting project. I have asked Epic to change the text in the launcher to say "Create New Project" instead of "Add to Project", but it seems they haven't gotten around to it yet.

                In any case the "Add to Project" button does the same thing as "Create New Project" at the moment. Therefore I would recommend you to create a new project with the toolkit and import all your custom meshes/blueprints etc. to that project instead of the other way around. If you for some reason need to do it the other way, you might run into various problems depending on how your old project is set up. At the very least you will have to import the config files as well as the content files. This is not done when using migrate, so you will have to copy the config files between the project folders directly.

                So to repeat, you should create a new project if this is not a big hassle. If it is, you also need to include the config files. If you do this, do you still run into the same problems? Could you specify what events are lost from what blueprints?

                Originally posted by HeadClot View Post
                Hey Monokkel,

                Got a few questions -

                1. Does this work with the World Composition feature that comes with Unreal 4? I am currently building a large scale environment that I would like to turn into a Turn Based Strategy game Proof of Concept. If you are unsure I can send you over my environment so that you can test it out.
                2. Do you plan on adding a Asynchronous Turn Based Game Mode to your Turn Based ToolKit? Basically both players take their turns at the same time, then they lock in their moves and then the game plays out or simulates the turn.
                3. Does this support more than one player on the same computer?

                I know that this sounds dumb but I am basically making an "Mixed reality Wargame" Similar of that of Supreme Commander or Total Annihilation for the CastAR and Microsoft Hololens when they come out. In the mean time I am laying the ground work for the game.

                Thank you for your time,

                HeadClot
                Hi HeadClot,

                since you are making a game that is a bit outside of what the toolkit is intended for, you will need to do more work yourself, but believe what you are asking should be possible, depending on your implementation.

                1. As per the most recent update, the toolkit can generate a grid on top of anything that has collision set to block PathTrace. This should also work with world composition.
                2. I have no plans on adding asynchronous gameplay to the toolkit at the moment. It should be possible to do this, but it would certainly take some work.
                3. Not out of the box, but this should be relatively easy to add. The biggest change would be needing to to change the toolkit to support more than two factions.
                Last edited by Monokkel; 05-26-2015, 09:30 AM.
                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                Dungeon Crawler Toolkit (Marketplace - Support)

                Discord

                Comment


                  Hey, If you need to test anything for 4.8; Give me a shout; Would love to get dibs ASAP on 4.8 because I'm a rebel and work in preview builds and I'm patiently awaiting 4.8 release JUST to use this asset in 4.8; So if you need a hand / Just need someone to test; YOU KNOW WHERE I AM!

                  Keep up the awesome work!
                  KITATUS
                  "Information shouldn't be behind a paywall, It should be free for all!"

                  Comment


                    Originally posted by KitatusStudios View Post
                    Hey, If you need to test anything for 4.8; Give me a shout; Would love to get dibs ASAP on 4.8 because I'm a rebel and work in preview builds and I'm patiently awaiting 4.8 release JUST to use this asset in 4.8; So if you need a hand / Just need someone to test; YOU KNOW WHERE I AM!

                    Keep up the awesome work!
                    I think I solved all compatability issues when I wrote the Conversion guide two pages ago, though I might of course have missed something, and there have been two new minor 4.8 updates in the meantime. The plan is to have the next large general update of the Toolkit released at the same time as the full 4.8 release. I've reposted the conversion guide below. Is there anything that is missing, or that has been rendered unnecessary because of the minor updates to 4.8?

                    Guide to updating to 4.8 (WIP):

                    BP_GridManager:

                    Set Marker Location (function): Delete the bottom "select" node and create a new one. Connect the output from Index To Vector On Grid to the bottom vector input. Split the top input and connect the three floats (X, Y and Z + offset) to the split vector. Set the index to boolean and connect "Use Index" to this bool. Connect the output of the "Select" node to the SetWorlLocationAndRotation function.

                    Create Spline Path (function): Remove the connection between ADD and Return Node.

                    Destroy And Clear Spline Path (function): Remove the connection between Destroy Component and Return Node.

                    Display Path As Spline (function): Remove the connection between Set Start and End and Return Node.

                    Compile BP_GridManager and follow the Yellow exclamation marks to the four Cast To Static Mesh Component issues. In each case, remove the cast and connect the previous input to the cast to the previous outputs from the cast. Connect up the execution pins on either side of the cast.

                    ATBTT_AI_Controller:

                    Make Choice Array (function): Remove the connection between ADD and Return Node.

                    Unit_Parent:

                    End Movement and Update Arrays (red comment box): Connect "Self" to the last "Set Array Element" node. (Edit: it seems this is not enough as the self nodes are disconnected each time the project is saved. This can be mended by casting self through Unit_Parent, though this is an awkard workaround).

                    Recieve Damage (purple comment box): Connect "Self" to the last REMOVE node (you need to cast it here as well, it seems). Get Index from the output of the cast and connect it to the last Set Array Element Node. Remove the input from "Item" in the same Set Array Element Node.

                    Tile Parent:

                    Compile the blueprint and remove the unnecessary cast.

                    ATBTT Game Mode:

                    Set unit to first in initiative (funtion): Remove the connection between the top right "Set Array Element" and the return node.

                    Remaining problems:

                    Deleting all tile decals no longer works, but I see no reason why this should be. For now, do not use decals with 4.8. Other than that it seems everything else is working like it should.

                    There might be other stuff as well. Please post in this thread if you encounter anything. And again I recommend sticking with 4.7 until 4.8 is out of preview if you want to ensure that there are no bugs.
                    Last edited by Monokkel; 05-31-2015, 06:45 PM.
                    Advanced Turn Based Tile Toolkit (Marketplace - Support)

                    Dungeon Crawler Toolkit (Marketplace - Support)

                    Discord

                    Comment


                      Originally posted by Monokkel View Post
                      I think I solved all compatability issues when I wrote the Conversion guide two pages ago, though I might of course have missed something, and there have been two new minor 4.8 updates in the meantime. The plan is to have the next large general update of the Toolkit released at the same time as the full 4.8 release. I've reposted the conversion guide below. Is there anything that is missing, or that has been rendered unnecessary because of the minor updates to 4.8?
                      Oh yeah, I followed all of that but was getting a weird error where the tiles we're actually showing; And the player / enemy was STILL going to tile #1 every move; No matter where they are and where they run to :/
                      KITATUS
                      "Information shouldn't be behind a paywall, It should be free for all!"

                      Comment


                        Ok, I've downloaded the latest preview build and updated it according to my guide. Everything seems to work after that, so I'm uncertain why it doesn't work in your project. I've made some minor adjustments to the guide, but it is basically the same. Here is the new version (I've updated the one in the post above as well, to avoid confusing anyone):

                        Guide to updating to 4.8 (WIP):

                        BP_GridManager:

                        Set Marker Location (function): Delete the bottom "select" node and create a new one. Connect the output from Index To Vector On Grid to the bottom vector input. Split the top input and connect the three floats (X, Y and Z + offset) to the split vector. Set the index to boolean and connect "Use Index" to this bool. Connect the output of the "Select" node to the SetWorlLocationAndRotation function.

                        Create Spline Path (function): Remove the connection between ADD and Return Node.

                        Destroy And Clear Spline Path (function): Remove the connection between Destroy Component and Return Node.

                        Display Path As Spline (function): Remove the connection between Set Start and End and Return Node.

                        Compile BP_GridManager and follow the Yellow exclamation marks to the four Cast To Static Mesh Component issues. In each case, remove the cast and connect the previous input to the cast to the previous outputs from the cast. Connect up the execution pins on either side of the cast.

                        ATBTT_AI_Controller:

                        Make Choice Array (function): Remove the connection between ADD and Return Node.

                        Unit_Parent:

                        End Movement and Update Arrays (red comment box): Connect "Self" to the last "Set Array Element" node. (Edit: it seems this is not enough as the self nodes are disconnected each time the project is saved. This can be mended by casting self through Unit_Parent, though this is an awkard workaround).

                        Recieve Damage (purple comment box): Connect "Self" to the last REMOVE node (you need to cast it here as well, it seems). Get Index from the output of the cast and connect it to the last Set Array Element Node. Remove the input from "Item" in the same Set Array Element Node.

                        Tile Parent:

                        Compile the blueprint and remove the unnecessary cast.

                        ATBTT Game Mode:

                        Set unit to first in initiative (funtion): Remove the connection between the top right "Set Array Element" and the return node.

                        Remaining problems:

                        Deleting all tile decals no longer works, but I see no reason why this should be. For now, do not use decals with 4.8. Other than that it seems everything else is working like it should.

                        There might be other stuff as well. Please post in this thread if you encounter anything. And again I recommend sticking with 4.7 until 4.8 is out of preview if you want to ensure that there are no bugs.
                        Advanced Turn Based Tile Toolkit (Marketplace - Support)

                        Dungeon Crawler Toolkit (Marketplace - Support)

                        Discord

                        Comment


                          On the off chance anyone happens to be reading page eight of this thread and is still only considering buying the toolkit, now is the time to consider harder The toolkit just went on sale and is 30% off on the marketplace, so get it while it's cheap!
                          Advanced Turn Based Tile Toolkit (Marketplace - Support)

                          Dungeon Crawler Toolkit (Marketplace - Support)

                          Discord

                          Comment


                            So I have a weird issue. I have been using a version released around March and I wanted to update to the latest changes in 1.4. When I tried to add ATBTT to a new empty project it seemed I was not seeing any new changes (for example my Blueprints/Gameplay folder only had BP_Grid_Camera, BP_Grid_Manager and HUD_Faction_Turn). It didn't seem to contain any of the new blueprints you mentioned in 1.4 and I did not see anything new anywhere else. I figured I would just delete the toolkit from the Vault and redownload it to force a clean updated version on another empty project, etc.

                            But that doesn't seem to work, it still puts in what I presume is the old version I had been working with. I even verified in the VaultCache folder within the Launcher directory that it does delete when I remove it and after redownloading it from the marketplace it did not seem to have any extra files in it that should be in 1.4. So, I'm at a loss here, deleting it from the vault and redownloading seems to keep pulling the old version.

                            This is all on UE 4.7.6 by the way. For fun I tried to switch the engine version of the toolkit to 4.6.1 and it gets stuck at Syncing.

                            Comment


                              @mills:

                              The errors you are experiencing is because the toolkit is no longer made to be instantly added to other projects. It was so in the very first version, but I had to sacrifice that bit when I made the toolkit more modular. Even so, Epic have kept the "Add to project" button in the vault (though it says "Create Project" in the marketplace proper), but clicking it opens the "Create New Project" dialogue. If you then choose the directory of a preexisting project it just becomes a mess. Therefore I would recommend creating a new project with the toolkit and importing your other stuff into this new project. If that is not a viable option you should try creating a new project and migrating its content to your old project. In that case you should also copy the config files from the new project into your old projects (probably located in Documents\Unreal Projects\[project name].

                              Hope that helps!
                              Advanced Turn Based Tile Toolkit (Marketplace - Support)

                              Dungeon Crawler Toolkit (Marketplace - Support)

                              Discord

                              Comment


                                Thanks for the quick reply. I've tried every possible way I know of to create a new project with the toolkit:

                                1. I tried clicking "Create Project" from the vault and put it in a new folder.
                                2. I tried clicking "Create Project" from the button in the marketplace for the toolkit and put it in a new folder.

                                I've deleted the toolkit from the Vault, redownloaded from marketplace, and tried the above again.

                                In either case, it seems for whatever reason, my VaultCache copy of my toolkit is NOT updating even if I delete it from the vault and redownload it. As mentioned above it never seems to pull the additional blueprints mentioned in the 1.4 update. My Blueprints/Gameplay folder contains only 3 blueprints (BP_Grid_Camera, BP_Grid_Manager and HUD_Faction_Turn). From what I understand, there should be a few more due to the restructuring that occurred in 1.4.

                                As further example, my GridManager doesn't seem to have any of the updates to Heightmaps like you posted in your 1.4 new features video. It's still showing the old Heightmap stuff. I've included a screenshot for reference.

                                Thanks again for any ideas you might have on this.
                                Attached Files

                                Comment

                                Working...
                                X