Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    @Monokkel Thanks for the statistics man. I didn't expect the solution to be this detailed. I was thinking of a sphere collision mesh to get better coverage for detecting pawns in elevated/lower positions.

    Yea it's definitely better to use grid arrays for most cases. I'm using the grid arrays for the rest of the LoS functionality so that I can extend it to use for Overwatch. However in this particular scenario, I do not have any need for storing the data regarding the spotted enemy pawns while moving. So I'm going to try out the collision mesh for now.
    Unreal Possibilities
    Grid Creation Systems | Tower Defense Starter Kit | Wave Spawning System [50% OFF]

    Comment


      Hey Monokkel, I read on the last page some stuff about adding extra factions but wondered if you go more into detail on that?

      Trying to add a third faction that would attack both player and enemy

      Comment


        @Shenku: Oh, I see what went wrong here. I only made it so that difficult terrain is ignored (edges with a cost of 2 or below), not impassable terrain (edges with a cost of 0). That's handled by the second and third branches in Search and Add Tile. However, you cannot simply skip these checks for flying units, as they would be able to walk through walls or leave the bounds of the grid. Solving this one was a bit more tricky, but in doing so I found a bug in the toolkit that I was not aware of, so thanks There are a few ways to do this. One is to create a separate Search And Add Tile function for flying units where you skip the branches that check if an edge costs 0 and instead check if the parent tile is on one of the grid edges, in which case you do not add the indexes to the pathfinding that are in the direction of the edge. Another version that's quicker to implement is to use the solution I posted above, and make tiles that have a large height difference have an edge cost of 99 instead of 0. This is somewhat less efficient for pathfinding, but shouldn't matter that much. You need to do two changes to fix this, where one of them is to fix the bug I was unaware of (which I will fix in the next update). Go to the Add Viewport Terrain To Arrays function, and replace all the nodes in the top, right comment box with this. This makes it so that height is also checked diagonally, while before it was only checked in four directions. This is something that works with edge costs of 0, but not with edge costs higher than 1. Then in the Edge Costs From Z Difference macro you will change it to this:

        Click image for larger version

Name:	9BnxSTP.png
Views:	1
Size:	137.9 KB
ID:	1082273

        This will make edge costs 99 between tiles of sufficient height instead of 0, which makes it possible for flying units to ignore it, as per the previous solution. It will still look a bit weird, though, as the units are likely to clip through walls, but I'm sure you can find a solution. If not I can try to come up with some ideas.

        @Stormrage256: Don't worry about it. It was something I was going to check out sooner or later anyway. Pawns in lower and higher positions should not be an issue for cylinders, and come to think of it you could just use a box rotated 45 degrees for diamond shaped visibility, which should also work for height, dependent on what you're after. Boxes if you want the max height to be the same for all distances or cone volumes if you want it to vary as a function of the distance.

        Let me know how your attempt pans out, as I'll be implementing something similar in the not too distant future.

        @tamaster92: Like you've said I've written about this before. It's a bit hard to go into detail, as I haven't tried it out myself yet, but I'll give you the general solution and you can ask me specific questions if you have trouble implementing it. You will have to create a new faction in the faction struct for your new faction. Then you will have to change the parts of ATBTT_GameMode that change depending on the faction of the current pawn. Then you will have to change the parts in BP_GridManager, ATBTT_PlayerController and ATBTT_AIController that reference factions to take the new factions into account. In general you will have to change stuff that before said "if index X contains faction player, attack" to "if index X does not contain faction NewGuys or faction empty, attack". Some of the main stuff you will need to modify is Pathfinding and Find Tiles in Range, since they both check for a specific faction. What you need to do is fairly straightforward, but a lot of stuff about factions is spread out through a lot of blueprints, so I wouldn't attempt this until you feel you have a really good overview of the toolkit. I will be doing something similar in the future, but it's a few updates away.
        Advanced Turn Based Tile Toolkit (Marketplace - Support)

        Dungeon Crawler Toolkit (Marketplace - Support)

        Discord

        Comment


          Originally posted by Monokkel View Post
          @Shenku: Oh, I see what went wrong here. I only made it so that difficult terrain is ignored (edges with a cost of 2 or below), not impassable terrain (edges with a cost of 0). That's handled by the second and third branches in Search and Add Tile. However, you cannot simply skip these checks for flying units, as they would be able to walk through walls or leave the bounds of the grid. Solving this one was a bit more tricky, but in doing so I found a bug in the toolkit that I was not aware of, so thanks There are a few ways to do this. One is to create a separate Search And Add Tile function for flying units where you skip the branches that check if an edge costs 0 and instead check if the parent tile is on one of the grid edges, in which case you do not add the indexes to the pathfinding that are in the direction of the edge. Another version that's quicker to implement is to use the solution I posted above, and make tiles that have a large height difference have an edge cost of 99 instead of 0. This is somewhat less efficient for pathfinding, but shouldn't matter that much. You need to do two changes to fix this, where one of them is to fix the bug I was unaware of (which I will fix in the next update). Go to the Add Viewport Terrain To Arrays function, and replace all the nodes in the top, right comment box with this. This makes it so that height is also checked diagonally, while before it was only checked in four directions. This is something that works with edge costs of 0, but not with edge costs higher than 1. Then in the Edge Costs From Z Difference macro you will change it to this:

          [ATTACH=CONFIG]49160[/ATTACH]
          Okay, I added in the change for the Edge Costs From Z Difference macro, and it works like a charm. I tried to copy in the other part for fixing the bug you mentioned for square grids, but as soon as I pasted it into the Blueprint, Unreal crashed, so not sure what happened there(Probably because I'm using 4.7 maybe?)... No big loss though, since I'm using Hexes for my game anyways, and that works without the additional fix....


          This will make edge costs 99 between tiles of sufficient height instead of 0, which makes it possible for flying units to ignore it, as per the previous solution. It will still look a bit weird, though, as the units are likely to clip through walls, but I'm sure you can find a solution. If not I can try to come up with some ideas.
          That's easy enough to compensate for through animations or other means, so I'm not too concerned for the moment. After some quick testing, it's only really noticeable for some of the more extreme height changes, but with a little tweaking I think it's manageable.

          Comment


            @Monokkel Yes, rotated boxes maybe even better. Less polycount as well. Yea sure, I'll post a video on the LoS part as soon as I get it completely working.
            Unreal Possibilities
            Grid Creation Systems | Tower Defense Starter Kit | Wave Spawning System [50% OFF]

            Comment


              @Shenku: Good to hear that it worked! The bug doesn't have any effect on hexagonal grids like you figured, so you're in the clear. I'll fix it in the next update in any case. Good luck on the animating bit. Looking forward to seeing how it turns out

              @Stormrage256: Great! I don't think you'll have to worry about polycount. You'll only be using a single invisible shape, so even if you wanted to go beyond simple polygons it shouldn't matter. Still, no reason do do something complex if simple works just as well.
              Advanced Turn Based Tile Toolkit (Marketplace - Support)

              Dungeon Crawler Toolkit (Marketplace - Support)

              Discord

              Comment


                So UE4 4.9 Preview is out and it seems like it will be a much smoother transition than 4.8 was. There are a few errors in the log, but nothing that seems to have any effect on the toolkit's functionality. As such it does not seem necessary to make a conversion guide like I did with 4.8. There is one bizzare bug that has caused collision to be turned of for a strip of terrain in the second example map, but that seems to be a one-off error that cannot be replicated, so I see no need to touch it until I do a proper update for the full 4.9 release.
                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                Dungeon Crawler Toolkit (Marketplace - Support)

                Discord

                Comment


                  Hi Monokkel,

                  Do you ever thinked about the possibility of make building roofs transparent for the BP Camera in case there are pawns inside the building?
                  I am sure that if you played a lot of turn based games like XCOM and Jagged Alliance you know what I'm talking about.

                  How can I create a system like that? I've read about firing raycasts from pawns to the camera and if there is a roof from the pawn to the camera just set an Opaque = 0 translucent material.
                  It really can work like that?
                  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


                    Hi Wisdom-HELLy,

                    you've basically figured it out already. It's very easy to set up, and I intend to include such a feature come the XCOM-style game example. Here is a forum post by Chance Ivey explaining how it can be done: https://forums.unrealengine.com/show...-in-Blueprints
                    Advanced Turn Based Tile Toolkit (Marketplace - Support)

                    Dungeon Crawler Toolkit (Marketplace - Support)

                    Discord

                    Comment


                      Originally posted by Monokkel View Post
                      That's the plan You can see the list in the first post for most of the major planned features. After the next update, which is mainly focused on mobile and 2D, the next will be for XCOM-style tactical squad based games, with multi-level grids, cover systems, advanced combat abilities (such as overwatch), fog-of-war etc.
                      I've already implemented Cover System and Overwatch in my game, I'm pretty curious to check if we had the same idea

                      On the other hand I'm really excited to get the multi-level grids and fog-of-war, but I did many changes on the toolkit's core

                      EDIT: if is impossible to have multi-level grid and fog-of-war functions (because of plugin protection) into a dedicated BlueprintUE web page, is it more reasonable to have the new functions very well marked and commented in the new code release?
                      In this way I could create a new project with the new version and just copy-paste what I need to my project
                      Last edited by Wisdom-HELLy; 08-04-2015, 11:38 AM.
                      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


                        That's pretty much how I've been doing it so far. I try to mark every change I make in the toolkit blueprints with a boolean marker variable named after the version in which it was added, commented with a brief description of the change. If you right click on one of these version booleans you can find all instances of the funtion and be guided around the blueprints to where changes have been made. I think this is more practical than BlueprintUE for both users and myself.

                        I'm looking forward to adding XCOM-style features, and will get to work on that as soon as the 2D-update is out. That update is mostly done, but I won't be able to finish it until early next month, since I'll be on vacation travelling all of august. I will still be availible online to provide support as always, though
                        Advanced Turn Based Tile Toolkit (Marketplace - Support)

                        Dungeon Crawler Toolkit (Marketplace - Support)

                        Discord

                        Comment


                          Hi Knut,

                          I was wondering if it was possible to do a tutorial on having weapon pickups. Basically, changing the unit_player_melee character's boolean "HasGun" would change the animation states (so that the idle is now an idle with gun; the attack is a hip shot instead of a punch) the range and the targeting of the attack (instead of just highlighting the tiles around the character) so that while the boolean is true the character can act just like a unit_player_ranged. Ideally I would want this to be dynamic instead of swapping between two pawn types!

                          The weapon pickup class would contain the information about the weapon (such as damage and range).

                          This would eventually lead to being able to swap between multiple weapons during the player's turn by changing the value of a current_weapon_index variable (such as unarmed melee, ranged hip shooter and grenade launcher).

                          Comment


                            Hello Monokkell,
                            I am trying to put in an end turn button that will end the player turn for all pawns and begin the AI turn. I currently have it cycle through all of the pawns and use a switch on enum until it gets to the AI pawn. Where would be a good place to put and event or something that would jump right to the AI turn. I know I will still have to set the current pawn to what ever AI pawn is used. Any help with this would be appreciated, Thank you in advance.

                            Comment


                              Originally posted by Monokkel View Post
                              XCOM-like:
                              • Multi-level grids
                              • Destructible terrain (20%)
                              • Cover system/accuracy
                              • Fog of War
                              • Displaying movement range as a frame (80%)


                              Dungeon Crawler:
                              • Multi-tile units (50%)
                              • Procedural Generation
                              • Advanced attributes/leveling up
                              • Advanced tactics (flanking etc.)
                              I think a cover system is better without an accuracy mechanic, because the randomization makes a game less tactical. Cover could reduce the damage by 50 %. A flanking mechanic makes a game much more tactical and it should be as important as the cover system. Flanking could increase the damage by 50 %.

                              A range mechanic would be great, too. Every weapon could have an optimal range and if the target is not in that range the attack inflicts less damage. For example a shotgun could have an optimal range of 5 tiles and if the target is 12 tiles away the damage could be reduced by 70 %.

                              Comment


                                Hi Wizard,

                                I was able to implement a flanking logic (and rear attack also) almost easily by modifying Monokkel's toolkit logic a bit.
                                Anyway I also think he can include this funcionality in the XCOM tutorial because for example real XCOM game has flanking option too
                                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

                                Working...
                                X