[SUPPORT] Advanced Turn Based Tile Toolkit

Hello, thankyou so much for your quick and detailed reply! I think I managed to follow steps 1 to 6 correctly though I wasn’t super sure about steps 3 and 6. I’m attaching some screen shots to this post so you can tell me if I’ve done it correctly. I set APtext as a varibable and called SetAPvalue as a message with the target being the APtext in the widget and the int values connecting.

Steps 4 and 5 seemed to go well but in 6 I wasn’t sure I’d got it right. In BPI_Puppet i created a new interface and set “update AP text” as an INT input. Then in the puppets event graph I called the interface event and linked that directly to set ‘displayedcurrentAP’ then called update HUD after that.

Hopefully I did all that correctly. However I didn’t understand step 7. I’m not familiar with creating actions and i’m honestly not even sure what it means. Also in which blueprint would I create this ‘action’? I did look ahead to step 8 and that is very clear of course. Perhaps you could go into more specific detail about what to do in step 7?

Thankyou so much for your help it is greatly appreciated!

Next question lol, I’ve been playing with the toolkit every night and have admittedly modified it quite to my turn style preferences so this might be on me. When I click on an enemy unit and it displays the unit’s range then click back to one of my own units it seems to keep the tiles highlights by the enemy there for the rest of the match. I’ve tried tracing it through with breakpoints to find why it isn’t clearing the tiles but can’t seem to figure it out, are the enemy tiles or the enemy ability made differently?

I’m also struggling why there is a need for BP_Ability and BP_AbilityBase and when to use which, I know BP_Ability is a child of the base but why not just have the movement blueprints a child of the base?

Hi Monokkel. I am now pretty sure I have steps 1 through 6 sorted. In the picture attached you can see that HP and AP appear on the unit HUD no problem but I still cannot get the numbers to react to changes in AP an HP like the healthbar does. I think this is because I don’t really understand step 7. Would you be able to go into more detail? Where do I create this ‘action’ and what does creating an ‘action’ entail?

Thanks again for any help.

Hey, what version of ATBTT are you using? The range highligting stuff for enemy units has changed a bit over the versions and is not implemented in the current live version. Do you want to be able to display this or are you trying to disable this feature?

BP_Ability is a child of BP_AbilityBase. AbilityBase has funcitonality for finding, validating and displaying tiles the player hovers over and clicks, instantiating any custom GridUI used for the ability and some other minor stuff. It is intended to be the minimum you might want to use for all sorts of player interaction. BP_Ability has a lot more stuff built in, like finding and displaying things in the ability’s range, action point costs, AI, functions for adding status effects +++. If you want to have an ability that is tied to and used by a unit and more or less resembles the example abilities used in the game, Ability is a good starting point.

Hi, good to see you’re making progress. Before proceeding to adding an action have you checked that calling the interface event in your puppet directly leads to the numbers chaning? If you have successfully done steps 1-6 that should be the case. If that works and you only need to add the action I recommend first watching a couple of tutorials on the action system, as it is essential for understanding how the toolkit works.

ATBTT keeps gameplay logic separate from what is displayed from the player and these things might frequently be asynchronous. For instance, if an AI unit decides to move to an enemy, attack it and end its turn, in the game logic this all happens instantly during a single tick. During the execution of this code various actions are queued. Then these actions play out in sequence (the AI moving across the movement spline, the attack animation playing, the health bar of the attacked enemy decreasing etc.). If you change the displayed health immediately when damage is dealt in the game logic it will happen immediately, before the unit has played its attack animation or even moved to its target. Instead you want to queue an action for displaying the health change which happens only after the attack lands.

This video is a bit old now, but in it I explain the general idea behind the action system:

After that watch this newer tutorial where I give a practical example of how to use the action system to create a teleport effect:

After you understand how the action system works see if you understand what I mean by my last couple of points. If not, let me know and I will help you out.

I must have made some mistake in steps 1-6. The AP and HP are currently static. That is to say, if I go into BP_Unit_Anim and change the attributes this does not effect the values of DisplayedAP and DisplayedHP in WBP_UnitHUD. Maybe If I go through it step by step you can tell me where I’ve gone wrong?

  1. No problems here as I just added the text to the widget and set them as variables.

  2. In BPI_UnitHUD I created SetAPValue and SetHPValue as functions and set their inputs as int.

  1. In WBP_UnitHUD I created two variables and bound the text of AP and HP in the widget to those variables. Then I used the interfaces to set those variables.

  1. In BP_UnitHUD I called those interfaces again in GetUserWidgetObject. Then in BP_Actor_Puppet I added two variables - DisplayedCurrentAP and DisplayedCurrentHP.

  1. In the UpdateHUD function in BP_Actor_Puppet I called Set APValue and set HPValue and set the targets as UitHudRef and the values as DisplayedCurrentAp and DisplayedCurrentHp.

6. In BPI_Puppet I created new interface functions for updating AP and HP.

and then in the event graph of BP_Actor_Puppet I tied event update AP/HP text to DisplayedCurrentAP/HP followed by update HUD.

Does this all seem correct or did I get something wrong here?

Thanks again (I am now going to watch those videos you posted).

Looking through this I don’t know what would not be working here. There is one performance optimization I would do, though. Don’t bind the text in the widget to the variables. Binding runs on tick, so that means that all your health bar widgets will have two text objects ticking. You only need to update the text when the value actually changes. So instead of binding and setting variable, just set the text of the text objects directly from your SetHPValue etc interface events.

How are you testing if this is working though? If you call UpdateAP text with some arbitrary value does nothing change? If you try printing the values at the various points of the execution chain what do you see?

Okay, sorted that optimization issue.

I have placed string prints in BP_UnitHUD to show AP/HP text current value. I have also placed string prints in WBP_UnitHUD. In BP_Actor_Puppet I have placed some default values into DisplayedCurrentAP and DisplayedCurrentHP (5 and 10) and it is these values that are being displayed in game and that the print strings are quoting, if I change those default values then certainly the strings and the in game display change accordingly.

If I go into BP_Unit_Anim (Whose puppet class is BP_Actor_Puppet) and change the attributes Current Hp and Current Ap there is no change in the displayed values in the strings or the on screen widget. If I get two units (both BP_Unit_Anim) to damage eachother the healthbar visibly drops but my HP value text remains unchanged.

I’m guessing that it is within step 7 that my displayed hp/ap values get connected to the current ap and current hp values?

(I’ve come back to edit this post and report my findings)

So after some tinkering I found that I can get get the displayed health number to work by sort of hijacking a node from another bit of code in the event graph of BP_Actor_Puppet.

If I just plug the currently extant float ‘Displayed max health’ directly into my own int "DisplayedCurrentHP’ and then reference that float in UpdateHUD instead of my int. Then when in game the HP number displayed gets updated on damage and correspons to the changing health bar.

I’m going to try the same with AP.

(edit, this also worked with AP in a similar way - by taking ‘current AP’ from paired unit and plugging it into my own int ‘DisplayedCurrentAP’)

I’m now going to carry on trying to get to grips with the action system through your tutorial videos. Just wanted to say thanks for being so quick to respond and ready to help. That said I’m sure I will have more questions for you in the near future!

Hey all, a new hotfix is live (v.3.02). This is again not a feature update, but a hotfix that fix some remaining issues introduced in the last, big refactor. Normally I wouldn’t want to send out a new update so quickly, but since this fixes a bug that could easily cause a crash I felt it was best to get it out as fast as possible. For the full changelog see my Trello.

v3.02 (live 10.03.21)

  • Fixed an infinite loop crash that occured if the player pressed EndTurn repeatedly
  • Fixed an issue where the health bar (and Unit HUD generally) would get pixelated when zooming in close.

Hey, glad you figured out how to get it working. Putting it into SetupFromUnit makes sense here. As for having it update during the game, changing your health number from the part of the code of the puppet that would normally lead to a change in the health bar also makes sense. However, displaying AP changing would have to be called from somewhere else, as you will probably want to change AP at times when Health does not also change. I recommend first watching the action system tutorials and then following the line of breadcrumbs from where the health bar is changed back to when the actions that lead to them are called. See if that gets you to the finish line, and if not let me know and I’ll give you a detailed rundown when I have the time.

I’m using the latest version available to unreal 4.26, the initial bug I reported I realized I was on an older Unreal and was thus working with an older version but now I’m all updated and should be on the latest version. I’m trying to get the enemy range displayed when you click on them, I’ve been able to do it by following through break points but I don’t think I’ve added it in the right place because there is this strange delay before it shows the enemy tiles but has no problem immediately showing the players move tiles which has a lot more tiles so I don’t think the delay is because of processing.

Ah, I see. Thanks for making me aware of it. The move and range display stuff got broken during my recent big refactor. I was aware of this and thought I had disabled accessing it, but it seems I forgot to do so in BP_AbilityBase_Idle. I’m guessing you’re using the strategy game mode, which would let you use this ability? I intend to reimplement this feature in the future when I’ve found a solution I’m more happy with, but at the moment I recommend just disabling it like so:

Apologies for the inconvenience. This feature should not be enabled currently, but I’ll bump up reimplementing it on my list of priorities.

New tutorial video is up! This is the first of three videos in which I show how to implement a combat system similar to Heroes of Might and Magic or King’s Bounty. I will cover many different topics in the topics, most of which will be of use in a number of different projects, so I’d recommend watching even if you are not making this type of game. In this first video I show how to modify the health bar to allow for displaying the number of units in a stack. This video is the result of me investigating a request by @ser.man94. Enjoy!

Second part of the HoMM tutorial is up. Here I go into how to set up the gameplay logic behind using stack sizes as a separate type of health. Check it out!

Third and final tutorial video on HoMM style combat is up!

Thank you vary much for video. How to download the version wath you use for editin? i wach firs video and make all steps. on second script are diferit. on description is version 3.02 but i try to do from epic but is the same version?

I’m back with a curiosity question - Is there a way to make the path system try to move around certain tiles but still allow players through without movement reduction? Like say a lava tile that going through would hurt the player so you’d want to stay away from but they can still move through if they really need to reach a certain tile but take damage doing so.

Hmm, it seems that you are right. I sent an update to Epic and got a confirmation, but downloading it from the launcher it seems like it didn’t update after all. Thanks for letting me know. I’ll send them a new version.

This is a tough one, and one I have tried to solve previously. I have not really found a great way to do this. Best I have been able to do so far is to run pathfinding twice. First with all “bad tiles” blocked and then again with nothing blocked. I store both pathfinding results and when trying to get to a tile I first look at the blocked one. If the tile cannot be reached from it I check the unblocked. Works okay if all bad tiles can be considered equally bad and if there are few enough of them that you are unlikely to pass through multiple ones. For something more complex you could do multiple iterations with various types and numbers of tiles blocked etc., but it will quickly become expensive. If you find a better solution to this problem, please let me know. It is something I have thought quite a bit about, but unsure what the best solution would be.

[quote=“Monokkel, post:3750, topic:21930”]

Hmm, it seems that you are right. I sent an update to Epic and got a confirmation, but downloading it from the launcher it seems like it didn’t update after all. Thanks for letting me know. I’ll send them a new version.

i try to mace a chieldo of BP_UNit but is not lice a video no accesto pupet and other setings.

It is posible to download te projectfrom video?

[quote=“ser.man94, post:3751, topic:21930”]

Do you mean that there is no actor called BP_Actor_Puppet in your ATBTT project? If so then you are not just missing a hotfix. The newest version of ATBTT that includes puppets etc. is the 4.26 version. You need to use UE4.26 and create a new ATBTT project with that version selected from the launcher.

[quote=“Monokkel, post:3752, topic:21930”]

i use the version 4.26 also clear local cache and download it again.

maibi is posible to donload the projekt from video or only cheanget files?