[SUPPORT] Advanced Turn Based Tile Toolkit

That’s a relief, thank you!

I did actually remember one other question I wanted to ask you! I did fix the problem for myself already some time ago, but I’m wondering if this is intended behaviour.

I could not get a purely self-targeting ability to work. In a fresh new project with only the toolkit and nothing else, if I try for Range = 0 and “allies/can target self” checked (on the Heal ability, but the abilities I was working on in my own project behave the same):

Then I don’t get any targetable tiles whatsoever and can’t select anything, not even self.

If I put the Range back to 1, but uncheck “allies” and only leave the “can target self” checkmark, I now can’t target allies OR self. Neither is selectable. And checking allies in this context is obviously not desirable, since I don’t want to allow targeting allies.

self3.PNG

In my own project I managed to make the following workaround:

Which finally gets me a target-self-only ability with appropriate tile marker:

self7.PNG

Is this intended behaviour? (If yes, no problem, I can just copy my workaround into the next update and such. The “Can Target Self” checkmark just threw me off.) Or was I just missing the correct option somewhere? =)
Now I’m really out of questions, hopefully for some time, haha.

Yeah, this seems like it is probably a bug. Thanks for posting your own workaround for this. I will add it to my buglist and investigate.

1 Like

hello! I’ve recently purchased this toolkit and much to my dismay, the pathfinding system, though efficient, is not much to my liking.

The pathfinding I wish to incorporate is one that has both a manual and automatic algorithm. Something that Advance wars used.

In Advance Wars, I can sort of manually draw my own path but if the path were to become longer than the unit’s move range or the next visited tile is not adjacent to the latest member of the path, it would then resort to automatic pathfinding.

As you can see in the image, the path taken is not necessarily the best path as going through the forest, instead of taking the road, would cost less fuel (which is an in-game mechanic) but the player is able to draw that path because it does not extend beyond the selected unit’s move range
image

Hi Falseking1, not to worry, this isn’t too hard to add :slight_smile: I gave it a try. See if this will serve as a starting point:

First I created a duplicate of BP_Ability_Move to have a starting point for the new custom move ability. Next I added a few variables for storing the path we are building inside the ability:
image

Next I modified PlayerActivate part so that we run pathfinding from the end of our stored path. I also split it to create a new callable event which will be used when updating pathfinding while using the ability:

Within the nodes above you’ll find this function I made for clearing the stored path:

Next I updated the click/interact code so that when we right click (secondary) we store the path to that tile and update pathfinding from that tile:

Note that I also added some code there which clears the path if the player clicks an invalid tile, allowing the player to start again.

I also modified the CheckIfValidTarget function:

Finally I modified the hover code so that we show the entire stored path when we hover over a tile as well as the final part of the path originating from the current end of the stored path:

Hope I remembered all the steps there and that this is close to what you have in mind. Here is how it looks in-game:

Let me know if you have any follow-up questions :slight_smile:

New version of ATBTT is live! This update is a pretty big one. I’ve added two new systems to the toolkit, which are the Stats System and Event System. Note that both of these are still considered experimental and contained in example maps that don’t touch the main toolkit’s functionality.

The Event system I’ve brought over from my newest asset, the Roguelike Deckbuilder Toolkit. It is a more flexible and powerful version of UE4’s event dispatcher system, which will let blueprints bind to and call events either globally or tied to specific blueprints. It is extremely useful for creating complex, interdependent game rules.

The Stats System is a data driven and component based approach to Unit attributes, such as health, action points etc. as well as status effects. It lets all of these different types of attributes play by the same rules so that they can be modified by the same functions, but where each stat can also define their own behavior. It is something of a combination of the stats system in the Dungeon Crawler Toolkit and the Status system in the Roguelike Deckbuilder Toolkit.

The Strategy RPG map (previously called the HoMM map) has been updated to use both of these systems, to serve as an example for how they might be used. I have also made it fully replicated.

Below is a partial changelog. See [my Trello]( for a more complete list (under v.3.3)

v3.3 (live 07.01.22)

  • New “Stats System”. Makes it easy to add and modify stats, status effects and traits. Data driven and component based. Are automatically replicated to Puppet.
  • Added custom “Event System”. Adapted from the Roguelike Deckbuilder Toolkit. Makes it easy to send and receive gameplay event for any blueprint.
  • Widget UI for displaying unit stats and attributes
  • Updated SRPG map (previously called HoMM map) with Stats system and Event system, to serve as an example map for these new features
  • Setting Unit properties through data
  • FIXED: Double abilities are spawned for loaded maps
  • FIXED: Double puppets are spawned in MP spawn map
  • FIXED: Actions weren’t always properly destroyed in networked games
  • FIXED: Crouching units would keep animate sliding forward after climbing a ladder
  • FIXED: Abilities with CanTargetSelf set to true and a range of 0 don’t work
  • FIXED: Active unit marker appeared briefly at times when it should not during puppet animation

Made a new feature trailer to showcase the toolkit’s features! Seven years of continuous updates adds up :slight_smile: This will hopefully make it easier for people to get a grasp on what is included:

1 Like

I have a unique case question here, that probably most people wouldn’t run into. I want to make a HeroScape like game, and one of the rules in the game is that if a unit walks into water, their movement is terminated. This means that if they have to move through 3 tiles to cross a river, they have to take 3 turns, as every tile of water stops their movement. I’m wondering if there’s a way to make a tile behave in such a way that a unit’s movement can be any number, but they’re forced to stop on this tile, no matter what?

Sorry that my reply is taking a while, AugmentedSmurf. As discussed on Discord, this is a somewhat complex problem so I will need to solve it a day where I have the time to work on it for a bit. So it might still be a few days, but then I’ll give you a thorough and detailed answer.

1 Like

Hi, sorry for taking a long time to reply to your questions, but I figured that the best way to answer your question was actually to make a video. Hope this will help you add the features you wanted and also learn you (and others) some ways to modify the toolkit to your needs:

1 Like

New tutorial is up on the recently added Stats System. In this first of several planned tutorials I cover how to add, access and modify a new stat:

Hi! I began using the toolkit recently, and it’s a great base to start from. But I am still struggling a little, so here are my questions.

I don’t know if these details of my project are important, but just in case. I plan to have several fractions on the grid at the same time, player fraction and 3 other Ai-controlled fractions, each hostile to one another. And every unit has the move range of 1.

1.I would like to create a “set bait” ability. Only the player has it, and it affects only a certain fraction. It also has a certain tile range where it works (like 3 tiles in every direction for example). So, if the player chooses to use it, the bait is set on the tile where the player unit stands. Then an ai-controlled unit of affected fraction in range should start trying to reach it. Here’re the parts I get confused about within the toolkit. How do I make an ai-controlled unit choose the bait as a primary goal in pathfinding? And how do I turn it into an ability blueprint?

2.I would also like to give the player an opportunity to move crates. The crate in this case is an obstacle that occupies an entire tile. So, moving it becomes possible if the player unit is standing on the tile next to the crate. This is not an ability, just an interactable object.

By clicking on the crate the player activates “crate moving” state in the unit: the animation is changed and new movement rules are applied. And clicking also disables it. These changes are supposed to happen within one turn.

The pair unit+crate can move only if the path is clear for both of them. Now it’s something like a 2-tile unit I guess. So if the crate is blocked on the east tile, and the unit is not, then the unit holding the crate cannot move east. But if there is an enemy unit in the crate’s way, the crate moves the enemy. Player unit can move the crate on the enemy, and by doing that move the enemy by one tile and cause damage to the enemy. If the enemy is standing against an obstacle and thus cannot be moved, then the enemy is just an obstacle.

After the movement is finished and the turn is finished, player unit stops holding the crate and on the next turn remains in its usual state (meaning not ready to control the crate until the player tells the unit to).

I hope the explanation wasn’t too complex. Can something like that be done within the toolkit systems? I can’t quite figure out how to change player unit’s pathfinding type and its visualization if an actor on the grid is clicked. The temporary pairing unit+crate also seems tricky, as well as setting the pathfinding that enemies are an obstacle for the unit and not for the crate.

Hi Elaine, thanks for the purchase! So both of these questions are a bit complex. The second one certainly more than the first one. I believe both of these should be doable in ATBTT, but they require some work. I’ve spent some time finding a solution for the first one and it required adding quite a bit of code. So it will take some time to paste and explain all of it here. So before then could you check the video below and confirm that this is what you are after?

Thanks for your quick reply, I appreciate you taking the time to look into my questions. Yes, this is exactly what I was looking for.

Ok, sorry for taking a bit longer to reply now, but now I have the time to give you the steps.

First make a new map and add the ability system component to the units (or use the Advanced map, which has this by default, though it also has some stuff you don’t need). Make one unit have the Enemy faction and be AI controlled. Set their Move to 1. At this point if you play, the AI unit should move towards the player one step at a time, but we have no way to place bait.

Next we make our bait. I’m using a pretty simple blueprint for this. I create a new blueprint based on BP_GridActor (which comes with some functionality for interacting with the grid) that I call BP_GA_Bait. I add a static mesh (with collision disabled) just to visualize it. On BeginPlay for this actor I add a reference of it to the GridManager at its GridIndex, like so:

This doesn’t do much in itself, but it will let us discover it later by querying the grid.

Next we make our ability for placing bait. I create a new ability based on BP_Ability. On PlayerActivate I tell it to find all tiles within the ability’s Range that can be seen by the unit and add them to a Set. I also tell the Ability’s GridUI to display this to the player:

In ExecuteAbility I add functionality for spawning the Bait:


Note that this will happen instantly when clicking a tile, which you might know isn’t the way I generally do things in ATBTT (because of the action system), but since we probably always want the actor to be shown immediately after click it should be fine (if there will be cases where ExecuteAbility will be called while actions are currently playing, such as if you add AI that can use bait you might want to start the bait off invisible and have it spawn an action to turn itself visible on begin play)

Anyways, now we have our bait spawning ability. But the AI doesn’t care about it at all. To do this we will need to modify the movement AI, which is contained in whatever move ability the AI has. I’ll make a new move ability by duplicating BP_Ability_MoveAttack.

Now I’ll modify FoundNoValidTarget event, which is what is normally called when the AI finds no enemy in attack range (which will be common in a game with a move range of 1). Normally this would cause the AI to search for the closest enemy unit and move as far towards it as it can. We want to add code so that it will move towards Bait instead if it exists on the map.

For this purpose I create the FindClosestBait function for this ability:

Then I implement it in the FoundNoValidTarget event (thank the gods I bought an ultrawide monitor):

Okay, we are basically done, but just in case you might want units with longer move ranges later I’ll add a similar modification for when there actually are enemy units in move range. For this I override FindPotentialTargets so that we also find Bait along with units:

And I modify FindTargetValue so that non-units (which are always bait unless we add more such actors) will always be prioritized as targets over units:

And there you have it. If you follow the steps above you should hopefully get the result I added in the video in the last post. There are a lot of steps so it could be that I missed one, as I had to do this writeup a couple of days after coding this. Let me know if it works or not and if it gives you the result you want.

1 Like

Everything works just fine! Great step by step explanation, and the implementation was quite clear. Thank you very much for your help.

Hello! Wonderful toolkit, very impressed. Quick question, I’m trying to add floating damage text that appears whenever a player or enemy is damaged. Does anyone have suggestions on where/how I could best add this feature? Still a beginner to Unreal so explanations are greatly appreciated. Thanks!

Hey, glad you like the toolkit! Check out the map in Maps/StrategyRpg. It comes with floating damage text (and floating text for applying status effects as well)

Perfect, thank you!

1 Like

New update is out. This one is just bug fixes, as well as some tweaks to prevent issues in projects converted to UE5 preview. Here is a list of changes:

v3.3.1 (live 03.03.22)

  • FIXED: In converted UE5 projects several types of decal tile markers did not show up.
  • FIXED: Naïve tile finding function in AbilityBase was imprecise for multilevel grid.
  • FIXED: Clients will sometimes run BeginPlay on the PlayerController before the Pawn is valid.
  • FIXED: The GridIndex output was not connected in the Interact Exit Tile event in BP_GridManager, causing events bound to tile exit not to fire.
    FIXED: The thickness of lines in the grid line display were affected by grid size.
  • SRPG map now starts with hourglass cursor set

New tutorial is up, showing how to use the new Event System for subscribing to and running gameplay events: