[SUPPORT] Advanced Turn Based Tile Toolkit

Hey Mewbits,
Thanks for the response, Ive added what you said in and use the get player controller function and cast it to ATBTT_Playercontroller just wondering If i need to have an index going into the player controller function?
I’m happy to show you the accuracy calc I did get some help from someone with a cover system some parts of the accuracy and would not have anything close to this without his help, but I have reworked some things things myself, It’s not finished yet as I need to add in some extra stuff in as right now it’s just down to that pawns attribute values but i’m working on having the pawns equip weapons and have those weapons affect accuracy eg.pistols having a higher accuracy cost for distance and having each weapon have its own base accuracy stat.
Ill try and do what you suggested however i am still a bit confused when it comes to so of the blueprint functionality.
player controller.PNG

Thanks Gojiberries,
Index 0 should be fine so long as it is not a multi-player game.

@Monokkel I finally got around to taking another look at moving multiple units simultaneously. Your original example works just fine, I messed up some of the connections, but it looks like it’s all good now. I’ll let you know if it causes any issues later down the line.

Thanks guys accuracy systems working now,
However Im having an issue with my cover system. It works if the grid isn’t multi level but as soon as I make a grid with the height map it does not apply cover on the higher areas.
Its base off the accuracy system that Monokkel already helped out with on this forum. Where is applies a value to each tile edge based off if there is a tile with a cover value next to it.
Also currently it only works with walls that take up a full gridspace, I haven’t got it working with the thin walls that just make one side of a grid impassable and i cannot for the life of me figure it out.
I figure that I need to add the z value of the grid to get it to work just not sure how to go about it. Here is my work so far.
cover 1.PNG
cover 2.PNG

@GojiBerries: I’m glad you were able to get the Player Controller reference correctly (thanks, Mewbits!). The reason your original solution did not work is probably because you are using an empty player controller reference. You would need to set it up to reference a specific player controller for it to work with a single reference variable as you did in your original screenshot. You could do this by getting the player controller and casting this to ATBTT_Player_Controller just like Mewbits suggested and then use the output from the cast to set the specific reference for your ATBTT Player Controller ref variable. If you did this at event begin player you would not have to cast every time you needed to access the player controller in game. This only really matters if you want to access the player controller several times per tick, though, as casting is not very performant, or to make your blueprints easier to read.

I’m not sure if you’re aware, but I posted all the blueprints for my WIP cover and accuracy system a while ago here. It shares a lot of similarities with what you’ve done, but there are some differences. For instance, I am using line traces to check for cover instead of using a cover array. It works with multi-level grids and thin walls between tiles. Do you think this solution is something you could also use?
@Selentic: Great! I’ll be interested in hearing about your progress. I’m assuming there will still be some hurdles to overcome, but it seemed to work fine from my limited testing.

Hey man, Ill take a look at it as I think your system sounds really elegant. Thanks for the link and for responding, nice to find helpful peeps

Hey Monnokel.

Loving the toolkit and can’t wait for the next update. I seem to be having an issue right now though with PIE, play in viewport and simulate. Whenever I try any of these, UE4 crashes with no errors. It works fine when I play standalone, though it’s a bit of a pain to have to start a standalone game every time I wanna test any changes.

Would you happen to have any experience or knowledge about this?

Also packaging the project fails which I think is due to a blueprint error in the unit parent blueprint, but I’m not too worried about that for now. More interested in being able to PIE for now.



AI pawns set to pass through friendlies pathfinding don’t actually take advantage of that.

Hi Monokkel,

I have setup a trap system where if a unit walks over a trap during movement, it hurts the unit. However, if the unit dies during its movement, the game doesn’t know how to continue and after leaving the game I get a lot of errors. If it is a player unit that dies, I have a button setup that will allows me to skip that unit’s turn, thus allowing the game to continue. However, I cannot use this same approach for the enemy units, for obvious reasons.

Any suggestions on how to remove a unit during the middle of its move without getting errors because the unit is no longer there and making sure the game automatically removes it from the initiative order and continues to the next turn?

I hope the solution works well for you. Just happy to help :slight_smile:

Hmm, works for me. This is something I fixed in the last update, though, so if you are using an earlier version you will need to get and connect the Pathfinding Type variable from the current pawn and input it into the pathfinding functions in the event graph of ATBTT_AI_Controller.

I haven’t done any extensive testing, but the following seems to work. In this case I have created a new blueprint actor with a capsule collider set to overlap the pawn channel and have enabled overlap for the pawn channel in the skeletal meshes of the units. Collision should work just as well, come to think of it. I do not get any errors when using this:


I just tested it in a fresh project, the toolkit in my library is kept up to date right or do I need to update it manually?

You have to delete the content, then download it again. I had to do that to get the latest version.

It should update automatically, but I’ve had it happen a couple of times before that I would need to delete and re-download, as Mewbits suggested. This bug has been fixed, so I’m not sure what else could cause you to still see it.

I removed my local files, and redownloaded it. The issue is still here.

It appears they are pathfinding correctly, but they stop prematurely. As seen here with them stopping after two tiles, when there’s a clearly open path.

Okay, I’ve figured out the issue here. The problem is the Reachable Index Closest To Target function, which assumes units cannot pass through friendly units. This function does not fire if the target unit is in move range, so the bug only appears in cases where a unit which is set to pass through friendly units is not able to reach its desired target and there is a friendly unit between it and its target. I’ve found a solution that works, but I’ll try to think up something more elegant to include in the update. For now you can do this:

In ATBTT_AI_Controller in the middle of the Select unit and find path comment box:

The new function from the screenshot above:

Hey @Monokkel,
Just been looking at your cover system and I’m just a bit confused as to setting up the cover array, You mentioned that it’s a struct with multiple nested arrays. Are they multiple individual structs? or is it a struct with multiple arrays as variables.
I think ill be fine with the nodes I just want to make sure that I have the Array done correctly.

Yeah, I guess I could have ben clearer in the description. The Cover Array consists of an array of structs. Each of these struct contain another array of structs. These structs contain an integer (representing an adjacent tile index) and a float (representing the cover value). Like so:

CoverArray NestedCoverArrayStruct CoverStruct Index, Cover ] ] ]

I’ve read only now this post.
I will try basically to explain how to do this (sorry I cannot give blueprint references or blueprintue right now): Implementing GameSparks needs five steps:

  1. Connect to GameSparks cloud with your API KEY and SECRET (which are available after create an account on GS website) using the GS UE4 OOTB API
  2. Authenticate with a valid user on your Game (you need to register a game on GameSparks dashboard console, and then register a user by use a dedicated json request or a no-sql database insert into user collection). Also for this step you can use the OOTB API from GS
  3. Create some log events on GS Dashboard Console (with Javascript Language and dedicated server API) and give them unique names.
  4. Put a event listener (resolved by name) layer on a project blueprint (I put all event listeners under ATBTT_GameMode, but you can create the event listeners everywhere in your project).
  5. Push an event everytime you want to engage the server during gameplay in the blueprint.

I will try to make an example for points 3-4-5:

  1. You create a MOVEMENT_PROPAGATE log event on the GS Console:

with this javascript code:

  1. You create an event listener using the GameSparks API plugin on Unreal Engine 4 and check if the incoming event has “MOVE_PROPAGATE” name.
    If this is true, you move the current pawn (which should be same on the two computers) to the index given from the incoming message using the ATBTT framework functions

  2. Everytime you move a pawn, you have to send the MOVE_PROPAGATE message to the server, pointing the corrent target index of the grid and the opponent GameSparks ID.

This is how it works, sorry if I cannot share you a working blueprint.

Thanks. I’ll test this out shortly.

Hi everyone,

First off, I want to say thank you Monokkel for putting this toolkit on the marketplace. I’m new to UE4 and I downloaded this toolkit a few days ago and I’ve been messing around with a lot of the features and I think it’ll be a perfect start for what I’m trying to do.

But one thing I can’t seem to figure out is how would I go about starting with an empty grid and spawning units during play? Basically, I’m trying to make something like Disgaea (for reference,, where both players each start with a spawner and can pull units from it as the game goes on.