Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    My questions from the discord:

    1. Is there a way to freely draw a path for moving instead of automatically reducing to the shortest path? For example, navigating through a series of land mines by snaking through them.

    2. I've looked over the overwatch ability, but I want to customize it for general reactive abilities like stances. A dodge status effect where a unit moves out of the firing line / range of an attack to another tile. If tiles in range are free to move to, they avoid the attack, else they're hit. Or a counter status effect where a unit automatically deflects or destroys a projectile that enters an AOE, to defend other units.

    3. As part of the counter mentioned above, is it possible to give abilities movement speed, collisions, nonlinear paths to interact with instead of just being a hitscan damage function? Speed could be compared with a unit's reflex value to check if they can dodge it. Collision could allow it to bounce off walls to hit out of sight units. Paths to avoid unit detection, or to hit multiple units in the path. The answer is probably spawning some projectile actor on ability execution, but then how do you allow the projectile to act within the turn manager?

    4. Multiple actions per turn, where a unit can take as many actions as resources allow, and where they can be selected multiple times during player phase to take actions between other units' actions.

    Cheers~

    Comment


      Originally posted by sehysu View Post
      My questions from the discord:

      1. Is there a way to freely draw a path for moving instead of automatically reducing to the shortest path? For example, navigating through a series of land mines by snaking through them.
      Yes, there are a few ways you could do this, depending on what you're after. Takes a bit of work, but not a huge amount. Essentially you would have an ability that starts out much like BP_Ability_Move. However, when a tile is clicked, instead of calling on the unit to move you would store the Grid Indexes of the current displayed path in the ability. You would then clear the pathfinding array and call a new RunPathfinding function with the clicked tile as the start point. When you now click a new tile you would append the current path to the one previously generated and so on. Finally when the player has completed the path and signals the unit to move you would use MoveCustomPath on the unit, using the appended path array as input.

      Originally posted by sehysu View Post
      2. I've looked over the overwatch ability, but I want to customize it for general reactive abilities like stances. A dodge status effect where a unit moves out of the firing line / range of an attack to another tile. If tiles in range are free to move to, they avoid the attack, else they're hit. Or a counter status effect where a unit automatically deflects or destroys a projectile that enters an AOE, to defend other units.
      You can take the overwatch or trap examples as starting points for these sorts of interruptions. Interruptions are not that hard to do if each thing happening can be called as an independent action. You could use event dispatchers for this. For instance, you could have a dispatcher fire when a unit attacks another unit, which could be bound to an event on the target unit to trigger a counterattack. For interruptions when ending movement on a tile you already have the OnUnitEndMovement event dispatchers, which are called from the grid manager.

      Interrupting in the middle of an ongoing action (as with overwatch during movement) is more tricky, and the current setups for this are admittedly a bit hacky (which is why they are in the experimental folder). Improving this is one of my main aims for the current update I am working on, so if you can focus on other systems for a while it might be a good idea to wait for the next update before delving heavily into action interruption stuff.

      Originally posted by sehysu View Post
      3. As part of the counter mentioned above, is it possible to give abilities movement speed, collisions, nonlinear paths to interact with instead of just being a hitscan damage function? Speed could be compared with a unit's reflex value to check if they can dodge it. Collision could allow it to bounce off walls to hit out of sight units. Paths to avoid unit detection, or to hit multiple units in the path. The answer is probably spawning some projectile actor on ability execution, but then how do you allow the projectile to act within the turn manager?
      Sorry, I'm not really following this question. What is a hitscan damage function? There is already dodging and accuracy in the JungleRaid example map, but I take it you are talking about something else. Do you mean firing a physics based projectile or something like that? Could you explain a bit more?

      Originally posted by sehysu View Post
      4. Multiple actions per turn, where a unit can take as many actions as resources allow, and where they can be selected multiple times during player phase to take actions between other units' actions.

      Cheers~
      Sure, that is more or less enabled already. Just make the units have several action points and don't have bUseEndsTurn set to true in your abilities.
      Advanced Turn Based Tile Toolkit (Marketplace - Support)

      Dungeon Crawler Toolkit (Marketplace - Support)

      Discord

      Comment


        Is there a way to "subscribe" to events that are fired. I'm only using this asset for the movement and cover aspects. I'm trying to figure out:
        1. The tile the user has clicked on to signify the target tile to move to;
        2. On tile enter and on tile exit events;
        3. Once I have the destination tile, how do I extract cover info from that tile?
        My focus is on AI programming, so I'm just getting used to UE4. I understand how to build on existing functionality, but not how to extract movement information. Any help would be great.

        Comment


          Originally posted by Dijon View Post
          Is there a way to "subscribe" to events that are fired. I'm only using this asset for the movement and cover aspects. I'm trying to figure out:
          1. The tile the user has clicked on to signify the target tile to move to;
          2. On tile enter and on tile exit events;
          3. Once I have the destination tile, how do I extract cover info from that tile?
          My focus is on AI programming, so I'm just getting used to UE4. I understand how to build on existing functionality, but not how to extract movement information. Any help would be great.
          From what you're describing I think you want to look into Event Dispatchers. You define an ED inside a blueprint, from which you can call it. Any other blueprint can bind events to this ED through a reference to the actor with the ED. From then on, whenever the ED is called, all bound events will also be called. These events can have inputs like any event, meaning you can pass data to multiple actors in this way.

          If you look into the OnActorEnterTileSimulate (and an equivelent Exit event) you can see how I have set this up (and that also goes towards answering your second question.

          Data in tiles is stored within TMap variables. Most of these are in BP_GridManager. You have GridLocations, where you can find the location of a tile by inputting the grid index, for instance. The cover TMap follows the same principle, but it resides with in the cover system component. You can get the cover data of a tile through a grid index.
          Advanced Turn Based Tile Toolkit (Marketplace - Support)

          Dungeon Crawler Toolkit (Marketplace - Support)

          Discord

          Comment


            Originally posted by Monokkel View Post
            Sorry, I'm not really following this question. What is a hitscan damage function? There is already dodging and accuracy in the JungleRaid example map, but I take it you are talking about something else. Do you mean firing a physics based projectile or something like that? Could you explain a bit more?
            Yes, a projectile that can move independently and interact with the environment. I was thinking that it could be a temporary BP_Unit spawned with a unique projectile AI given its own turn. Though I wonder if it wouldn't get too expensive for my idea of a bullet hell like attack where dozens of projectiles could be on screen at once.

            By hitscan damage, I was referring to simply doing damage to a selected target on ability activation. I want my attacks to have a physical presence in the world so they can be affected in numerous ways. Like a laser that can bounce off certain surfaces or be reflected by units themselves to hit out of the way targets. Or a bomb that can be kicked into small holes or moved around by environmental effects like wind or slopes. These can be done relatively easily in real-time, but I'm having difficulty fitting them into ATBTT. Of course, there's a difference between an instantaneous attack like a laser, and a persistent actor like a bomb so I imagine they'll have completely separate implementations.

            Also a couple more questions:
            1. Is it possible to do something like Shining Force 3 where you can freely move your character until the edge of their movement range, and on starting an action, automatically slide the character to the middle of the closest tile? I'm considering combining this with the free path idea, where a unit subtracts from its move variable with each step and the blue movement tiles shrink in response to limit the edge movement. Like a stamina system in grid form.

            2. Body parts and unit height. Possibly representing a unit with a cube volume instead of a 2d tile so that their head, body, arms, and legs can be hit separately according to the height and direction of an attack. This would include crouching and laying down to decrease a unit's height at the expense of movement. I'm considering separate actor components for various body types like humanoid, four-legged, or vehicle, and height should be as simple as adding a variable to BP_Unit that can be modified based on stance and level height, that compares to a height value for each attack ability. Ideally you should be able to crouch underneath an attack, or turn to take damage to another body part that has enough health to survive.

            3. Hybrid real-time, turn-based. I've been playing around with the experimental hybrid map, and it's pretty much perfect for something like Underrail that I've had in mind. Real-time movement out-of-battle and in stealth, while still being able to use attack abilities to initiate combat. As well as a seamless transition back to real-time when enemies are no longer aware of where you are. Would you recommend building on top of the hybrid example, or should I hold off until it's out of experimental? It seems easy enough to begin and end turn based mode, though I'm not clear on how you're anchoring the units to the center of a tile on begin turn based mode. That is, how would real-time patrolling enemies move to their appropriate tile when turn-based mode begins?

            Sorry if I've rambled on, it's just that ATBTT is such an amazing base to work with, that I just can't stop thinking about what to add and expand. I'm sure many people are thankful that you've continued to work on it for so long while still being so active with the community. I certainly am.

            Thanks for your time~

            Comment


              not sure if is a bug but if is not a bug it seem very weird to leave it like that, so here the problem. . ( there is no custom bp make)
              full hp 100
              in the BP unit anim, there a damage, let say we set it 50
              in the bp ability moveattack , i turn off the use unit attributes , and set the damage, let say we set it 10

              the unit atk 2 time , there is no death animation. and say the game is over.

              if is the other way around that
              in the BP unit anim, there a damage, let say we set it 10
              in the bp ability moveattack , i turn off the use unit attributes , and set the damage, let say we set it 50

              the unit atk 2 time , and death animation play and the unit is gone, but the game is not over. so the game is stuck.

              Comment


                Hello there, I posted the runtime question on the marketplace the other day.
                I was wondering if the tile system could be used essentially for a base builder sort of game (like clash of clans). players would need to 'buy' walls, and other tiles to drag into their levels. in essence it'd probably need to be saved as an array or something that populates on startup of the level. gameplay would be non-simultaneous. there wouldn't be any turn-based action going on while walls are being placed. the concern is really being able to set and save walls outside of the editor and if it'd function appropriately.

                Comment


                  Originally posted by Monokkel View Post

                  Data in tiles is stored within TMap variables. Most of these are in BP_GridManager. You have GridLocations, where you can find the location of a tile by inputting the grid index, for instance. The cover TMap follows the same principle, but it resides with in the cover system component. You can get the cover data of a tile through a grid index.
                  This part still eludes me. I see that FCover is a struct and that FCoverArray is simply an array of these structs. FCover, however, is composed of an int and a float. I can also see that the value for full cover is 0.5 and it's 0.25 for half cover. I still don't see what that float references. I'd assume that each edge of a tile is assigned a value but I can't get further. Can you tell me how the data is stored, and is the data in the edges, or the tile itself? Thanks for all of your help so far. If I'm asking too much, please say so.

                  Comment


                    Originally posted by sehysu View Post
                    Yes, a projectile that can move independently and interact with the environment. I was thinking that it could be a temporary BP_Unit spawned with a unique projectile AI given its own turn. Though I wonder if it wouldn't get too expensive for my idea of a bullet hell like attack where dozens of projectiles could be on screen at once.
                    Yes, sounds like something that could be handled by a unit. Having dozens on the screen at once should not be a problem. Units don't do anything on tick and are pretty inexpensive.

                    Originally posted by sehysu View Post
                    By hitscan damage, I was referring to simply doing damage to a selected target on ability activation. I want my attacks to have a physical presence in the world so they can be affected in numerous ways. Like a laser that can bounce off certain surfaces or be reflected by units themselves to hit out of the way targets. Or a bomb that can be kicked into small holes or moved around by environmental effects like wind or slopes. These can be done relatively easily in real-time, but I'm having difficulty fitting them into ATBTT. Of course, there's a difference between an instantaneous attack like a laser, and a persistent actor like a bomb so I imagine they'll have completely separate implementations.
                    The implementations for these things will vary a lot from case to case, I believe. If you could describe one of them in more detail I will try to point you in the right direction.

                    Originally posted by sehysu View Post
                    Also a couple more questions:
                    1. Is it possible to do something like Shining Force 3 where you can freely move your character until the edge of their movement range, and on starting an action, automatically slide the character to the middle of the closest tile? I'm considering combining this with the free path idea, where a unit subtracts from its move variable with each step and the blue movement tiles shrink in response to limit the edge movement. Like a stamina system in grid form.
                    Sounds a bit like the hybrid example map to me. You could convert the location of the unit to a grid index to check that it stays within the bounds and push it back if not, or you could maybe spawn an invisible wall at the edges of the movable area (a bit more difficult). I have not played Shining Force, so speculating a bit here.

                    Originally posted by sehysu View Post
                    2. Body parts and unit height. Possibly representing a unit with a cube volume instead of a 2d tile so that their head, body, arms, and legs can be hit separately according to the height and direction of an attack. This would include crouching and laying down to decrease a unit's height at the expense of movement. I'm considering separate actor components for various body types like humanoid, four-legged, or vehicle, and height should be as simple as adding a variable to BP_Unit that can be modified based on stance and level height, that compares to a height value for each attack ability. Ideally you should be able to crouch underneath an attack, or turn to take damage to another body part that has enough health to survive.
                    From the start of your question am I right in assuming you are using sprites for your units? Is it top down similar to the 2D example map? That makes many things more simple compared to a 3D game, if that is what you are going for.

                    As for the rest of the question there is a lot to unpack. Nothing here seems like it would not be achievable, but it all depends a lot on the rest of your game.

                    Originally posted by sehysu View Post
                    3. Hybrid real-time, turn-based. I've been playing around with the experimental hybrid map, and it's pretty much perfect for something like Underrail that I've had in mind. Real-time movement out-of-battle and in stealth, while still being able to use attack abilities to initiate combat. As well as a seamless transition back to real-time when enemies are no longer aware of where you are. Would you recommend building on top of the hybrid example, or should I hold off until it's out of experimental? It seems easy enough to begin and end turn based mode, though I'm not clear on how you're anchoring the units to the center of a tile on begin turn based mode. That is, how would real-time patrolling enemies move to their appropriate tile when turn-based mode begins?
                    The hybrid example is an okay base, but in this particular case you might consider waiting to implement this part of your game. That things are in experimental does not necessarily (or even usually) mean that I will be moving them to the base toolkit at any point. They are mainly there to provide examples of ways to implement various features, but in a non-commital way, where I might scrap things or make heavy changes between updates. For the hybrid stuff specifically, though, I am making some pretty big improvements in the next update. Primarily in letting people use characters instread of actors to represent units.

                    Originally posted by sehysu View Post
                    Sorry if I've rambled on, it's just that ATBTT is such an amazing base to work with, that I just can't stop thinking about what to add and expand. I'm sure many people are thankful that you've continued to work on it for so long while still being so active with the community. I certainly am.

                    Thanks for your time~
                    I like your enthusiasm, and understand that you want to get a rough picture of what you can do while you are planning out your game. When you have a clearer idea, though, I recommend homing in on specific features that can take you step by step towards your vision. At that point it will be easier for me to give you more definitive answers and suggestions.

                    Originally posted by kinre View Post
                    not sure if is a bug but if is not a bug it seem very weird to leave it like that, so here the problem. . ( there is no custom bp make)
                    full hp 100
                    in the BP unit anim, there a damage, let say we set it 50
                    in the bp ability moveattack , i turn off the use unit attributes , and set the damage, let say we set it 10

                    the unit atk 2 time , there is no death animation. and say the game is over.

                    if is the other way around that
                    in the BP unit anim, there a damage, let say we set it 10
                    in the bp ability moveattack , i turn off the use unit attributes , and set the damage, let say we set it 50

                    the unit atk 2 time , and death animation play and the unit is gone, but the game is not over. so the game is stuck.
                    Yeah, this is a bug. The action system and game logic seem to get different messages of damage taken when the ability is set up in this way. Thanks for making me aware of it. Seems like I set it up incorrectly in the ExecuteAbility function of BP_Ability_MoveAttack. The action queue gets the damage from the ability's damage variable, which is set to be the damage variable of the unit if bUseUnitAttributes is true, but keeps its default value is not. Meanwhile the TakeDamage node gets the damage value directly from the unit, so it always uses the unit's value no matter the value of bUseUnitAttributes. If you change the function like so it should fix the issue:



                    Sorry about the bug. I'll make sure to fix it in the next update.

                    Originally posted by Scott6997 View Post
                    Hello there, I posted the runtime question on the marketplace the other day.
                    I was wondering if the tile system could be used essentially for a base builder sort of game (like clash of clans). players would need to 'buy' walls, and other tiles to drag into their levels. in essence it'd probably need to be saved as an array or something that populates on startup of the level. gameplay would be non-simultaneous. there wouldn't be any turn-based action going on while walls are being placed. the concern is really being able to set and save walls outside of the editor and if it'd function appropriately.
                    The game you are making is a bit different from what it is designed for, but adding tiles and walls during gameplay is certainly possible. Tile actors spawned during the game will add their edges to the grid, but with some limitations. They can remove edges (blocking movement) or increase movement cost, but adding tiles will not reconnect tiles or reduce movement cost. But there are many ways to achieve this end. The simplest and most versatile method is to use the toolkit's procedural system for finding walls (check out the third tutorial in the "basics" series for an explanation) combined with the UpdateTilesInRange function. This function will get all tiles in a specified area and update the edges and locations of tiles in that area based on the collision properties of the meshes placed there. These can be any old mesh or actor that can block collision channels, which you can drag onto the scene through any means that you want.

                    Originally posted by Dijon View Post
                    This part still eludes me. I see that FCover is a struct and that FCoverArray is simply an array of these structs. FCover, however, is composed of an int and a float. I can also see that the value for full cover is 0.5 and it's 0.25 for half cover. I still don't see what that float references. I'd assume that each edge of a tile is assigned a value but I can't get further. Can you tell me how the data is stored, and is the data in the edges, or the tile itself? Thanks for all of your help so far. If I'm asking too much, please say so.
                    Yeah, it is not very intuitive. The various values mean the following: The key represents the tile that "has" cover, meaning if a unit stands on this tile the unit might have a reduced chance of being hit by attacks depending on the data in the value on that key. The value contains arrays of cover structs. These structs hold two values. The integer holds the grid index of the tile that a tile has cover towards. The float holds the percent accuracy reduction the cover in this direction provides. This was a bit tricky to describe in words. Let's try a screenshot:



                    The cover here is between tile 1001 and 1002. It is low, so it would provide "half cover" or a 25% reduction in accuracy when attacking units behind the cover.

                    In the GridCoverTiles TMap in the cover component we would find just two keys, 1001 and 1002 (since those are the only tiles on our grid with cover). The value of key 1001 would be an array of one item (since we have cover in just one direction), and this item would be a cover struct with an integer value of 1002 and a float value of 0.25. I'm sure you have more questions, but does this part make sense?

                    Advanced Turn Based Tile Toolkit (Marketplace - Support)

                    Dungeon Crawler Toolkit (Marketplace - Support)

                    Discord

                    Comment


                      I understand the design, but I don't understand how to use it. I'm guessing that there a function that would help, but there are a LOT of functions, so it's a little like trying to find a needle in a haystack,

                      Comment


                        Originally posted by Dijon View Post
                        I understand the design, but I don't understand how to use it. I'm guessing that there a function that would help, but there are a LOT of functions, so it's a little like trying to find a needle in a haystack,
                        If you tell me a specific thing you wish to achieve, then I can show you how to achieve it, and that will hopefully clarify things.
                        Advanced Turn Based Tile Toolkit (Marketplace - Support)

                        Dungeon Crawler Toolkit (Marketplace - Support)

                        Discord

                        Comment


                          If we use the example that was in your previous post, then we have an attacker in 3001, shooting at the player in 1001. Ultimately, I want to know if the player is considered to be in cover from the shooter's perspective. To complicate things, I only want to use the cover around the player's tile (i.e. I don't want to know if there is intervening cover).

                          Comment


                            Originally posted by Dijon View Post
                            If we use the example that was in your previous post, then we have an attacker in 3001, shooting at the player in 1001. Ultimately, I want to know if the player is considered to be in cover from the shooter's perspective. To complicate things, I only want to use the cover around the player's tile (i.e. I don't want to know if there is intervening cover).
                            You're in luck, because that is how cover works by default. You can use the FindTargetCoverRelativeToSource function in the cover component to find the cover value (float) of a tile (the Target) when being targeted by an ability from a different tile (the Source)

                            Here is a quick debugging setup you can use to check the cover values of the tiles you hover over from the tile of the current active unit:

                            Advanced Turn Based Tile Toolkit (Marketplace - Support)

                            Dungeon Crawler Toolkit (Marketplace - Support)

                            Discord

                            Comment


                              I implemented the debug script that you provided and it works wonderfully. I'll need to find where you implement this to see how you handle the mouse clicks -- select unit (may already be selected) click on the laser ability and then click on the target. Thank you very much for taking the time to explain this so fully.

                              Comment


                                Hi Monokkel,

                                We ran into a weird camera issue. The camera zooms and rotates just fine on desktop using the keyboard but attempting to pan the camera makes it jump somewhere else entirely (works fine with touch screen though). If we press End Turn it goes back to centering on the next player.

                                https://imgur.com/a/OjPDjAy

                                We didn't touch the camera controls at all to our knowledge so I am wondering what may have recently caused this. Could it be the UpdateTilesInRange function we implemented so players can spawn new tiles? Something to do with the method you shared for players sharing spaces?

                                Any idea what might be causing this?

                                Thanks

                                Comment

                                Working...
                                X