[SUPPORT] Advanced Turn Based Tile Toolkit

Hi ,
it turns out that although I did fix the input settings, there were other project settings that I missed. I just found I needed to add several trace channels, like “PathTrace” etc.
Since my project relies on some c++ modules, I had to migrate ATBTT into the cpp project instead of the other way around. There were history project settings, so I have to run a merge for all the config files now. Could you tell me the key project settings that I shall pay special attention to? Right now I found trace/collision and input are essential, are there others?

Ok, this makes sense. Normally when migrating to a new project I just copy over the config folder from the ATBTT project and that takes care of everything. The important stuff is what you have noted (input and trace channels).

Thanks, I’ll check it out.

Hi ,

New to the tool kit and I have been trying to figure out what is the best way to make Fire Emblem battle system (letting both player and enemy attack, having damage calculations based on stats etc.) by reverse engineering stuff and I’m trying to figure the vanilla action system before I start changing it, so I don’t mess things up too much. I’m sorry if these are addressed in your tutorials, but the changes to the organization of the toolkit is making it a bit hard for me to follow them.

So first confusing part is that you have this “Take Damage” thing on Execute Ability-function, that I don’t know what its for, because even if I skip it the damage is dealt anyways by QueueAction with “hurt” in Animate Actions part of the event graph, atleast that’s what I think is happening. So what is that Take Damage thingy actually doing? Is it an outdated part of the blueprint that I don’t need or does it have some other behind the scenes use like keeping some other part of the blueprints up to date or mining cryptocurrency?

Second, I get the execute ability is connected to the Animate Action Event that goes to Attack and from attack the actual attack action is called “ranged” isn’t it? The problem is that I have no idea where it leads next and ctrl + f doesn’t seem to help either. So yeah, where I can find the other part of the ranged action?

Third question is a bit broader and I hope I don’t waste your time too much on this: What should my first step be and where is the proper place for the first step in blueprints/are there things I should know? I* think *the location of the “ranged” action is going to be the place for me to do the edits, but I have a tendency to make things way harder for me than it actually is because I really want to understand the whole system. Thanks alot in advance!

Hey Veijari, have you checked out my videos on the action system? In them I explain the difference between server-side game logic and client-side visualization to the player. In the case of dealing damage, the TakeDamage event manipulates the actual value of CurrentHealth of the target unit, which is all the game logic cares about. In contrast the hurt action is responsible for triggering the hurt or death animation and visualizing the damage taken on the health bar. If you only use the action and not the TakeDamage function the game will not treat the unit as hurt, and if it “dies” it will still be alive according to the game logic and have its turn even though the unit has seemingly died. So it is not redundant, but is caused by how the toolkit splits everything neatly into game logic and visualization. Actions are intended for the latter and not for mining cryptocurrency :wink:

“Ranged” is the action this ability is calling in this case. You can find out which blueprint an action will be called by looking at the ExecutingObject input. In this case it is the OwningUnit of that ability. Your next step is then to look at the AnimateAction event in that blueprint (likely BP_Unit_Anim if that is what you’re using) to see how the action plays out. You’ll see that there is no defined behavior for “ranged” in the switch following AnimateAction. In this case it goes for the default, which is to send the action along to the unit’s animation blueprint, where it results in an attack animation.

Again, I explain all of this stuff in more detail in my Action System tutorials vids. This is the most unusual part of my toolkit and it is natural that it takes some getting used to. Though when you’ve mastered it I think you’ll find that it is a very useful way to organize a sequence of actions without drowning in event dispatchers and a spaghetti of calls and callbacks. It also has the added benefit of making multiplayer replication very easy.

As for counter attacks I had a discussion on this here fairly recently. The discussion starts here. Hopefully it will help you get started.

Early testing of climbing with animations in the experimental maps.These wonderful new animations are courtesy of @Bankworthy, who also rigged the skeletal meshes in JungleRaid for me back in the day :smiley:

In other news I’m pretty far along in reimplementing overwatch, so it should be included in the next update. Still a bit hacky, but much less than before.

It’s fascinating. How and when can we get this function?

@ Looking hot and sexy ! This may be me speaking unnecessarily, but my animation-autism-senses forbid me to not point out I’m seeing hacky snapping between animation states at the end of that stairs climb? Probably just some timings that need be tweaked, maybe you’ve already taken care of this.

Take your time too for the update, we’ll wait patiently! Keep rockin’

Should be in the next update, which I’ll release once UE4.22 is out.

Don’t have to be autistic to notice that, as it is pretty glaring. This was just a first test which I threw together quickly, and I’ll make sure to fix it before release.

Does this support individual Character blueprints. I.E., I want to be able to have the PlayerRanged character only be able to move in a straight line, but as far as they could go until an enemy or obstacle is in its path (so the PlayerRanged can only do one turn and if they go straight upwards, they cant just instantly go another direction. And a separate blueprint for PlayerMelee, that only allows him to move one or two spaces in any direction, but must end their turn.

Is something like this possible?

You’re thinking of something like chess? The toolkit does not support this by default, but it is relatively simple to modify for these purposes. It basically involves finding all tiles in a certain range and then filtering them based on the requirements of the unit. For instance, only keeping tiles where either the X or Y locations are equal to the location of the starting tile, if you only want tiles in a straight line.

Hey again and thanks for the help! I checked out your links and managed to do an ability with counter and follow-up attacks, but I got one problem on the way: Currently if my defending unit can hit twice and kills an enemy with the first one the “game freezes,” or rather doesn’t end your turn. On top of that the defending unit uses his last attack on air or worse, on nearby enemy damaging it. Is there a way to prevent this?

EDIT: I managed to fix it nvm! I did it by simulating the combat first and adding the necessary information to an array and then running for each loop that filled the Queue actions. That way I didn’t have any unnecessary actions on queue.

Hi , is ATBTT still fully multiplayer supporting? If so, on which map can we use multiplayer setup to play? Is there anything we need to modify before trying multiplayer?

Glad you figured it out :slight_smile: If the game does not continue, or conversely if turns are suddenly jumped to before the animations from the last one has ended, it is usually because EndAction is not called when it should be (in the first case), or too often (in the second).

Yep, multiplayer is fully supported. To test it out on a specific networking solution you’ll need to set it up specifically for that solution. For instance if you’re using steam you have to enable the Steam Online Subsystem. Other than that you need to set it up so that the appropriate units are owned by the appropriate player controller. You can set these owners manually or you can use the default ATBTT solution where you set the DefaultOwningPlayer variable of each unit.

Hello again.

So while I was trying out my battle system I figured that the “Enemy Faction Wins” message wont spawn, whenever an enemy kills the player during a fight that player initiates. The turn just passes for enemies and after the enemy turn is over, the game over screen spawns. The most confusing thing is that this happens only when the player is the initating, if the roles are reversed the game over screen spawns instantly. What is up with this?

On my machine the client other than listening server are broken. Errors are generated if ran with 2 players. For example, we use current pawn from game mode ref, but game mode ref is null on second client. Any ideas?

This looks good and I am really happy to see your new overwatch feature. Thank you !

When I designed the End Game functionality I did not have simultaneous attacks in mind, so you will need to make some minor changes. Since I’m not 100% sure of your exact setup you need to test a bit yourself, but the relevant code is in the event graph of BP_Unit at the far bottom right. Here you find the code that checks if the game is over and sets GameOver in the Turn Manager to true if this is the case, causing it to display the game over message when the current turn ends. Check out the CheckIfGameOver function and see how it interacts with your current setup. You probably only need to make some small change here.

Could you be using an old version of the toolkit? The current unit has not been stored in the game mode for more than a year, I think. I changed that in update 1.8 with multiplayer in mind. It is built into Unreal Engine that only the server has access to the game mode, which is why I switched the reference over to BP_TurnManager. If you have version 1.7 or earlier I’m afraid adding multiplayer is extremely difficult, as I did a major refactoring to enable multiplayer after this. To get the latest version, select the latest version of Unreal Engine when selecting Create Project with ATBTT from the UE4 launcher. Hopefully you have not made so many changes yet that migrating your work to the new version becomes a big challenge.

You’re welcome :slight_smile:

Okay looks like the problem wasn’t your end game functionality, but the “Contains grid units”-branch at the start of the ability. I don’t understand why it does that yet or how how to work around it, but wanted to keep you updated. I think splitting the movement and attack part of the ability should do the trick. :slight_smile:

EDIT: Nvm it wasnt the case. I’ll update once I find the solution.
EDIT 2: Okay now I think it might be this part where you have the TODO marked. I am not 100% certain, but it really feels like that way, since that part of the blueprint wont light up when debugging, though there are several other parts that wont either.
EDIT 3: Pobably the last edit, since I am 90% sure that its this part of the blueprint! When a slower (= that gets double attacked) **player **unit initiates the combat and dies, the deselect actor doesn’t light up and the turn passes to enemy when it should call game over istead and when a slow **enemy **unit initiates the combat and dies, the deselect actor lights up and the game over screen comes online! I think my system needs this to be always called, so how do I change it?

OMG, you know me so well…

Hey all, 4.22 is out and I still have a bit of work remaining on the next update. I’ll try to get it done soon, but in the meantime know that the 4.21 version of the toolkit seems to convert to 4.22 without any issue, so if you’re working on a project using the 4.21 version you can open it in 4.22 and create a working copy.

Hey Veijari, sorry for the late answer. The deselect actor event in BP_Unit actually does very little in the base setup. It basically just helps the big unit system remove the unit from all grid tiles. Even EndActorTurn does very little unless you are using the specific behavior tied to it (status effects or the exhausted icon), so I doubt this is what is causing your problems.

As mentioned, since you’ve made some changes that go against one of the base assumption of the toolkit, figuring out the resulting issues is a bit of a shot in the dark for me. Would you be willing to share a version of your project (just needs to have the relevant changes) and I’ll take a look at it myself.

If you choose to convert to the newest version and run into any problems I can help with, let me know :slight_smile: