[SUPPORT] Advanced Turn Based Tile Toolkit

Upon removing the 2D adventure game from the project (as I can look back on it with a fresh toolkit project and it simply takes up space in my project), it became clear that a few assets within are referenced in the base toolkit. The SM_Arrow_Flat mesh, referenced by the grid manager needs the M_Arrow material and Arrow texture from the 2D game. They should be moved to the toolkit so that the 2D game is indeed a true child of the game and therefore not needed. I already made the necessary changes for the project on my end by adding the needed texture and material to their respective folders and changing the material reference in SM_Arrow_Flat mesh, but just letting you know about it, in case you didn’t know.

Hmm, you’re seeing some strange behavior to be sure and I’ll look into it, but I’m a bit confused about what you are trying to achieve. Make tile passable is intended for tiles that are completely impassable to be made passable. It adds edges from that tile to all adjacent tiles. If what you want to do is to create a wall between two tiles you do not need to use this function, though. Just remove the edge between the tiles like so:


This creates an “invisible wall” between two tiles, but this is perhaps not what you’re after? If you could tell me more about your intended end result I can be of more help in suggesting how you go forward. I’ll be sure to look into the 99 cost stuff. Also, thanks for telling me about the 2D stuff referenced in the main toolkit. I’ll make sure to fix that in the coming update.

I have been migrating my project over from the 1.6 version of the toolkit to the 1.61 version and from UE 4.12 to UE 4.14 respectively. I’m having a new problem where now my enemy units will not even move. This started happening shortly after changing some things in the player controller and unit parent. But I have gone over the changes I have made and they should not have effected the functionality of the enemy units, because they were meant to only effect player units (which are working as expected). The other thing that could have effected them was another child blueprint reset to parent defaults. Unfortunately I had just made changes to the child blueprints so I couldn’t back them up (without having to redo the changes of course) so I simply setup the variables again. I did remove all the blueprints in the enemy units and removed the skeletal mesh (as my game uses sprites) and removed the Health Billboard because I use a Widget component for displaying health.

Do you have any ideas on what could cause the enemy units to not move? It switches to them, the camera hovers over them, then it switches to the next pawn instantly.

Yes, I want a wall between two tiles. I was building a tile that can be changed to a custom mesh, sprite, to be destructible, or offset.


Here’s a look into the construction script:


Continued from the right:


For now, I’m fine with the current results, where the units can move to the tile in front of but not behind the offset tile. But maybe in the future we can figure out how to get it to work.

It can be any number of things, I’m afraid, but I’ll tell you how best to troubleshoot it. Use break points in the event graph of ATBTT_AI_Controller to see if the nodes are firing in the order you expect them too. Identify the point at which it diverges from the path it follows in a fresh ATBTT project and compare the two from this point and back in the logic chain. Pay particular attention to the values of the arrays containing potential targets, such as reachable pawns, choice array and so on. I’m guessing the AI either does not register what enemy units are in range or discards the ones it has found. When you have found out more specifically where things break down I’ll be in more of a position to help you.

Ok, so to be clear your problem is that the wall above the center wall in your screenshot is not walkable and you want it to be connected to all surrounding tiles except the one below it?

So I’ve been comparing and adding breakpoints and the only difference seems to be that the new toolkit will initialize movement, and my project’s AI controller will not. The Choice array branch never hits true and Select unit and find path event never fires. It all comes down to the Choice array’s length never being above 0… therefore the branch that leads to movement never happens. Inside the Make choice function, the faction branch is always true, and never false. The enemy unit’s faction is set to “Enemy,” and the player unit factions are set to “player.” I checked if the pawn array was returning pawns and it is.

EDIT 1: So I changed the value in the find node from -1 to 0 and now the game is functioning properly (but possibly not allied factions?)

EDIT 2: When I look in the map Player is included as an allied faction for the enemies (added as an ally in the construction script). If I add a third faction, player is also included as an allied faction. The only change I made to the construction script was to take out the health bar.

EDIT 3: I simply deleted the player as an allied faction in the enemy unit and returned the value for find allied faction back to -1 and the game works again. It seems that when it reset the child units attributes, it kept the player as an allied faction, even when dragging in new child units into the map. Such a strange glitch! Thanks for your help in pointing me where to look. :slight_smile:


I want it to act exactly like your thin hex wall west or thin hex wall east, but be created in the construction script or at run-time. If it is on an even tile it is a hex wall and on an odd(offset) tile it is either a west thin wall or east thin wall.

Hi, Knut.
I’ve been speaking with you in the comments of some of your videos but I am currently working on an Idea for a dungeon crawler similar to your 2D game example.
However I wanted to implement an action points system where both movement and skill use are drawing from the same ‘stamina’ pool. So if a player decides to spend an entire turn on using abilities he can do, the Idea being that you will be a lone hero attacking a dungeon so you will be outnumbered at all times so you must combo your skill and use them effectively in order to do well.
I am using max move and current move variables in the unit parent to base this off and currently have it working so the game checks that you have more action points than the attack cost cost in that i added to the blueprint.
Ive intended the attack cost and range to change depending on what skill is selected.
Right now what i’m really unsure about is how to allow characters to attack multiple times and how to allow them to move after a skill has been cast. I realise that currently you have it set like Xcom where attacking ends that units turn whereas I would like it to be free flowing.
The other thing I need to ask about is how to implement skills, as far as the effect of skills such as dealing damage or stunning/slowing units goes then I believe i have that figured out its just getting the initial blueprints for the skills set up that I am confused about.

Glad you figured it out! That is indeed a strange glitch and I’m able to replicate it. I’m glad you found it so I’ll be able to fix it. Since the enemy units considered the player units to be their allies they skipped their turn. Sometimes I feel a bit bad for fixing a bug that causes units to be humane and not kill each other. Guess I’ve been watching too much Westworld :stuck_out_tongue:

Ok, after a bit of toying around I’ve come up with something that works. I’ve created a new child actor based on Tile_Parent which has the following construction script:


Since construction scripts are run when an actor is spawned in game we do not have to use a separate function in game as long as the construction script is set up with that in mind (which it is :slight_smile: ).

Here is a quick way to test out if it works during gameplay:


Let me know if it works (does on my end)


Glad my suffering could help you and others who come across the glitch. Haha. At least, “no player units were harmed in the making of this glitch.” :wink:

You sir, are amazing! Works Perfectly! (I did customize it a bit for my needs so that I can override (turn off) the offset if needed.) And Now I don’t need to tell them to be offset manually. It is awesome.

By the way, I love the name you gave your tile! :smiley: :cool:

Glad it works as you wanted it too! I usually name temporary projects and objects after the usernames of the people I’m helping out :slight_smile:

Tackling this issue got me thinking some more and I played around with a different way of achieving the same result. ATBTT uses two different methods for generating a walkability grid; one of them is manual by modifying edges directly, while the other one is procedural using line traces. I’ve become more and more a fan of the second method myself so I tried my hand at setting up a similar system using line traces. In the process I discovered a bug in my Trace for Walls function that causes the toolkit to ignore some walls in cases where there were multiple walls surrounding one tile. Here is the updated version, which will be included in the next update (a new trace channel, wall trace and a new public float, Trace for Walls height are added here as well):


This version needs to be set up like so in the event graph and construction scripts of BP_GridManager to work properly at startup:


Enabling Trace for Walls in BP_GridManager and setting Trace for Walls Height to something appropriate for your game (100 unreal units seems to work pretty well for the default toolkit) allows the toolkit to procedurally search for walls at startup and remove edges from any tiles surrounded by such walls. As such you would not need to program any functionality for modifying the edge array in your custom wall objects for them to block movement, and it would work for walls set in any direction. For spawning walls in game you could similarly spawn a very simple actor containing just a mesh that blocks WallTrace and then run the Trace for Walls function for that specific tile index and it should work instantly.

It is worth noting that this is a pretty costly operation, so I would not do this to a very large amount of tiles at the same time during gameplay. I would also check pregenerate gameplay grids before packaging the final build to cut down loading time.

This might not be the ideal solution for you, but it is perhaps the solution I would have used myself. This way you will not need to create a lot of different functions for various types of walls and buildings with various shapes and orientations, provided you keep the Trace for Walls function in mind when designing your meshes and levels.

Hi Monokkel!

I have a question for you: I’m currently using an amazing plugin for UE4 that allows me to procedurally generate a dungeon at play time (specifically in the begin play event).
My question is: is it possible somehow to spawn the grid manager TileByTile and calculate the Grid X and Grid Y ad the end of the level building process without spawn the entire grid manager somewhere?

Hello Wisom-HELLy! I assume Dungeon Architect is what you are using? It is certainly an impressive piece of kit and I think it should work really well together with ATBTT. I was actually working on a dungeon generator as a side project a while back, but scrapped it once I saw Dungeon Architect. I don’t understand everything in you question (spawning the gird manager tile by tile), but I’ll tell you what I would do if I wanted to get ATBTT and Dungeon Architect working together.

I would run the dungeon generation code before activating any nodes in BP_GridManager. Then in BP_GridManager at the very beginning (of the construction script or the event graph depending on you want to pregenerate dungeons or not) I would calculate the bounds of the generated dungeon (I don’t know enough about Dungeon Architect to say what would be the best way of finding this) and set GridSizeX, GridSizeY and the heightmap cutoff point (unless you want a flat dungeon) as well as the location of the grid manager based on these bounds. Basically GridSize X would be the size of the dungeon bounds along the X axis divided by the width of your tiles. You would of course also need to set DungeonArchitect and the grid manager up so that they use grid squares of identical size.

You would have to make sure that only meshes you intend the player to walk on block PathTrace and that any meshes you do not want units to attack through block RangeTrace. I would change the Trace for Walls functions to the way it is set up in my previous post, including adding a new WallTrace channel that should be blocked by any meshes you do not want units to walk through.

At this point you should enable line trace based heightmap generation in the public variables of BP_GridManager, check Trace for Walls and ATBTT should hopefully be able to procedurally build a walkable grid on top of any dungeon Dungeon Architect can generate. This should even work for dungeons with an arbitrary number of overlapping levels, thanks to my line trace based heightmap generation.

I’ve wanted to test this out myself for some time, so let me know how it works out!

Thanks for your reply!

I already use your incredibile toolkit together with Dungeon Architect (sorry for being mysterious on the plugin name but before you mentioned it directly I didn’t intend to set any unrequired advertisement on your support topic) and as you suggest the “Trace for Walls” function was the key to make them working fine together.
You got the point: I actually create the dungeon in the viewport by using “Build Dungeon” and then drag the BP_GridManager inside the level, but I want instead to build dungeon using a different and random seed every time I push play.

So, my hope was that I could spawn a Tile_Parent tile together with Dungeon’s Architect “ground” marker, overlapping them, and then, after all tiles have been placed, the grid manager somehow could auto-calculate the position, rotation, GridSizeX, GridSizeY and the heightmap starting from his tiles position.

But with the last reply you pointed me out to a different approach, which probably is the most correct one. So I asked directly to the Dungeon Architect plugin owner how to get the max size X and Y of the dungeon.
In this way I should be able to spawn the grid manager at runtime.

Thanks again for your precious reply.

Great, I hope it works out :slight_smile: I’m sure Ali will give you an easy way to find the bounds of the dungeon, but if not I’m sure I can think up a solution.

Using placed tile actors was the only way to create ATBTT maps in the early versions, but these days you do not really have to place a single tile actor. As long as you place your meshes with the grid in mind and set up collision correctly you can just use regular placed meshes and landscapes, place and resize the grid manager appropriately and let it do the work for you. This is definitely the way I would go if working with Dungeon Architect.


I’ve been working with the ATBTT for the past month or so and I’ve been able to do pretty much everything one way or another. But. Right now i just hit a wall.

I need to stop my unit midway trough movement. I have trigger box triggering dialogues or pop-up boxes but the units need to stop AS SOON as they enter the trigger box. right now you can click somewhere and your unit will move where you click even while a dialogue box is up on screen. I tried calling the End Movement event in unit parent with no success.(units will stop the animation but not the ACTUAL moving)I tried reducing the spline length to 0, no good here either. I tried a lot of simple thing again to no success. So before I go and add my trigger boxes to the grid manager and have the units stop the path finding when a trigger is met, I’d like to know if someone found a solution or perhaps as an idea I have yet to try.

Hey Monokkel, love the toolkit and really appreciate the ongoing support. I’m trying to figure out if I should do the cover system engineering myself or wait for your update. I know you don’t want to give a timeline but are we talking about about a double digit number of months?
Not that I really expect or demand an update :slight_smile: I’ve already got way more value out of the toolkit than I had possibly hoped! If you are going to GDC let me know and I’ll buy you a beer.

Hey Jiyko, I think it is a very fair question and though I will not give an estimate for the reasons I have mentioned I’ll try to give you a better idea of how far off I am. It will certainly not be in a double digit number of months and I have completed most of what I want in the update. I think probably the best I can do is to list what I have made so far and what I intend to add before the update is done.

What I have:

  • Cover system, including accuracy and dodge
  • modular skill system including the sample skills Fire Laser, Overwatch, Heal, Explosive Shot, Sprint and Mind Control.
  • advanced AI built into the skill system where the AI decides the best skill of all availible depending on the situation. Added for Fire Laser, Overwatch, Sprint and Explosive Shot.
  • Basic VR support with a simple VR level
  • Added several awesome creative common meshes for example games, including environments, units and weapons. Skeletal meshes have been rigged by u/Bankworthy.

Left to do:

  • Make a good looking example level demonstrating the cover and skill system, using the mentioned creative commons assets.
  • Adding a few common features to the VR level, including teleportation.
  • Extensive testing and bug fixing of the new features.

I hope that gives you a general idea. I have far less remaining than I have done, and I will try to stop myself from coming up with new features to add (and especially my recurring urge to reinvent something I’ve already made :stuck_out_tongue: ). If you want to have use my cover system before then I’ve detailed the method I used in a post here. Afraid it will be difficult to make it to Cali and GDC this March, but thanks for the offer! I’ll be enjoying the icy winds of Norway’s west coast instead.

How do you find the get node that has an array of indexes as the output. The only Get node I have access to gets the individual item, but not index array.

Edit: I just figured it out! You right click the item pin and select “split the struct pin.”

Also, for your new trace channel: WallTrace. In your project details what did you set the default response to be?

Shouldn’t the outward event pin be connected to completed? Other wise it is going to go through the rest of the construction script and event graph events until finished.

Oops, you are right about the wrong pin connections there. Rookie mistake :stuck_out_tongue:

I’ve set WallTrace to block by default. Generally I feel there is generally more stuff that you do not want units to be able to move through than the opposite, so I think it makes sense as a default. You should configure the defaults so that commonly movable stuff such as pawns, vehicles etc. ignore this trace. You could probably also just use PathTrace or RangeTrace for walls, though if you used PathTrace it would not be possible to click “through” any such tiles and click the tile behind the wall. Also, not using RangeTrace gives you flexibility in case you want walls that can be attacked through, but not moved through (windows, maybe) or the opposite (thick fog).

Hi Monokkel,
I’ve been working on an accuracy system, currently it multiplies the number of tiles distance by an accuracy cost (currently 3.5) and subtracts it from a base accuracy value that is a customizable attribute of each pawn. Ive contained all of this in a function in the ATBTT_player_controller blueprint because It contained all of the variables that I needed within the function.
However I intended to use the function in Unit_Parent just during attack victim just before Receive damage, If it true then it does damage if not It minuses the damage value from itself and runs that into recieve damage, so damage is done.
The issue i’m having is when I call the function in Unit_Parent I need a reference to it, I created a reference but when I run it in game every shot misses and every time I try to take a shot I get this error;
Error Blueprint Runtime Error: Accessed None trying to read property ATBTT Player Controller Ref from function: ‘ExecuteUbergraph_Unit_Parent’ from node: Accuracy Calculation in graph: EventGraph in object: Unit_Parent with description: Accessed None trying to read property ATBTT Player Controller Ref

Its probably a rookie mistake as I am quite new to blueprints but any help you could offer would be amazing. If you need to see my blueprint then I can take a few screenshots if its neccsary.