# \[SUPPORT\] Advanced Turn Based Tile Toolkit

**URL:** <https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930>\
**Category:** UE Marketplace\
**Tags:** unreal-engine, fab\
**Created:** [February 26, 2015, 8:30am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930 "2015-02-26T08:30:16Z")\
**Posts on this page:** 20\
**Page:** 168

<div class="post-metadata">

**Author:** ![ser.man94](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ser.man94](https://forums.unrealengine.com/u/ser.man94)\
**Post date:** [May 21, 2020, 4:45am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3436 "2020-05-21T04:45:03Z")

</div>

no  
1 you show but not ful description i not found the files from descriptin. i atach te image.  
and the second is to enemy make a return atack i one turn.  
i ad the video with fight on hmm3. [https://www.youtube.com/watch?v=KB9Q7RV9oAs](https://www.youtube.com/watch?v=KB9Q7RV9oAs)

---

<div class="post-metadata">

**Author:** ![Luna2442](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luna2442](https://forums.unrealengine.com/u/Luna2442)\
**Post date:** [May 22, 2020, 12:30am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3438 "2020-05-22T00:30:24Z")

</div>

I’m sorry if I’m replying in the wrong place!

Thanks for your reply. That movement cost type is much closer to what I wanted, thank you.

The cost of movement isn’t so much the problem like you said. A unit in my game should be able to move freely at the cost of AP without ending their turn. For example, I could move, cast an ability, and move again if I have AP left over, even if its 1 tile of AP left. I would like to convert the move\_attack ability but maybe there’s an easier way to set this up?

I want it to be the default action (or unit ability) whenever you select a unit without having it in the ability bar.

​​​​​​​Edit: Looks like that movement type was enough! For some reason though when I get down to 2AP I lose the ability to move, even though I should have 2 tiles left. Must be some conditional somewhere I haven’t found yet!

---

<div class="post-metadata">

**Author:** ![Reinhart\_x](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Reinhart\_x](https://forums.unrealengine.com/u/Reinhart_x)\
**Post date:** [May 22, 2020, 4:42am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3439 "2020-05-22T04:42:35Z")

</div>

> [@](#):
>
> Thanks, I think I mostly get it now. This mostly comes down to array manipulation of the InitiativeOrder array. The devil is in the details, of course. Before I jump into this (will take some work) let me try to describe what you are saying back to you, so I’m sure I’ve got it.
> 
> Players will have different units. Some of these will be individual units not part of a troop (like the green units above), while others belong to a troop (the aliens). At the start of a player turn you choose what unit to move. After the unit has done its action, if the unit is an individual unit the turn will pass to the next player. If it is part of a group the turn will pass to the next unit in the group, controlled by the same player, until the last unit in the troop has completed its action, at which point the turn is passed to the next player. Is this the right interpretation?
> 
> A follow-up to that: should a player be able to choose the same unit or troop again and again, or do they have to exhaust all units and troops before they are allowed to choose freely on their next turn?
> 
> Also, love the paint job on the debug wall tiles 😉

Easiest paint job ever, just had to turn the camera and it’s like magic! Haha 😃

You nailed it, man. What you described with the solo units and the groups is what I meant and pretty much exactly what I’m going for!

As for the follow up question, if possible I’d like to be able to limit which units take turns instead of letting them be picked freely when the turn is passed to the player. The idea is that the turns would already be predetermined in a given round and then play out in order. I’ll lay out the game sequence just to give an idea of how I’d ideally like things to run.

1. Game Start
2. Players place their team’s units where they want them to start within their home base hexes
3. Some sort of dice roll RNG to decide who goes first in the round
4. Round 1 turn order phase: players will have 3 turns in a round and will pick either a solo unit or a group unit to take those turns in a set order of 1, 2, and 3. The solo unit or group picked for these turns can be the same for all 3 turns. This is where I was thinking to set the initiative since we’d know who is going first and then it’s just a matter of bouncing back and forth between units 1, 2, and 3 of either player. Once both players have selected the units for turns 1, 2, and 3, the turns begin.
5. Player 1 turn 1
6. Player 2 turn 1
7. Player 1 turn 2
8. Player 2 turn 2
9. Player 1 turn 3
10. Player 2 turn 3
11. Round ends
12. Repeat steps 3 to 11 until game has ended

So in theory it doesn’t seem that complicated, but I’m not sure how intricate things would need to be in a setup like this with the toolkit. If it’s too tricky I can always try to make something else work, but let me know what you think. Thanks!

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [May 23, 2020, 4:00pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3440 "2020-05-23T16:00:29Z")

</div>

> [@ser.man94](#):
>
> no  
> 1 you show but not ful description i not found the files from descriptin. i atach te image.  
> and the second is to enemy make a return atack i one turn.  
> i ad the video with fight on hmm3. [https://www.youtube.com/watch?v=KB9Q7RV9oAs](https://www.youtube.com/watch?v=KB9Q7RV9oAs)

​​​​​​

What files are you struggling to find? For counter-attacks this has been discussed a while ago in this thread. Try to replicate what @ made and see if it works for you. If you have any issues, get back to me. The start of our discussion starts [here](https://forums.unrealengine.com/unreal-engine/marketplace/31005-support-advanced-turn-based-tile-toolkit?p=1623744#post1623744). Then it goes back and forth for a few pages.

> [@Luna2442](#):
>
> I’m sorry if I’m replying in the wrong place!
> 
> Thanks for your reply. That movement cost type is much closer to what I wanted, thank you.
> 
> The cost of movement isn’t so much the problem like you said. A unit in my game should be able to move freely at the cost of AP without ending their turn. For example, I could move, cast an ability, and move again if I have AP left over, even if its 1 tile of AP left. I would like to convert the move\_attack ability but maybe there’s an easier way to set this up?
> 
> I want it to be the default action (or unit ability) whenever you select a unit without having it in the ability bar.
> 
> Edit: Looks like that movement type was enough! For some reason though when I get down to 2AP I lose the ability to move, even though I should have 2 tiles left. Must be some conditional somewhere I haven’t found yet!

Glad to hear that was enough! The 2AP issue is probably because of specifically how BP\_MoveAttack is set up. If you check the PlayerActivate event you’ll see how it switches based on the owning unit’s AP. This is the bit you will need to modify, I believe.

> [@Reinhart\_x](#):
>
> Easiest paint job ever, just had to turn the camera and it’s like magic! Haha 😃

Really, just the angle? Well, my color vision was never great.

> [@Reinhart\_x](#):
>
> You nailed it, man. What you described with the solo units and the groups is what I meant and pretty much exactly what I’m going for!
> 
> As for the follow up question, if possible I’d like to be able to limit which units take turns instead of letting them be picked freely when the turn is passed to the player. The idea is that the turns would already be predetermined in a given round and then play out in order. I’ll lay out the game sequence just to give an idea of how I’d ideally like things to run.
> 
> 1. Game Start
> 2. Players place their team’s units where they want them to start within their home base hexes
> 3. Some sort of dice roll RNG to decide who goes first in the round
> 4. Round 1 turn order phase: players will have 3 turns in a round and will pick either a solo unit or a group unit to take those turns in a set order of 1, 2, and 3. The solo unit or group picked for these turns can be the same for all 3 turns. This is where I was thinking to set the initiative since we’d know who is going first and then it’s just a matter of bouncing back and forth between units 1, 2, and 3 of either player. Once both players have selected the units for turns 1, 2, and 3, the turns begin.
> 5. Player 1 turn 1
> 6. Player 2 turn 1
> 7. Player 1 turn 2
> 8. Player 2 turn 2
> 9. Player 1 turn 3
> 10. Player 2 turn 3
> 11. Round ends
> 12. Repeat steps 3 to 11 until game has ended
> 
> So in theory it doesn’t seem that complicated, but I’m not sure how intricate things would need to be in a setup like this with the toolkit. If it’s too tricky I can always try to make something else work, but let me know what you think. Thanks!

Working on this question now, but got interrupted. I’ll update this post once I have a solution.

Edit: This turned out to be more challenging than I expected. Going to need to put this on hold and get back to it in a couple of days.

---

<div class="post-metadata">

**Author:** ![thzero](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thzero](https://forums.unrealengine.com/u/thzero)\
**Post date:** [May 23, 2020, 9:01pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3441 "2020-05-23T21:01:47Z")

</div>

So, been struggling with multi-level and understanding the meaning of the different settings (yes, watched this [https://www.youtube.com/watch?v=e-YG…15jXKF&index=8](https://www.youtube.com/watch?v=e-YGUfKbloM&list=PLNiHDaJeqA16CsnxJJDjG9qgubj15jXKF&index=8) many times).

For my case, I’m looking at creating 150 height hex meshes, that can then be stacked on top of each other. Using general map as a starting point, I set the max grid to 1000, and height between levels to 1000. Basically, you can’t go underneath.

The height impassable is 200, and height slow is 200.

This seems to work, and I can create a stairs of 6 each incrementing by 150. And that works. However, using height impassable of 150 only allows climbing the first stair. Looking at the code, its not quite obvious why although I’ll note that the code description for the GetEdgeCostFromZDifference comment doesn’t seem to match the flow. Oh and heightmap is set to 1 level

Also, it sounds like that the height between levels is only really useful if you are allowing the setup to automatically figure out levels… I did try the above with heightmap both at 1 level, as well as multi-level.

Thoughts?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7ef0d073](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7ef0d073](https://forums.unrealengine.com/u/anonymous_user_7ef0d073)\
**Post date:** [May 24, 2020, 12:09am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3442 "2020-05-24T00:09:41Z")

</div>

Hello! I am fairly new to UE4, and I can’t seem to find where certain variables are utilized in the Unit blueprints. I am trying to generate randomized stats for each character in combat, so things like movement speed, max health, melee damage, etc. are varied. I’m not having trouble with generating the values I want, I’m having trouble finding where to put them. For example, I can only find references to the “Current Health” variable, when I want my random values to be manipulating the “Max Health” variable instead.

I want to be able to run randomized units in the code, rather than just manually modifying units via the details tab in the editor. Where can I plug my numbers in?

(Thanks for the incredible toolkit by the way, it will truly shave years off of the work I need to put into this project. Absolutely stellar!)

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [May 24, 2020, 7:21pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3444 "2020-05-24T19:21:56Z")

</div>

> [@thzero](#):
>
> So, been struggling with multi-level and understanding the meaning of the different settings (yes, watched this [https://www.youtube.com/watch?v=e-YG…15jXKF&index=8](https://www.youtube.com/watch?v=e-YGUfKbloM&list=PLNiHDaJeqA16CsnxJJDjG9qgubj15jXKF&index=8) many times).
> 
> For my case, I’m looking at creating 150 height hex meshes, that can then be stacked on top of each other. Using general map as a starting point, I set the max grid to 1000, and height between levels to 1000. Basically, you can’t go underneath.
> 
> The height impassable is 200, and height slow is 200.
> 
> This seems to work, and I can create a stairs of 6 each incrementing by 150. And that works. However, using height impassable of 150 only allows climbing the first stair. Looking at the code, its not quite obvious why although I’ll note that the code description for the GetEdgeCostFromZDifference comment doesn’t seem to match the flow. Oh and heightmap is set to 1 level
> 
> Also, it sounds like that the height between levels is only really useful if you are allowing the setup to automatically figure out levels… I did try the above with heightmap both at 1 level, as well as multi-level.
> 
> Thoughts?

Sorry, but I’m not really able to visualize the desired end result here, which makes it difficult to come up with suggestions. How does the game look and play? Are you stacking the tiles during gameplay? How are units intended to move between tiles?

> [@spartacusthegod](#):
>
> Hello! I am fairly new to UE4, and I can’t seem to find where certain variables are utilized in the Unit blueprints. I am trying to generate randomized stats for each character in combat, so things like movement speed, max health, melee damage, etc. are varied. I’m not having trouble with generating the values I want, I’m having trouble finding where to put them. For example, I can only find references to the “Current Health” variable, when I want my random values to be manipulating the “Max Health” variable instead.
> 
> I want to be able to run randomized units in the code, rather than just manually modifying units via the details tab in the editor. Where can I plug my numbers in?

MaxHealth is a variable in BP\_Unit. Perhaps you are modifying one of its child blueprints and have forgot to check Show Inherited Variables? Where it makes sense to put the code for modifying attributes depends a lot on the needs of your game. Want to modify unit abilities by clicking on them during gameplay? Use an ability. Want to assign random stats when a unit is spawned, do it at EventBeginPlay for BP\_Unit.

> [@spartacusthegod](#):
>
> (Thanks for the incredible toolkit by the way, it will truly shave years off of the work I need to put into this project. Absolutely stellar!)

Glad you like it!

---

<div class="post-metadata">

**Author:** ![Luna2442](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luna2442](https://forums.unrealengine.com/u/Luna2442)\
**Post date:** [May 25, 2020, 1:15am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3445 "2020-05-25T01:15:33Z")

</div>

Hi ,

I am having a hard time with AI - I often get hung up with an infinite loop in my move\_attack ability right after the AI activate AP \> 1 conditional false evaluation. I believe its due to evaluation of abilities tying for 0 maybe? I honestly can’t figure it out. I have all of my AI logic in BP\_Ability except for the AI Activate in move\_attack. I changed my move\_attack ability to cost 0 to move and using the units move cost, but cost 2 AP when the unit attacks - and I subtract that AP in the execute ability function after a conditional.

For some reason when using other abilities though, in move\_attack I had to change the AP \> 1 evaluation to .005 which seems to do the trick, but my enemies get away with moving and not spending any AP sometimes. I am logging the abilities they activate, and they can move without activating the move\_attack ability. I can’t do the same thing with my player controlled characters. These issues don’t seem related but I can’t figure out whats going on. And why the value of 0 in the evaluation loops forever I’m not sure.

---

<div class="post-metadata">

**Author:** ![Koniferus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Koniferus](https://forums.unrealengine.com/u/Koniferus)\
**Post date:** [May 25, 2020, 7:31am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3446 "2020-05-25T07:31:13Z")

</div>

> [@](#):
>
> > [@GENESIS\_EMMANUEL](#):
> >
> > [USER=“455402”]GENESIS EMMANUEL[/USER]
> > 
> > Hi ,
> > 
> > Great day! I intend to make a plan phase and execute phase in every turn encapsulating both individual unit of each team. For example, in a game where there are 2 opposing teams with 1 unit per team, the turn 1’s plan phase is when team A plans the unit’s movement and action then store it in a variable then team B does the same. Then the plan phase is done and the execute phase starts by implementing the stored variables for both team A and B at the same time. Then that ends the execute phase then turn 2 starts by going back to another plan phase. I would like to ask for your help on how to go about it please.
> 
> Hi Emmanuel, that question is a bit more difficult than the one I thought you were asking on the store page. The first part of storing target locations for abilities and then executing them automatically at a later point is a bit of a challenge, but very much doable. The second part of having all of those actions play out simultaneously is a much larger challenge. It goes against an assumption built into the toolkit, which is that actions resolve serially. That is not to say it is impossible to work around it, but you will need to be creative and put in a lot of work.
> 
> Let me give you something to get started if you still want to give it a try, though.
> 
> First I’ve created a duplicate of BP\_Unit\_Anim that I’ve called BP\_Unit\_Simultaneous. It is identical, except that it also has a variable called MoveTargetIndex, that it uses to store a grid index it has previously chosen to move to. I set the default to ‘-1’, which I will later use as an indicator of the value being “empty”.
> 
> Then I create a duplicate of BP\_Ability\_Move, which I’ve called BP\_Ability\_SimuMove. I make a few changes to it.
> 
> In EventServerInteract, after checking that a clicked tile is valid, I check if the owning unit has a value other than ‘-1’ stored in its MoveTargetIndex variable. If not I set this value to the clicked tile and end the unit’s turn (setting CurrentAP to 0 and calling SignalAbilityExecuted). If it does have a stored value, I set ClickedIndex to this value, and continue the execution chain as if this tile had just been clicked.
> 
> https://i.imgur.com/NwutpMC.png
> 
> Make sure to remove the SignalAbilityExecuted at the far right of the Click comment box so it is not called twice.
> 
> Now at PlayActivate, after RunPathfinding is called I check if there is a MoveTargetIndex stored from last turn. If not, then I activate the ability as normal. If there is one, however, I call ServerInteract with the stored variable as input, essentially simulating a click on the stored tile immediately after the ability is activated at the start of the unit’s turn:
> 
> https://i.imgur.com/yzFoANa.png
> 
> So far so good. We now have a setup where each unit chooses their move target first, and then we play both of them automatically, in sequence:
> 
> https://i.imgur.com/2JUq8cl.gif
> 
> To get them moving simultaneously we need to get a bit hacky. Ideally you would want to make some major modifications to the ActionManager to keep it clean. Here is a starting point, at least.
> 
> In the Move comment box in Event Graph of BP\_Unit i set the InstantDeactivate input in both QueueAction macros to true. This means that the action manager will immediately skip to the next action as soon as this movement has started. I also Remove the EndAction call that is called at the end of the MoveTimeline, since EndAction is called automatically if InstantDeactivate is true.
> 
> What we have now looks like this:
> 
> https://i.imgur.com/LSpWw6o.gif
> 
> Almost there, but there is an issue. Since we just skip over all actions, the toolkit has no way of knowing that is should wait to start the next turn, so the next turn is starting immediately, with a new pathfinding being generated from where one of the units ends up after it has moved. Normally the TurnManager would wait for all queued actions to end before doing, so but since we’re calling EndAction immediately this does not happen.
> 
> To get around this I add a new variable to BP\_Unit that is set to true while it is animating and then false when it is done. When the turn manager wants to start a new turn it continously checks if all units have animating set to false before starting the next turn. I set bAnimating to true at the start of MoveToIndex in BP\_Unit and set it to false where I would normally call EndAction after a move (Bottom right in the Move Timeline comment box).
> 
> Then I add the following function to BP\_TurnManager that checks if there are currently any animating units:
> 
> https://i.imgur.com/XAXyUVp.png
> 
> and I do a delayed loop on BeginNewTurn that does not start a new turn until no more units are animating:
> 
> https://i.imgur.com/CN7n8Ks.png
> 
> And finally we have simultaneous movement that looks decent:
> 
> https://i.imgur.com/bP1rIlL.gif
> 
> Ok, so that is something, at least. You would of course need to modify all other abilities in a similar fashion, designing around issues such as two players selecting the same tile etc. This is to show that while simultaneous turns are not inherently impossible, I would not recommend going that way unless you feel extremely confident in both your blueprinting abilities and your knowledge of the inner workings of this toolkit.
> 
> I’m sorry that I didn’t completely understand your question when you asked it in the store page. I hope you did not buy the toolkit under the assumption that implementing simultaneous turns would be easy, based on my reply. If so, feel free to ask Epic for a refund request on the toolkit. It is, in its present state at least, tricky to work with if you plan to make a game that is not fully turn based.

Thank you for posting this!! I’m working on integrating this into my project/experiment and before I completely destroy everything lol, I’m wondering how you would approach adding time-based ticks for execution… I’ll try to explain what I mean here.

3 players on the grid - A, B, and C.

Player A chooses to move 6 tiles away, costing him 6 AP (1 move per AP)  
Player B chooses to move 3 tiles away, costing him 3AP  
Player C chooses to move only 2 tiles , costing him 2AP

No additional players are idle so the turn begins ticking and players begin moving, 1 move increment at a time, simultaneously.

2 “ticks” in - Player C is done moving and becomes idle. Gameplay pauses and Player 2 can choose a new action - he moves 4 tiles away.

No additional players are idle so the turn ticks and players move one more space.

Player B has now completed his 3 movements and is idle - Gameplay pauses and he may select a new movement.

EDIT: Just wanted to add that I’m not expecting a full-blown ordeal like you’ve done above - just generally what I would want to start modifying. I’m guessing it would be the turn manager and the new simulmove ability that I make mainly?

EDIT2: Yikes, pausing all moving units while the available unit takes his turn is proving to be a real challenge. - @\*\*\*\*This is what I’m trying to do - When the first unit stops moving, all other units should stop on their tile, preferably freezing in place, while the available unit makes his next move. When he chooses his next tile, everyone unfreezes and continues moving.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/9/0594ee718d04a660e735e25eefa2481ce76fb71d.jpeg "ATBTT Question #1") ](https://www.youtube.com/watch?v=4IYIK9s6YZ0)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7ef0d073](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7ef0d073](https://forums.unrealengine.com/u/anonymous_user_7ef0d073)\
**Post date:** [May 25, 2020, 5:50pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3447 "2020-05-25T17:50:58Z")

</div>

> [@](#):
>
> MaxHealth is a variable in BP\_Unit. Perhaps you are modifying one of its child blueprints and have forgot to check Show Inherited Variables? Where it makes sense to put the code for modifying attributes depends a lot on the needs of your game. Want to modify unit abilities by clicking on them during gameplay? Use an ability. Want to assign random stats when a unit is spawned, do it at EventBeginPlay for BP\_Unit.

It really IS that simple, okay then! I’ve been overthinking the programming all weekend, it seems. Thank you for the help, much appreciated!

---

<div class="post-metadata">

**Author:** ![Jascicleiton](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jascicleiton](https://forums.unrealengine.com/u/Jascicleiton)\
**Post date:** [May 25, 2020, 6:40pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3448 "2020-05-25T18:40:33Z")

</div>

Hi @  
I am trying to implement using each move as a AP point (which I did), for the player works fine, but for the AI, the movement animation is not playing correctly.  
What I did was:  
Created a blank project (unreal 4.24)  
Added two BP\_Unit\_Anim, one player and one enemy (AI)  
Added ability system with Move and Attack abilities  
CHanged the Move Range on Move ability (as below image)

 ![Capture.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/1/5133e2aec4a26ba3b7aa5dd4b1dae6d71ddd84f0.png)  
Changed the cost to be Custom (1) and set the UseEndsTurn to false on the move ability.

When it is the AI turn, the first time it uses move, works fine, the second and third times (the unit have 3AP) the animation does not start from the previous location, it starts from someplace else.  
Couldn´t upload the gif here, so here is a link to it  
 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/e/89ec86a91c987a8357fb0e6131fa838834ca77d6.gif)  
Also, if the player unit is 6 or less indexes away, the AI will seem to use a single Move\_Attack with 6 move points (even though it does not have the Move\_Attack ability)

any idea on how to fix this?  
also, is there a way to force a delay every time an AI unit spends an AP point to sort of simulate the AI “thinking” before making every move?

ps: sorry if it was asked and answered before

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [May 26, 2020, 9:01pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3449 "2020-05-26T21:01:13Z")

</div>

> [@Koniferus](#):
>
> Thank you for posting this!! I’m working on integrating this into my project/experiment and before I completely destroy everything lol, I’m wondering how you would approach adding time-based ticks for execution… I’ll try to explain what I mean here.
> 
> 3 players on the grid - A, B, and C.
> 
> Player A chooses to move 6 tiles away, costing him 6 AP (1 move per AP)  
> Player B chooses to move 3 tiles away, costing him 3AP  
> Player C chooses to move only 2 tiles , costing him 2AP
> 
> No additional players are idle so the turn begins ticking and players begin moving, 1 move increment at a time, simultaneously.
> 
> 2 “ticks” in - Player C is done moving and becomes idle. Gameplay pauses and Player 2 can choose a new action - he moves 4 tiles away.
> 
> No additional players are idle so the turn ticks and players move one more space.
> 
> Player B has now completed his 3 movements and is idle - Gameplay pauses and he may select a new movement.
> 
> EDIT: Just wanted to add that I’m not expecting a full-blown ordeal like you’ve done above - just generally what I would want to start modifying. I’m guessing it would be the turn manager and the new simulmove ability that I make mainly?
> 
> EDIT2: Yikes, pausing all moving units while the available unit takes his turn is proving to be a real challenge. - @\*\*\*\*This is what I’m trying to do - When the first unit stops moving, all other units should stop on their tile, preferably freezing in place, while the available unit makes his next move. When he chooses his next tile, everyone unfreezes and continues moving.
> 
> [https://youtube.com/watch?v=4IYIK9s6YZ0](https://youtube.com/watch?v=4IYIK9s6YZ0)

Hmm yeah this is a challenge alright. I can give you some places to start, but not sure if it is the best approach. This will require a lot of experimentation, I think. I guess what you could do is to store the length of the path of each unit in each unit. Then when all units have chosen their move and a new turn starts (the one that starts playing all animations automatically) you would first loop over all units and find the shortest path.

You could store this in some place all units have access, like the game state. Then when the units activate their abilities you would find this value. After finding the path to an index using the stored target index you would loop over the output PathIndex array and only keep the amounts of indexes equal to the length of the shortest path, take the last index of this cut down array and use it as the new TargetIndex for the ability. Then you would keep the old target index as the target index stored in the unit, so it will keep going the next time it is activated.

Those are my initial thoughts, at least. You are taking the toolkit in a pretty different direction than what it is meant for, so my suggestions will have to be a lot more tentative than usual.

> [@spartacusthegod](#):
>
> It really IS that simple, okay then! I’ve been overthinking the programming all weekend, it seems. Thank you for the help, much appreciated!

Happy to help!

> [@Jascicleiton](#):
>
> Hi @  
> I am trying to implement using each move as a AP point (which I did), for the player works fine, but for the AI, the movement animation is not playing correctly.  
> What I did was:  
> Created a blank project (unreal 4.24)  
> Added two BP\_Unit\_Anim, one player and one enemy (AI)  
> Added ability system with Move and Attack abilities  
> CHanged the Move Range on Move ability (as below image)
> 
> ![Capture.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/1/5133e2aec4a26ba3b7aa5dd4b1dae6d71ddd84f0.png)  
> Changed the cost to be Custom (1) and set the UseEndsTurn to false on the move ability.
> 
> When it is the AI turn, the first time it uses move, works fine, the second and third times (the unit have 3AP) the animation does not start from the previous location, it starts from someplace else.  
> Couldn´t upload the gif here, so here is a link to it  
> [- Find & Share on GIPHY](https://media.giphy.com/media/fVbcCt3W0FFqduI6qN/giphy.gif)  
> Also, if the player unit is 6 or less indexes away, the AI will seem to use a single Move\_Attack with 6 move points (even though it does not have the Move\_Attack ability)
> 
> any idea on how to fix this?  
> also, is there a way to force a delay every time an AI unit spends an AP point to sort of simulate the AI “thinking” before making every move?
> 
> ps: sorry if it was asked and answered before

Hey, sorry, but I’m a bit unsure of what to do here. It is simpler if you could give me the desired outcome in more detail, which would make it simpler to find the best solution. How do you want this to play out in your game? How do action points/movement work in your game and how would you expect the turn to play out if everything worked like you wanted it to?

---

<div class="post-metadata">

**Author:** ![Reinhart\_x](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Reinhart\_x](https://forums.unrealengine.com/u/Reinhart_x)\
**Post date:** [May 27, 2020, 12:16am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3450 "2020-05-27T00:16:13Z")

</div>

> [@](#):
>
> ​​​​​
> 
> Working on this question now, but got interrupted. I’ll update this post once I have a solution.
> 
> Edit: This turned out to be more challenging than I expected. Going to need to put this on hold and get back to it in a couple of days.

No problem, thanks for taking the time to look into it!

---

<div class="post-metadata">

**Author:** ![Koniferus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Koniferus](https://forums.unrealengine.com/u/Koniferus)\
**Post date:** [May 27, 2020, 1:55am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3451 "2020-05-27T01:55:17Z")

</div>

> [@](#):
>
> Hmm yeah this is a challenge alright. I can give you some places to start, but not sure if it is the best approach. This will require a lot of experimentation, I think. I guess what you could do is to store the length of the path of each unit in each unit. Then when all units have chosen their move and a new turn starts (the one that starts playing all animations automatically) you would first loop over all units and find the shortest path.
> 
> You could store this in some place all units have access, like the game state. Then when the units activate their abilities you would find this value. After finding the path to an index using the stored target index you would loop over the output PathIndex array and only keep the amounts of indexes equal to the length of the shortest path, take the last index of this cut down array and use it as the new TargetIndex for the ability. Then you would keep the old target index as the target index stored in the unit, so it will keep going the next time it is activated.
> 
> Those are my initial thoughts, at least. You are taking the toolkit in a pretty different direction than what it is meant for, so my suggestions will have to be a lot more tentative than usual.

Thanks! - any ideas that come to mind are greatly appreciated. For now, I’m focusing on learning everything you’ve created so far with your youtube videos and whatnot, then I will probably have to gut everything that doesn’t apply to my vision/idea.

Generally, I had only worked on FPSs with UE4, so I needed something to get my brain going in the turn-based direction and your template is gold for that! Really impressive what you have done and the amount of time you’ve put into the project as well as helping everyone!

---

<div class="post-metadata">

**Author:** ![Dijon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dijon](https://forums.unrealengine.com/u/Dijon)\
**Post date:** [May 28, 2020, 12:09am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3452 "2020-05-28T00:09:04Z")

</div>

What an impressive template! I’ve watched most of the videos and I have a few questions:

1. One video changes animations by swapping for the new one. If I want to use animations that aren’t currently in the anim blueprint, is it difficult to add without breaking everything else?
2. I didn’t see a video describing how you added cover points; is it a simple process?
3. The level “Jungle Raid” looks approximately what I’m after. Can this system be used on terrain, or are you constrained to simply using a static mesh as “the ground”?
4. How does this system handle both indoor and outdoor locations on the same map? Can units enter buildings, and if yes, how is the grid handled?

Thanks.

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [May 28, 2020, 6:20pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3453 "2020-05-28T18:20:59Z")

</div>

> [@Reinhart\_x](#):
>
> No problem, thanks for taking the time to look into it!

Have not had time to return to this yet, sorry, but I’ll get to it at some point!

> [@Koniferus](#):
>
> Thanks! - any ideas that come to mind are greatly appreciated. For now, I’m focusing on learning everything you’ve created so far with your youtube videos and whatnot, then I will probably have to gut everything that doesn’t apply to my vision/idea.
> 
> Generally, I had only worked on FPSs with UE4, so I needed something to get my brain going in the turn-based direction and your template is gold for that! Really impressive what you have done and the amount of time you’ve put into the project as well as helping everyone!

I’m glad you think so, and I hope you’ll find the toolkit flexible enough that you are able to achieve your desired results without too much hassle.

> [@Dijon](#):
>
> What an impressive template! I’ve watched most of the videos and I have a few questions:
> 
> 1. One video changes animations by swapping for the new one. If I want to use animations that aren’t currently in the anim blueprint, is it difficult to add without breaking everything else?
> 2. I didn’t see a video describing how you added cover points; is it a simple process?
> 3. The level “Jungle Raid” looks approximately what I’m after. Can this system be used on terrain, or are you constrained to simply using a static mesh as “the ground”?
> 4. How does this system handle both indoor and outdoor locations on the same map? Can units enter buildings, and if yes, how is the grid handled?
> 
> Thanks.

Hi Dijon, glad you like the template 🙂 I’ll do my best to answer your questions.

1. Adding new animations is not that difficult. You can follow the same approach that the other animations are driven by. The animations in BP\_Unit\_Anim are generally triggered by setting bools in the animation blueprint event graph. These in turn trigger transition in the animation graph. The bools are set through the AnimateAbility event, which is called from BP\_Unit whenever BP\_Unit receives a QueueAction with it as an executing actor for which it does not itself have a definition in the name switch of AnimateAction.

To give you the order: Any QueueAction with a BP\_Unit class actor as the ExecutingActor which has an ActionName not defined in AnimateAction for the unit will get passed to its animation blueprint. There you can use the name of the action to choose some course of action. You could for instance set a bool to trigger an animation in the animation graph.

Hope that made sense.

1. Yeah, I have not made a video on that. To add cover you add the BP\_CoverSystem component to your GridManager. At begin play this component does line traces in all straight directions for each tile, using the custom CoverTrace channel. There are two height it checks, which determines whether to grant half or full cover. Utilizing this data must be defined within the abilities you are using (as they are in BP\_Ability\_Laser)

2. The ground in JungleRaid already is a terrain Landscape, so yes 🙂

3. Sure, you can do buildings. Single-story buildings are simple. If they need a roof you can use BP\_GA\_Platform actor for the roof, which turns translucent and click-through if you zoom close enough. Check out the platforms in JungleRaid to see how this works. Multi-story buildings also works. Just set the Heightmap variable in BP\_GridManager to Multilevel

---

<div class="post-metadata">

**Author:** ![Dijon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dijon](https://forums.unrealengine.com/u/Dijon)\
**Post date:** [May 28, 2020, 8:09pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3454 "2020-05-28T20:09:07Z")

</div>

@

> [@](#):
>
> To add cover you add the BP\_CoverSystem component to your GridManager

Can I set the height for what is considered hull and half cover?

> [@](#):
>
> The ground in JungleRaid already is a terrain Landscape

So the grid will display on top of whatever you want (mesh, terrain)?

> [@](#):
>
> Sure, you can do buildings

Does this require a separate grid?

Thanks for taking the time to reply.

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [May 29, 2020, 8:26am UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3455 "2020-05-29T08:26:42Z")

</div>

> [@Dijon](#):
>
> Can I set the height for what is considered hull and half cover?

Yep, it can be set within the cover component.

> [@Dijon](#):
>
> So the grid will display on top of whatever you want (mesh, terrain)?

Yes, anything within the bounds of the grid that blocks the PathTrace channel will be added to the grid.

> [@Dijon](#):
>
> Does this require a separate grid?

You just need the one grid.

---

<div class="post-metadata">

**Author:** ![Luna2442](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luna2442](https://forums.unrealengine.com/u/Luna2442)\
**Post date:** [May 29, 2020, 2:55pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3456 "2020-05-29T14:55:49Z")

</div>

Hello,

I’m still running into issues where the AI never stops assessing abilities. The error says it is thrown in update attributes, but I think it is constantly comparing it with another ability of equal value. I’ve logged the assessed value and it is 0, so I would assume the AI would pass its turn. But it just reassesses. How can I ensure they stop their assessment loop?

Edit: I verified all of the abilities it considers tie for 0. I guess it would still prefer to do one over the other, and continues to loop. Is there a good place in the BP\_Ability BP to address this globally?

 ![exhaust.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/3/93acd3e248b1315f1b20f6221e26184e6cf0195a.jpeg)  
This will cause them to do nothing when they could but it does stop my error I think. I actually moved it directly after the branch.

---

<div class="post-metadata">

**Author:** ![Monokkel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monokkel/32/1194496_2.png) [@Monokkel](https://forums.unrealengine.com/u/Monokkel)\
**Post date:** [May 29, 2020, 10:24pm UTC](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930/3457 "2020-05-29T22:24:18Z")

</div>

Hey all, I’ve begun work on replacing the ancient tutorials that explain the basics of the toolkit with a new tutorial series. Here is the first video in the series. I start with some very simple stuff, so nothing someone who follows this thread wouldn’t know, but I think there will be some good info for even experienced ATBTT devs in the coming videos.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/4/e/04eb35f30c64b8a043233397777f5c158035e1be.jpeg "ATBTT Basics #1 - Setup") ](https://www.youtube.com/watch?v=6D4xyGAmSvU)

> [@Luna2442](#):
>
> Hello,
> 
> I’m still running into issues where the AI never stops assessing abilities. The error says it is thrown in update attributes, but I think it is constantly comparing it with another ability of equal value. I’ve logged the assessed value and it is 0, so I would assume the AI would pass its turn. But it just reassesses. How can I ensure they stop their assessment loop?
> 
> Edit: I verified all of the abilities it considers tie for 0. I guess it would still prefer to do one over the other, and continues to loop. Is there a good place in the BP\_Ability BP to address this globally?
> 
> ![exhaust.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/3/93acd3e248b1315f1b20f6221e26184e6cf0195a.jpeg)  
> This will cause them to do nothing when they could but it does stop my error I think. I actually moved it directly after the branch.

Thanks for the report, Luna. Is replicating this issue as simple as having two abilities both assessed at value 0? I will look into this tomorrow.

Edit: Reuploaded video with stereo sound

[Previous page](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930.md?page=167)

[Next page](https://forums.unrealengine.com/t/support-advanced-turn-based-tile-toolkit/21930.md?page=169)
