Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Evening knut, and everyone! Ran into a (possibly noob-ish) road block, I have my game set up to have the activation of atbtt done manually. The goal is to have start of play for placing/spawning actors in a pre-battle phase. When starting the game my issue is that I cannot get controlls to work (aside from clicking my "battle start" button). No camera movement or mouse clicks aside from clicking on hud buttons. Bindings are not the issue, controls work great when atbtt starts and in editor. Just not before. When starting the game (pre-battle) grid camera is possesed but no movement. I have checked out played controller, game mode/state and having no luck. Any ideas? Thanks for your help. Hope all is well and your PhD coming along!

    Comment


      Originally posted by crossmr View Post
      That definitely fixed it. Looks like you were replying while I was editing. With the camera straightened away, I'm in pretty good shape now. Mostly polishing cameras/animations, multiplayer and the touch controls
      Wonderful! Glad my suggestion worked. Was worried that it was something more serious.

      Originally posted by crossmr View Post
      Okay, so this is something specific to the ability? Should this be hooked up in all abilities? When things were breaking because of the death animation, i was getting that error a lot. So I just wonder if we should connect that to all abilities as a matter of good practice.
      Kind of. The grenade ability and several others call on the Activate action of BP_Ability. For abilities that show markers, such as the move ability, I input a unit so that I can check the owner of the unit and make sure the tiles are only displayed to that player. The grenade ability does not have any such markers, so such a check is unnecessary. Because of this I did not pass the unit input, but BP_Ability still tries to check it. A cleaner way to solve this is probably to set up is to add a new check in the activate action of BP_Ability that skips the check if the unit input is invalid.

      Originally posted by crossmr View Post
      One thing I'd like to work on though is shooting out of cover like xcom. Animation wise I'm fine, it's an issue of modifying the trace system and basically making the pawns return a possible "hit" in all squares around them. I think I can work it out, I'm just wondering if you have any standardized functions or things built in for return the grid squares directly around the unit, e.g. return the square 1 space to the right or left.
      Not sure about the best approach for exactly what you're after, but there are a few different ways to get the neighboring tiles. In order of most flexible to most performant they are FindTilesInRange (gets tiles at any range. Can check if they are visible/too high up etc.), GetIndexesInRange (can specify range) and GetNeighboringTiles (only gets neighbors).

      Originally posted by Methosborgoff View Post
      Evening knut, and everyone! Ran into a (possibly noob-ish) road block, I have my game set up to have the activation of atbtt done manually. The goal is to have start of play for placing/spawning actors in a pre-battle phase. When starting the game my issue is that I cannot get controlls to work (aside from clicking my "battle start" button). No camera movement or mouse clicks aside from clicking on hud buttons. Bindings are not the issue, controls work great when atbtt starts and in editor. Just not before. When starting the game (pre-battle) grid camera is possesed but no movement. I have checked out played controller, game mode/state and having no luck. Any ideas? Thanks for your help. Hope all is well and your PhD coming along!
      Thanks! If all you need to do is spawn units before starting the game proper and don't need to do any major alterations to the grid itself you do not need to delay activating the game mode. If you try running the game without any units placed you will see that a special ability will be activated (BP_AbilityBase_Idle) which is simultaneously active for all players. It is a good starting point for an interface to spawn units through. Then when you are ready to start the game you can run BeginTurnBasedCombat from the turn manager.
      The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

      Comment





        Not sure about the best approach for exactly what you're after, but there are a few different ways to get the neighboring tiles. In order of most flexible to most performant they are FindTilesInRange (gets tiles at any range. Can check if they are visible/too high up etc.), GetIndexesInRange (can specify range) and GetNeighboringTiles (only gets neighbors).
        I've attached a grid here to explain what I'm looking for here. Basically I need to first check if a unit is in full cover. If they are, I need to rerun their range trace from the yellow squares. So, from the unit's location I need to be able to detect the north/south/west/east squares (not diagonal ones for this) from the unit's position. If any of those are full cover, then I need to recheck the range trace from the 2 appropriate squares. I could have an array of the 3 squares, remove the one that is opposite the one with full cover, and rerun the range trace from the remaining two and store units that can be hit from those traces in a different array (I need to keep a record of this so that I know which square to animate my unit to step out into to fire).

        On the opposite side of things. If a unit is in full cover, I should have it "occupy" the squares around it (red and yellow) so that when a range trace is done it returns that the unit can be fired at. I'll need to change all my full cover things to block range for this to work properly I believe, which is why I need to do additional traces and cover additional tiles. Do any of these functions which returns tiles return them in a way that I can sort of "see" the grid around me? Like Can I return only the north/west/south/east tiles on a square grid and know which direction they are?
        Attached Files
        Last edited by crossmr; 01-27-2019, 04:07 AM.

        Comment


          Originally posted by Monokkel View Post
          Thanks! If all you need to do is spawn units before starting the game proper and don't need to do any major alterations to the grid itself you do not need to delay activating the game mode. If you try running the game without any units placed you will see that a special ability will be activated (BP_AbilityBase_Idle) which is simultaneously active for all players. It is a good starting point for an interface to spawn units through. Then when you are ready to start the game you can run BeginTurnBasedCombat from the turn manager.
          Works perfectly. I know I have read about that ability from before but I tend to over complicate things. Thanks!!

          Comment


            Originally posted by crossmr View Post
            I've attached a grid here to explain what I'm looking for here. Basically I need to first check if a unit is in full cover. If they are, I need to rerun their range trace from the yellow squares. So, from the unit's location I need to be able to detect the north/south/west/east squares (not diagonal ones for this) from the unit's position. If any of those are full cover, then I need to recheck the range trace from the 2 appropriate squares. I could have an array of the 3 squares, remove the one that is opposite the one with full cover, and rerun the range trace from the remaining two and store units that can be hit from those traces in a different array (I need to keep a record of this so that I know which square to animate my unit to step out into to fire).

            On the opposite side of things. If a unit is in full cover, I should have it "occupy" the squares around it (red and yellow) so that when a range trace is done it returns that the unit can be fired at. I'll need to change all my full cover things to block range for this to work properly I believe, which is why I need to do additional traces and cover additional tiles. Do any of these functions which returns tiles return them in a way that I can sort of "see" the grid around me? Like Can I return only the north/west/south/east tiles on a square grid and know which direction they are?
            I've thought about this a bit in the past, and I think it might be more hassle than it is worth. I'm pretty sure XCOM just checks visibility from behind cover and then just animate the stepping out and leaning. For this you would still want to find the adjacent tiles, of course. By default tiles to the north and south of a tile will have an index +/- 1000, while east and west will be +/- 1. So if your cover has an index 1000 higher or lower than the unit's tile you could get the "yellow" tiles by getting unit index +1 and -1. I would recommend against changing the mechanics based on this. To get this to work for the AI you would need to triple the amount of sight calculations in many cases, for a benefit that will probably be opaque to the player. If you're dead set on implementing this I'll give it a bit more thought, though.

            Originally posted by Methosborgoff View Post

            Works perfectly. I know I have read about that ability from before but I tend to over complicate things. Thanks!!
            Great! I added that ability in the last update precisely for these sorts of use cases, so I'm glad it works
            The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

            Comment


              I've thought about this a bit in the past, and I think it might be more hassle than it is worth. I'm pretty sure XCOM just checks visibility from behind cover and then just animate the stepping out and leaning. For this you would still want to find the adjacent tiles, of course. By default tiles to the north and south of a tile will have an index +/- 1000, while east and west will be +/- 1. So if your cover has an index 1000 higher or lower than the unit's tile you could get the "yellow" tiles by getting unit index +1 and -1. I would recommend against changing the mechanics based on this. To get this to work for the AI you would need to triple the amount of sight calculations in many cases, for a benefit that will probably be opaque to the player. If you're dead set on implementing this I'll give it a bit more thought, though.
              Hmm, okay that sounds a little easier, but I think the xcom check is a little more involved than that. I've attached a diagram.

              if the target is in cover, the side the shot is coming from needs to have an empty (or half cover) square there. Otherwise it needs to be blocked. It's pretty easy to animate the attacker, but I think the function to return valid targets would still need to be modified kind of like this pseudo code:

              if (unitisinfullcover && attackingunitisattackleftorrightside)
              if (pinktileonattackingside == full cover)
              return notavalidtarget

              For the attackers, I think it still needs to be changed. If you allow range trace through cover to return a hit, that means any intervening cover would also allow a range trace, at least the way it's currently set up. Units behind cover who are peaking out shooting can be shot at, but units further back where line of sight is totally blocked by the cover shouldn't be able to be targeted. At least in my mind. Also for attacking units, if their pink squares have full cover in them, they shouldn't be able to lean out that direction which means they shouldn't return a possible hit on that side.

              So the attacking unit also needs a bit similar code:

              if (attackerisinfullcover)
              Check (targetisonleftorrightside)
              if (pinktileonthatside == full cover)
              return notavalidtarget

              So I don't need to run additional line traces, but I do need to run a check on both the target and attacker to make sure they would genuinely have line of sight to each other in this case. If I just allow range through full cover without checking, they could shoot through normal walls, etc. These two bits of pseudo code solve most of the issue. The only remaining issue is the intermediate full cover that would block line of sight, but return a hit on a unit hiding directly behind it. If we allow full cover to let a range trace through, it wouldn't block a shot in that scenario, and if we block it, it wouldn't return hits on units in their cover. Almost need to do something like:

              if (linetracehitsrangeblockingtile)
              check (tilebehindfortargets)
              if (unitexists)
              return validtarget






              Attached Files

              Comment


                Hello Knut. I want to use this system to make a game similar to descent.
                1. Where would I look to find fog of war functions? I would like them to hide units and all hexes in the fog. Would copying the line of sight code and making it hide all gray squares work? I know it's located in the 2d map but the video explaining it doesn't seem to match up with the blueprints anymore and I can't find it.
                2. I want to split movement up. Would any of this be hard using your system?
                  • Move after move
                  • Move after attack
                  • Possibly split actions up between players and ai. So a player could move then another player could attack and then the first player could continue moving/attacking or whatever they would decide to do. Preferably they could do it at the same time should they chose to do so.
                Is this the system for me?

                Comment


                  I've finally had a chance to come back to the touch controls. I haven't exactly worked this out yet, but I think it's a fairly simple fix. Again with my pseudo code:

                  We already have btouch passed along the input route. I think we basically need to do this on bp_ability:

                  coming off "event server interact"

                  if (btouch)
                  if (currentselectedtile == lastselectedtile)
                  execute ability
                  else
                  lastselectedtile = currentselectedtile
                  call hover event

                  we basically need a check on tap to see if we're tapping the same tile we've already selected and then either run hover or execute. I think that would solve input, but there is still a bit of an issue of the jumping around with the swiping and it sometimes jumping when tapping.

                  Comment


                    Ok, some super quick answers. I'm aiming to hand in my PhD thesis on Monday and will be working every hour of the day until then, so I likely won't post here again until Tuesday. But from then on support should quickly become as good and frequent as it was a year ago.

                    crossmr: don't have the time to go into depth on this, sorry. But this is quite different from XCOM, I think. In XCOM cover does not block line of sight, but only provides a cover bonus. If cover blocks line of sight coding this stuff becomes quite a bit more difficult, but your suggestions seem like a good sart. I will begin looking at this in-depth, including the touch control stuff, next week.
                    Originally posted by Senkon View Post
                    Hello Knut. I want to use this system to make a game similar to descent.
                    1. Where would I look to find fog of war functions? I would like them to hide units and all hexes in the fog. Would copying the line of sight code and making it hide all gray squares work? I know it's located in the 2d map but the video explaining it doesn't seem to match up with the blueprints anymore and I can't find it.
                    2. I want to split movement up. Would any of this be hard using your system?
                      • Move after move
                      • Move after attack
                      • Possibly split actions up between players and ai. So a player could move then another player could attack and then the first player could continue moving/attacking or whatever they would decide to do. Preferably they could do it at the same time should they chose to do so.
                    Is this the system for me?
                    Like the board game Descent: Journeys in the dark? I've played that quite a bit. Fun game, and should be doable with the toolkit. The fog of war stuff is located in the 2D map as you guessed. Look at the grid manager 2D child blueprint for the setup of the fog at begin play. What tiles are revealed are stored in a Set there. Then tiles are revealed as part of the movement and BeginPlay of Unit_2D_Hero.

                    Move after move, after attack etc. can be done. It is mainly about choosing the action point costs for your various abilities (in their variables) and disabling use ends turn.

                    Alternating between the player and the AI can be done. You would basically call end faction turn from the turn manager whenever an action is done so that the other faction could act. You would have to change how action points refresh, though, as this is normally done for all units once the initiative order has been looped through once. The biggest challenge here is probably to have the AI treat this intelligently. You would want to have the AI loop through all possible actions for all available units to figure out not only what ability is the best to use, but what unit should act now. Can certainly be done, but you would have to keep this in mind while designing the AssessAbilityValue events for abilities, as well as possibly run the code over multiple ticks to prevent frame drops while calculating if you have large AI teams. Hope this is enough to get started on. Post here next week with your progress and I'll give you a more in-depth answer.
                    The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                    Comment


                      Hi Knut.

                      Trying to load your more advanced UI(like the one in Jungleraid) in the example map but can't seem to find it and your world settings look the same. Any idea? Thanks.

                      Comment


                        Monokkel No worries, get your PhD finished up, when you get back, I'll attach an image someone uploaded which explains how LoS and cover work in Xcom: Enemy Unknown. As I suggested earlier, it seems that full cover blocks LoS, but only when the target or attacker are unable to step into an adjacent square to get LoS. So they can shoot around corners, but if you're in the middle of a 3 tile wall, there is no way for you to shoot through it. Also if the unit is further back, they can't get shot. https://i.imgur.com/eqnBg.gif seems like the real key difference between xcom and your kit is the ability to step out.

                        Started the first bit of work on touch controls, in the first image I added a little bit of code to BP_Ability this code checks if touch controls are being used, and if they are, it does the click check that I was talking about. I've also disconnected tick in the playercontroller for that mouse hover stuff. This also includes the changes I mentioned earlier. I've noticed the following (very odd) behaviour:

                        1. When Shooting, you can now click the unit once, and it will "hover" on that unit. You can now easily check the hit percentage before firing. However to actually fire, you still need to multi-tap. I have no idea why. By all logic, the next tap should try to run execute but it isn't, you need to tap 2-3 times before it triggers.

                        2. Moving still works on a single click. Again, not quite what I'd expect here. Sprint, executes after a single tap. I was expect it to select the tile, then wait for a second tap to actually execute, but it does not. Edit: Nevermind, I just realized that Sprint has an override for server interact, I'll have to change that one there.

                        a little more testing and I've gotten the following results: I tried rewiring all kinds of different things to see if anything helped this along, the answer was no. I tried adding a similar check in to the sprint ability but it didn't seem to help, all it did was hover for a split second and then require 2-3 furious taps before it'd move. This may be related to some "jumping" of the location. It's hard to print location data on an android phone, maybe I'll have to rig up a debugging UI for this, but I am getting the sense that the location is jumping around. This may be related to the click attempt function in BP_AbilityBase. If the check hovered location fails (which I've ticked the touch box for) it returns a click invalid with a location of 0,0,0. Also, I wonder if you tap very fast, if the rest of the function works correctly. If you press touch, it's supposed to (if not released) run a check for the location and set that, so that it's available on release. I wonder if there could be a race condition here where if you tap too quickly, if the code doesn't properly finish checking the location of your tap and may return an old location or 0,0,0 in some cases.
                        Attached Files
                        Last edited by crossmr; 01-31-2019, 10:54 PM.

                        Comment


                          Monokkel When trying to organize the folders I get an error about a private graph. I'm just trying to either put the main ATBTT folder into another folder or rename it but it won't let me do either without breaking it. Every time I try to allow it to find the chains it just fails and cycles the same error. Any way to resolve this?
                          Last edited by OperatorCrux; 01-31-2019, 11:44 PM.

                          Comment


                            Good luck with your PhD Knut! Looking forward to more ATTBT updates when you're more free, and +1 from me if the Cover systems could be expanded on, like what crossmr's XCOM mechanics describe.
                            Artstation | 3D Artist | Krakow

                            Comment


                              crossmr Tagging you since perhaps you'll know, and Knut's busy atm...

                              Would you (or anyone reading this) know how to create simple destructible objects in the grid's current version?

                              1-I started with a Grid Actor as per the Teletransporter video shows, and notice my Grid Actor contains no variables whereas the video's version has quite a bunch. I assume this too has been changed? Were they moved into a BPI?

                              Click image for larger version

Name:	BP1.jpg
Views:	78
Size:	47.7 KB
ID:	1580168

                              2-I saw this comment about someone wanting the same thing from 8 months ago, but I'm having trouble understanding it:

                              " Hey man I realy love your work and I´m trying to do a game, where I need to destroy Items, which are on the ground, I allready have a Blueprint out of the Anim_Auto BP, which can be attacked, but dont attacks back/moves etc., the problem is that the game chooses it as a "playable enemy", so the camera switches for about a secound to that Item and then back to the player and I dont find how to change it. Maybe you could help me, or just do a small video on how to make a attackable item "

                              I tried looking for this "Anim_Auto" bp he speaks of, but nothing is showing up:

                              Click image for larger version

Name:	BP2.jpg
Views:	80
Size:	74.2 KB
ID:	1580167

                              Any thoughts on the matter?
                              Artstation | 3D Artist | Krakow

                              Comment


                                Ok, some super quick support now. Only the stuff I can answer immediately without doing testing or putting a lot of thought into it. Sorry about that. As mentioned, after I hand in my thesis this week I'll return to your questions with more in-depth answers.

                                Originally posted by Juxtapox View Post
                                Hi Knut.

                                Trying to load your more advanced UI(like the one in Jungleraid) in the example map but can't seem to find it and your world settings look the same. Any idea? Thanks.
                                Check the UpdateAbilityBox function in BP_Unit. It is called by an action as part of the select actor code.

                                Originally posted by crossmr View Post
                                Monokkel No worries, get your PhD finished up, when you get back, I'll attach an image someone uploaded which explains how LoS and cover work in Xcom: Enemy Unknown. As I suggested earlier, it seems that full cover blocks LoS, but only when the target or attacker are unable to step into an adjacent square to get LoS. So they can shoot around corners, but if you're in the middle of a 3 tile wall, there is no way for you to shoot through it. Also if the unit is further back, they can't get shot. https://i.imgur.com/eqnBg.gif seems like the real key difference between xcom and your kit is the ability to step out.

                                Started the first bit of work on touch controls, in the first image I added a little bit of code to BP_Ability this code checks if touch controls are being used, and if they are, it does the click check that I was talking about. I've also disconnected tick in the playercontroller for that mouse hover stuff. This also includes the changes I mentioned earlier. I've noticed the following (very odd) behaviour:

                                1. When Shooting, you can now click the unit once, and it will "hover" on that unit. You can now easily check the hit percentage before firing. However to actually fire, you still need to multi-tap. I have no idea why. By all logic, the next tap should try to run execute but it isn't, you need to tap 2-3 times before it triggers.

                                2. Moving still works on a single click. Again, not quite what I'd expect here. Sprint, executes after a single tap. I was expect it to select the tile, then wait for a second tap to actually execute, but it does not. Edit: Nevermind, I just realized that Sprint has an override for server interact, I'll have to change that one there.

                                a little more testing and I've gotten the following results: I tried rewiring all kinds of different things to see if anything helped this along, the answer was no. I tried adding a similar check in to the sprint ability but it didn't seem to help, all it did was hover for a split second and then require 2-3 furious taps before it'd move. This may be related to some "jumping" of the location. It's hard to print location data on an android phone, maybe I'll have to rig up a debugging UI for this, but I am getting the sense that the location is jumping around. This may be related to the click attempt function in BP_AbilityBase. If the check hovered location fails (which I've ticked the touch box for) it returns a click invalid with a location of 0,0,0. Also, I wonder if you tap very fast, if the rest of the function works correctly. If you press touch, it's supposed to (if not released) run a check for the location and set that, so that it's available on release. I wonder if there could be a race condition here where if you tap too quickly, if the code doesn't properly finish checking the location of your tap and may return an old location or 0,0,0 in some cases.
                                Ok, thanks for the continued reporting. Gives me a lot to go on when I get to check this. Have no suggestions off the top of my head, I'm afraid.

                                Originally posted by OperatorCrux View Post
                                Monokkel When trying to organize the folders I get an error about a private graph. I'm just trying to either put the main ATBTT folder into another folder or rename it but it won't let me do either without breaking it. Every time I try to allow it to find the chains it just fails and cycles the same error. Any way to resolve this?
                                Hmm, well that is annoying. Those sorts of issues are always a pain. Have you tried fixing up redirects in the folders?

                                Originally posted by Justo View Post
                                Good luck with your PhD Knut! Looking forward to more ATTBT updates when you're more free, and +1 from me if the Cover systems could be expanded on, like what crossmr's XCOM mechanics describe.
                                Thanks and noted

                                Originally posted by Justo View Post
                                crossmr Tagging you since perhaps you'll know, and Knut's busy atm...

                                Would you (or anyone reading this) know how to create simple destructible objects in the grid's current version?

                                1-I started with a Grid Actor as per the Teletransporter video shows, and notice my Grid Actor contains no variables whereas the video's version has quite a bunch. I assume this too has been changed? Were they moved into a BPI?

                                Click image for larger version

Name:	BP1.jpg
Views:	78
Size:	47.7 KB
ID:	1580168

                                2-I saw this comment about someone wanting the same thing from 8 months ago, but I'm having trouble understanding it:

                                " Hey man I realy love your work and I´m trying to do a game, where I need to destroy Items, which are on the ground, I allready have a Blueprint out of the Anim_Auto BP, which can be attacked, but dont attacks back/moves etc., the problem is that the game chooses it as a "playable enemy", so the camera switches for about a secound to that Item and then back to the player and I dont find how to change it. Maybe you could help me, or just do a small video on how to make a attackable item "

                                I tried looking for this "Anim_Auto" bp he speaks of, but nothing is showing up:

                                Click image for larger version

Name:	BP2.jpg
Views:	80
Size:	74.2 KB
ID:	1580167

                                Any thoughts on the matter?
                                I changed the name of BP_Unit_Anim_Auto to BP_Unit_Anim_Debug to make it clear to people that it is just intended for debugging and not a good starting point for your own units (for that I generally recommend duplicating BP_Unit_Anim). Could you be more specific about your issue with destructible terrain? At what step are you getting stumped?
                                The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                                Comment

                                Working...
                                X