[SUPPORT] Advanced Turn Based Tile Toolkit

I think I need some help again. I have tried to add other vehicles but cannot get it to work.

In this tutorial at 10:47 you make a copy of the unit parent to add a static mesh unit to the game.

However, when I try to do the same I cannot seem to find anything like it, I tried making my own by creating a new one based on the BP_Unit blueprint and even got the healthbar to work after copying lots of stuff manually. However, I could not make it selectable or movable. Same when I used BP_Unit_Anim as a base and removed the skeletal mesh and replaced it with a static mesh, seemed to break a few things that I dont know how to fix.

Iā€™m guessing you forgot to delete some of the stuff that calls of the animation blueprint. Try duplicating BP_Unit_Anim again. Delete the skeletal mesh and replace with a static mesh. Then delete everything in the event graph except for the stuff that specifically has to do with the health bar. The event graph should look like this:

https://i.imgur.com/p81gYxT.png

Note that there is also a small bit in the construction script that sets up the reference to the health bar (check BP_Unit_Animā€™s construction script)

This works fine on my end:

https://media.giphy.com/media/9Vb9JLAIJyTzVYDFz6/giphy.gif

As for your attempt to use BP_Unit as a base, did you make a child blueprint of BP_Unit or make a duplicate? If you made a duplicate then all the code in the game that references BP_Unit will break for that unit, since it is no longer of the BP_Unit type. Is this what might have gone wrong?

Thanks for a super fast response! I made a child BP from BP_Unit.
Seems I must have missed something there, now I just have to figure out how to kill it properly but I think I can sort that by looking at your tutorial :slight_smile:
I also think Im going to have tons of small stuff to sort through for quite some time now.

Another question, have you ever tried projecting the grid on a sphere, like a geodesic grid? I know this is probably quite complicated but just wanted to check if you had already tried it.

Example for my idea of movement would be this video of the game stoneshard (https://youtu.be/CspD9zMTlTg?t=9m21s). Turns would be simultaneous and attacks would be charged for a certain amount of time before they activate.

Hi, its interesting that you mention simultaneous turns since that is my plan as well. I have started to look into the turnmanager code and will start breaking stuff as soon as I figure out where to start and how to make it work later :stuck_out_tongue:

I want my system to work as follows:
At turn start you can issue orders to any pawn and each action will require a certain amount of time (action points). Each turn will consist of x action points.
Instead of moving each order will be added to an order list, I do plan to visualize each order when pawn is selected. Examples of orders could be: chase and attack a specific enemy, hold position and defend. Shoot any enemy coming into range or a certain area etc.

However, no units move until end of turn when enemy movement and friendly units are moved in unison according to their orders.
This can result in unexpected combat when units meet or no combat if the enemy is not where you expect them to be. Or you can walk straight into a well prepared ambush :stuck_out_tongue:

Im not 100% sure on how to do it yet, but I think I will try and split each turn into a set number of actions (time slots) and then save each units action for each slot so they can all be replayed together.

The toolkit is not really set up for simultaneous turns, but there are developers who have modified it to achieve this with a moderate amount of work. [USER=ā€œ2637660ā€]Doxs Roxs[/USER] has some good suggestions, and I know that @mflux has also made a lot of progress in this regard. I would recommend discussing this more with them as I have not tested this sort of stuff myself. I imagine that what you are describing should be somewhat simpler than some other simultaneous turn stuff, since each ā€œturnā€ is essentially one step on the map or one attack. I think you could more or less fake this by having the player do his action, then having the AI react like in regular turn based combat, but then animating both the player and AI at the same time. So game-logic wise it would still essentially be one turn after another, but not how it is shown to the player. I suspect something like this is done in Stoneshard.

Hi, Iā€™d like to know how to change the texts of the win/lose states (PLAYER FACTION WINS) so that I can put them in Spanish.

In the WBP_ATBTT you can find the Game Over Hud in the EventGraph.

Ok I am lostā€¦ tried too many things but I canā€™t get it right. The player jumps to the moon and back lol.

This should do the trick:


https://i.imgur.com/acTazyX.png

What Studder said (thanks, Studder). Also check out the FindAndDisplayGameOverText in BP_TurnManager where this is initially called from.

Oh my gawd you are the best!! It works flawlessy now. Awesome!!! <3<3<3<3

Ok, Iā€™ve sent version 1.91 of ATBTT. It is not exactly a feature update, but not purely bug-fixes either. If you are making a networked multiplayer game I highly recommend changing to this version, or at least implementing the specific changes to the action system, as they should make networking quicker and more stable. If you are heavily invested in a project which is difficult to change at this point it can be skipped, but make sure to make the following minor change, which was causing a memory leak:

In BP_ActionManager ActionName was not plugged into Selection in the switch in the AnimateAction event. This would cause actors not to be properly destroyed, which could become a problem for long-lasting games that spawn lots of temporary actors. Make sure to fix this if you change nothing else:

Other than that, the changes are listed above. Epic should hopefully upload the update in a few days.

v1.91

  • Minor refactoring of the Turn Manager to make it more flexible for different turn implementations.
  • Added idle ability that is active when no other abilities are active.
  • Added client-side validity check system in BP_ActionManager
  • Several minor bug fixes (see Trello for details).

Hey first of all thanks for your hard work on the Advanced Turn base. I buy your pack this summer and I am developing a project for school and I would like to know how can I make an AoE effect that is base on tile lets say I wanna make a fire beam that targets everything in front of the player for a 3 square large I did try to use the grenade one but it is not really what I want.

Hi aeon, here are two functions I made recently for drawing lines on a square grid. These functions were made specifically to take tile edges into account rather than visibility, so if you want the lines to stop if the visibility trace is blocked you need to change the checks of the edge array to running line traces. If you start three of these line functions side by side you should be able to create a three tile wide AoE beam:

FindTileLine function

GetSlope function nested within FindTileLine

hope that helps you get the results you are after

Hi again

I have managed to get stuck, partly since Im trying to change your system completely, and partly because I dont even know the basics of the Unreal engine :stuck_out_tongue:
However, I hope this problem is simple enough that you can still help me in the right direction.
I have removed the initiative sorted list and some other stuff that I dont think I will need.
I start the game with no unit selected since I dont really see a need for that in the gamemode that I plan to use.

My current problem is that Im not quite sure how or where to catch mouse clicks on a unit or the map so that I can use that to activate the unit.

My initial thought was that this should be in the BP_GridManager since its the thing getting clicked, or some other central place where you would look for input each tick.
But I seem to find most of the clicking stuff in BP_AbilityBase and Im not quite sure how parts of that blueprint are fired up unless a unit is already selected?

Edit
I think I solved the issue, found the input stuff in BP_PlayerController_ATBTT where I should have looked first tbh.
Now I just need to figure out how to activate units from there instead. I wont focus much on the multiplayer code, but I will probably have to review how to get that part to work later.

Is there any reason for me to state that something should be executed on owning client?

I think you might want to look at the new update that went live yesterday, where I added support for just the sort of thing you are after. I added a new ability called BP_AbilityBase_Idle which is active when no other abilities are active, including when no units are selected. By default it is set up for selecting units, which I think is what youā€™re after. As you have found most input is handled through the player controller, which is generally best practice in UE4.

Thanks! Ill look at that, but I think I have already made to many changes to go back to a fresh install. Or maybe I can just copy the parts I need/check how you did it.
But to be honest its a mess at the moment, Im just hacking and slashing my way through it all :stuck_out_tongue:
Im learning a lot though, its great to have your framework to start with since I can copy/repurpose stuff that is already there.

Hi again, is there any way for me to see what has been updated or do you have a change log somewhere?
I can see a lot of changes in for example BP_AbilityBase but Im worried I might miss stuff if I just start copying over things at random.

On new updates I try to add a boolean marker designating when something was changed for all major changes. Use the ā€œFind in Blueprintsā€ window and search for ā€œversion191ā€ and you should find all of this. Version info is also described on the second post of this thread and on my Trello. Not that not every little change is marked this way, but the biggest changes should be noted. If you are using version control you can see what blueprints were modified and can merge over changes that has been made in one version to another, but if you have made changes to the same blueprint that has been changed in the update you would still need to copy this manually.

Hey!

Two questions:

  1. When creating a new project with the newest version, then adding a new C++ class to the project, I get an error. Does this happen to anyone else or is it on my end?

  2. Iā€™m about to start implementing the UI of a card system for the abilities, where is most of the logic placed for how the current abilities are shown and made clickable etc?

Thanks in advance!

Cheers,
Mivke