Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    I just want to let you know Knut the thing I'm looking forward to the most today is getting home and watching them juicy videos you're uploading right now *drool slurps sounds* ...
    Artstation | 3D Artist | Krakow

    Comment


      Originally posted by A-J-K View Post

      Nice!
      Just a little question, your hex tile toolkit looks kinda Mutan Year Zero / Xcom 2 style when it comes to the actual game play "mechanic". Is it posible to change this mechanic, to a more kinda RTS style gameplay? What i basically mean is, free movent of lets say 5 or 10 units through the hex or quad tiles, not this i make a move... the AI makes a move mechanic etc... If you know what i mean... The same guestion goes for the multiplayer mode.
      The toolkit is designed with turn based games in mind. If you want to make a real time game you should still be able to use some of the code for things like displaying a grid and interacting with it, but you would have to throw out and remake large parts of the code. I can only really recommend my toolkit if you intend to make a turn based game.

      Originally posted by Justo View Post
      I just want to let you know Knut the thing I'm looking forward to the most today is getting home and watching them juicy videos you're uploading right now *drool slurps sounds* ...
      Glad to hear it! Three new tutorials are up now. All of them about changing the appearance and animations of units:





      The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

      Comment


        Thank you for posting these so fast Knut. I assumed you'd start working on em the weekend and end them by next week. Also, appreciate the extra effort in making those video thumbnails (: looking good.
        Artstation | 3D Artist | Krakow

        Comment


          Thank's
          Originally posted by Monokkel View Post

          I see, that should not be too hard to implement. Basically in the abilities you use, when it normally calls for just the current unit to attack you would also call on the enemy unit to attack back (provided it lives). There might be some complications I'm not seeing, though. I'm busy tonight, but I'll try to look into it tomorrow.

          Edit: Managed a quick test. Made a copy of BP_Ability_MoveAttack and added this to the end of the ExecuteAbility of that ability. Should be a good starting point:

          Thank's for your awesome video.

          Concerning my demand I try what you recommended me. But I think I'm a noob XD. Because is not working for me, maybe I do something wrong.

          I have duplicated BP_Ability_MoveAttack and copying the same nodes you provided me.

          Does I need to delete the original BP_Ability_MoveAttack and replace the reference ? Execute Ability on the original Blueprint have two branch and I only have one is normal ?

          Sorry for my missunderstanding

          Click image for larger version  Name:	BP_Ability_MoveAttackBack.png Views:	1 Size:	136.0 KB ID:	1588708


          Comment


            Originally posted by Justo View Post
            Thank you for posting these so fast Knut. I assumed you'd start working on em the weekend and end them by next week. Also, appreciate the extra effort in making those video thumbnails (: looking good.
            No worries I can be pretty efficient when I'm able to set aside the time. Glad you like the thumbnails. Thought I should have some way of differentiating the old and the new videos at a glance, and tiny screenshots of the editor aren't very exciting or informative.

            Originally posted by MarsOdysseus View Post
            Thank's

            Thank's for your awesome video.

            Concerning my demand I try what you recommended me. But I think I'm a noob XD. Because is not working for me, maybe I do something wrong.

            I have duplicated BP_Ability_MoveAttack and copying the same nodes you provided me.

            Does I need to delete the original BP_Ability_MoveAttack and replace the reference ? Execute Ability on the original Blueprint have two branch and I only have one is normal ?

            Sorry for my missunderstanding

            Click image for larger version Name:	BP_Ability_MoveAttackBack.png Views:	1 Size:	136.0 KB ID:	1588708

            No problem, I could have been clearer. The idea behind this modification is that first you run the code that damages the enemy (and queue's the current unit's attack action) and after that you do the same thing, but with the roles reversed. So you need to do first what is done in MoveAttack ususally and then do the opposite. Here is a pastebin of the whole function.

            Also, you need to select this ability as the default ability of your unit's or they will continue to use the old one.
            The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

            Comment


              Thank you I have a better understanding now, and it work almost perfect. But I need to change two things to be perfect

              1. First I would like the two unit attack simultaneously (Or Simulate) because in the current state, the first unit attacking can kill the opponent before he attack back. What I wan is the two unit attack simultanously so if two unit have same life/Attack they die together.

              2. The second thing is about ranged unit that can attack from distanced tiles. In the current state a ranged unit take attack back damage to, while there are not in the in the melle range of the opponent. I don't know if is clear, I'm not english but to be simple as I can a ranged unit dont take attack back damage unless he is in the melle range of the opponent unit (1 square arround this unit). In the case where a Ranged unit attack another Ranged they don't take attack back damage too unless again there are in the mele range of the unit, again for me melle range is 1 square arround the unit.

              I hope I was clear. I know it was better if I can find solution myself but I have no dev background so it's litte hard for me to understand everything on blueprint.

              Comment


                Originally posted by MarsOdysseus View Post
                Thank you I have a better understanding now, and it work almost perfect. But I need to change two things to be perfect

                1. First I would like the two unit attack simultaneously (Or Simulate) because in the current state, the first unit attacking can kill the opponent before he attack back. What I wan is the two unit attack simultanously so if two unit have same life/Attack they die together.

                2. The second thing is about ranged unit that can attack from distanced tiles. In the current state a ranged unit take attack back damage to, while there are not in the in the melle range of the opponent. I don't know if is clear, I'm not english but to be simple as I can a ranged unit dont take attack back damage unless he is in the melle range of the opponent unit (1 square arround this unit). In the case where a Ranged unit attack another Ranged they don't take attack back damage too unless again there are in the mele range of the unit, again for me melle range is 1 square arround the unit.

                I hope I was clear. I know it was better if I can find solution myself but I have no dev background so it's litte hard for me to understand everything on blueprint.

                Ok, I see. The first question is pretty tricky, but the second is easy. For only allowing counter-attacks for units with a range of 1, all you need to do is to add a branch that checks that the range of the target unit is equal to 1. If the range of the unit does not matter, but rather what the distance between the units is, you can use the GetDistanceInTiles... function from BP_GridManager.

                So for your first question, it is more difficult because you are breaking up the turn structure of the game somewhat. I did some testing and managed to create a starting point for you. But know that you're walking a bit into uncharted territory here.

                BP_Ability_MoveAttackBack: ExecuteAbility()

                BP_Ability_MoveAttackBack: Attack()
                The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                Comment


                  MarsOdysseus I think Monokkel meant the "FindDistanceIinTilesBetweenIndexes" function (typo in the Iin Knut) rather than "GetDistanceInTiles". I couldn't find anything at least with the "get distance" words.



                  Alright, so I finally was able to make some progress, thanks to your last videos Knut (: I will ask you Qs about different topics. You dont have to quote me if it's tiring to deal with this forums' post interface either, just reference the Q number and bam!

                  So my destructible mesh is a BP_Unit_Anim duplicate and can now take damage, be destroyed and not take part in the initiative order and combat.

                  1-Is this how you would go about creating these meshes for destructible terrain? Walls, roofs, trees, vehicles, etc? You mentioned before that doing this as a child of BP_GridActor would give one more control at the cost of setting some things up first. What sort of benefits did you mean by control?

                  Again awesome videos. It's all valuable info! Here are some notes that I'd like to talk and ask you about. Regarding collisions:

                  Path Trace: At runtime, determines what tiles can be walked on. The trace is cast once per tile from above. If anything blocks its way, the tile is not walkable by units.
                  Range Trace: Determines line of sight - what tiles are eligible for an attack opportunity. It is cast from the attacker's tile. If units are set to Block it, they would most likely block themselves during the trace and end up with no targets.
                  Cover Trace: At runtime, determines what objects can grant Cover (advanced grid settings).
                  Wall Trace: Allows the grid to automatically detect what walls should cover paths as intended. Needs the Trace for Walls grid setting to be active.

                  2-Where are these traces' logic located at, and is it possible I can see in my editor a visual representation of the lines for understanding these better (and debugging)? This could potentially answer Qs 3,4 & 5.

                  3-The default tiles in the grid manager have a Block behaviour on Path Trace. Why is it that the tile is still walkable? Is it because the Path Trace treats the Default Tile as the end point of its trace, acknowledging it is the Gridmanager's tile and thus is free to be walkable?

                  4-Your wall meshes are set to block Range Trace for obvious reasons. Is it correct to say that if a wall blocks this trace, the trace will not be allowed to keep going in that direction, say for example, two tiles behind that wall?

                  5-From where to where are the Cover Traces cast?

                  6-How hard do you think it would be to implement vertical grids? As in, grids projected on walls haha. If there is enough space and after a certain height, certain units can just walk on that. Just want to pick your brain on it and hear your thoughts.

                  7-I think the next challenge I'll work towards is interactive terrain meshes, just like xcom soldiers can open/close doors when they're one tile away from them. I'll also work towards a bit more complex interactions, like making my unit move in these contextual actions: for example, enter a phone booth and close the door, or get into a vehicle, or climb up/down a tree. Any words of advice as to where should I start digging my nose into for this? I'm expecting I'll have to create these as BP_Abilities like in your advanced example, then build a system that checks when units are near the correct objects to be able to perform this ability.

                  Anyway, keep doing cool a$s mothafukkin logic Knut. Also +1 from me to focus more on advanced/firaxisxcom-like features and video explanations!
                  Last edited by Justo; 02-28-2019, 07:58 AM.
                  Artstation | 3D Artist | Krakow

                  Comment


                    Originally posted by Justo View Post
                    MarsOdysseus I think Monokkel meant the "FindDistanceIinTilesBetweenIndexes" function (typo in the Iin Knut) rather than "GetDistanceInTiles". I couldn't find anything at least with the "get distance" words.
                    Indeed, thanks for the correction. I was just going by memory there.

                    Originally posted by Justo View Post
                    Alright, so I finally was able to make some progress, thanks to your last videos Knut (: I will ask you Qs about different topics. You dont have to quote me if it's tiring to deal with this forums' post interface either, just reference the Q number and bam!
                    Very thoughtful, Justo, but not to worry. I like to keep my responses tidy that way.

                    Originally posted by Justo View Post
                    [So my destructible mesh is a BP_Unit_Anim duplicate and can now take damage, be destroyed and not take part in the initiative order and combat.

                    1-Is this how you would go about creating these meshes for destructible terrain? Walls, roofs, trees, vehicles, etc? You mentioned before that doing this as a child of BP_GridActor would give one more control at the cost of setting some things up first. What sort of benefits did you mean by control?
                    It depends a lot on your use case. If you just want some explosive barrels and boxes here and there I think it works pretty well, since units can already be targeted and damaged by default. For something more involved, though, with multi-tile strucutres or things that affect pathfinding beyond blocking an entire tile (such as walls between tiles etc) you would probably want to make something more from scratch. In that case I would consider creating a new actor based off BP_GridActor. What I mean by control is that you can just add the stuff you want, and do not need to inherit all the stuff you don't need from BP_Unit, which you then need to override in various ways (as in the initiative sorting function).

                    It might actually be good to base them off BP_GA_Tile. That way you can specify what edges the tile blocks and you already have variables where all such edge modifications are stored. On destruction these tiles could look at their edge variables and try to re-add any edges they had previously blocked. This would require adding new code to allow such tiles to be targeted, though. Maybe a new TMap in the grid manager storing the index of each destructible tile and additions to all damaging abilities where a destructible tile is targeted if the hovered tile is not found in GridUnits, but does exist in GridDestructibles. Those are my first ideas, anyway.

                    Originally posted by Justo View Post
                    Path Trace: At runtime, determines what tiles can be walked on. The trace is cast once per tile from above. If anything blocks its way, the tile is not walkable by units.
                    Just the opposite, actually. If the trace is blocked it is treated as walkable. If it is not blocked it cannot be walked on.

                    Originally posted by Justo View Post
                    Range Trace: Determines line of sight - what tiles are eligible for an attack opportunity. It is cast from the attacker's tile. If units are set to Block it, they would most likely block themselves during the trace and end up with no targets.
                    Cover Trace: At runtime, determines what objects can grant Cover (advanced grid settings).
                    Wall Trace: Allows the grid to automatically detect what walls should cover paths as intended. Needs the Trace for Walls grid setting to be active.
                    All of these are correct.

                    Originally posted by Justo View Post
                    2-Where are these traces' logic located at, and is it possible I can see in my editor a visual representation of the lines for understanding these better (and debugging)? This could potentially answer Qs 3,4 & 5.
                    In a few different places. PathTrace and WallTrace are used mostly in SetupGridArrays in BP_GridManager, which is run at the start of the game. PathTrace mainly in the CreateGridLocations function. WallTrace in the SetEdgesBasedOnTerrain function. CoverTrace is used in the BP_CoverSystem component and RangeTrace is used mostly in the FindTilesInRange and FindUnitsInRange functions, which are generally called by abilities. For all of these traces you can set the DrawDebugType input in the LineTraceByChannel function to ForDuration or Persistent to see exactly where they fire and what they hit.

                    Originally posted by Justo View Post
                    3-The default tiles in the grid manager have a Block behaviour on Path Trace. Why is it that the tile is still walkable? Is it because the Path Trace treats the Default Tile as the end point of its trace, acknowledging it is the Gridmanager's tile and thus is free to be walkable?
                    See above, it is the opposite. They can be walked on because they are hit, not the other way around.

                    Originally posted by Justo View Post
                    4-Your wall meshes are set to block Range Trace for obvious reasons. Is it correct to say that if a wall blocks this trace, the trace will not be allowed to keep going in that direction, say for example, two tiles behind that wall?
                    Yep. If RangeTrace is blocked at any point between a source and a target it returns true and prevents that tile from being seen.

                    Originally posted by Justo View Post
                    5-From where to where are the Cover Traces cast?
                    Again, in BP_CoverSystem. By default they are run in all four cardinal directions twice. Once at HalfCoverHeight and once at FullCoverHeight, which are defined in BP_CoverSystem.

                    Originally posted by Justo View Post
                    6-How hard do you think it would be to implement vertical grids? As in, grids projected on walls haha. If there is enough space and after a certain height, certain units can just walk on that. Just want to pick your brain on it and hear your thoughts.
                    Like walking up walls? Pretty tricky. That all tiles are angled the same way is an assumption built into the toolkit. This is something I might revisit in the future, though.

                    Originally posted by Justo View Post
                    7-I think the next challenge I'll work towards is interactive terrain meshes, just like xcom soldiers can open/close doors when they're one tile away from them. I'll also work towards a bit more complex interactions, like making my unit move in these contextual actions: for example, enter a phone booth and close the door, or get into a vehicle, or climb up/down a tree. Any words of advice as to where should I start digging my nose into for this? I'm expecting I'll have to create these as BP_Abilities like in your advanced example, then build a system that checks when units are near the correct objects to be able to perform this ability.
                    I recommend checking out the 2D example Hydra's Lair. In this I have objects that can be interacted with, including potions, weapons and switches for lighting torches/opening doors.

                    Originally posted by Justo View Post
                    Anyway, keep doing cool a$s mothafukkin logic Knut. Also +1 from me to focus more on advanced/firaxisxcom-like features and video explanations!
                    Thanks! Lots of plans both for features and documentation. My next videos will likely be about the sort of stuff I have discussed in this post. Namely how the various grids work and how walkability, edges and pathfinding works. As for features they will likely be driven by the sort of stuff I need for my own game, which I am working on at the moment. It is pretty different from XCOM, but it does use cover as well as very complex ability interactions.
                    The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                    Comment


                      Thanks for the in-depth response Knut The sharing of your wisdom is very much appreciated. I think I'll start writing up some docs with all the info you're giving me of the ATBTT's functionality. You've given me a lot to work with, so I'll start digging around and studying some more now.
                      Artstation | 3D Artist | Krakow

                      Comment


                        Hello!
                        Me and my friend are developing a small turn based strategy game for our college project(with hopes to turn it into a fully fledged game afterwards) and this tool kit has been so much help!

                        We are currently working on the abilities for our different characters attacks.
                        For each attack we are using the laser ability as a base in order to easily implement hit chances etc.

                        We have come across a problem however, we are wanting to do an AP Cost check within the ability system blueprint however, we are unsure how to relay the AP Cost back to the ability system as we can't find a variable for it. We are wondering how we would do this or if there is another way to implement it?

                        Comment


                          Hello everyone,

                          First of all, thanks Monokkel for this awesome toolkit. I've bought it a few weeks ago and now proceed to use it.

                          For this moment I have a problem with spawning AI units during gameplay. I have two types of AI-controlled units: 1) Enemy ("E") units move in random direction every turn (this is their default ability) and 2) Spawner ("S") spawns several "E"-units randomly over the grid every turn and puts them at the end of "Enemy" faction in initiative order. The order of the initiative is described below:
                          1) Player takes his turn and moves in selected direction;
                          2) The Spawner spawns several additional Enemies and puts them at the end of "Enemy" faction in initiative order;
                          3) All non-additional Enemies take their turns and move in random direction without delay between them. Then all additional Enemies become non-additional.

                          The problem is that spawned units have no default ability though it is clearly set up in "E"-unit attributes.

                          If it won't bother you, could you write a short tutorial about spawning units during gameplay? It would help a lot.

                          Thanks again! (and sorry for my broken English)

                          Comment


                            Originally posted by Justo View Post
                            Thanks for the in-depth response Knut The sharing of your wisdom is very much appreciated. I think I'll start writing up some docs with all the info you're giving me of the ATBTT's functionality. You've given me a lot to work with, so I'll start digging around and studying some more now.
                            Best of luck!

                            Originally posted by OngoGablogian_ View Post
                            Hello!
                            Me and my friend are developing a small turn based strategy game for our college project(with hopes to turn it into a fully fledged game afterwards) and this tool kit has been so much help!

                            We are currently working on the abilities for our different characters attacks.
                            For each attack we are using the laser ability as a base in order to easily implement hit chances etc.

                            We have come across a problem however, we are wanting to do an AP Cost check within the ability system blueprint however, we are unsure how to relay the AP Cost back to the ability system as we can't find a variable for it. We are wondering how we would do this or if there is another way to implement it?
                            So you're trying to access the AP cost of a specific ability from within BP_AbilitySystem? You should be able to find it either in the defaults of the approriate item in the Abilities array or specific ability in the AbilityRefs array.

                            Originally posted by Crusader_91 View Post
                            Hello everyone,

                            First of all, thanks Monokkel for this awesome toolkit. I've bought it a few weeks ago and now proceed to use it.

                            For this moment I have a problem with spawning AI units during gameplay. I have two types of AI-controlled units: 1) Enemy ("E") units move in random direction every turn (this is their default ability) and 2) Spawner ("S") spawns several "E"-units randomly over the grid every turn and puts them at the end of "Enemy" faction in initiative order. The order of the initiative is described below:
                            1) Player takes his turn and moves in selected direction;
                            2) The Spawner spawns several additional Enemies and puts them at the end of "Enemy" faction in initiative order;
                            3) All non-additional Enemies take their turns and move in random direction without delay between them. Then all additional Enemies become non-additional.

                            The problem is that spawned units have no default ability though it is clearly set up in "E"-unit attributes.

                            If it won't bother you, could you write a short tutorial about spawning units during gameplay? It would help a lot.

                            Thanks again! (and sorry for my broken English)
                            There are some known issues with unit spawning that will be fixed in the next update. Here is the updated HandleUnitSpawning function in BP_Unit. I've tested out spawning AI units now, both using just the default ability and the ability system and it seems to work on my end (with this modified function). I used some very basic debug unit spawning here, like so:



                            Let me know if chaning the function works for your setup. If not, could you paste some screenshots of your unit spawning code and tell me what error you are seeing? How do you know that the problem is caused by the ability not being spawned?

                            Spawning units is one of those questions that keeps coming up, so I agree I should add some support for this. It might be better to add an example map over a tutorial video, though. I'll put it high on my list.
                            The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                            Comment


                              It works perfectly now! Thank you very much!

                              Comment


                                I threw together a quick demo of the VR map included with the toolkit based on a request on the store page. For those interested:



                                Originally posted by Crusader_91 View Post
                                It works perfectly now! Thank you very much!
                                Good to hear
                                The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                                Comment

                                Working...
                                X