[SUPPORT] Advanced Turn Based Tile Toolkit

I too would kill to see a Gears Tactics style movement system added.

Okay, next question. Does the grid manger in your hybrid map have the cover system and stealth system components? they are necessary for the advanced abilities to work properly. I have tested out the hybrid map with advanced units and I cannot reproduce the crash you are reporting.

Thanks! So far the magic far outweighs the tragic when it comes to having a kid, so if it just gets better I have a lot to look forward to :slight_smile:

Hmm, the WaitForOngoingActions macro should do what you are describing already. I guess something is not working the way I’m intending. Are you able to reproduce this in a fresh project and give me the repro steps?

I’m afraid you are going to have to elaborate. I have unfortunately not have the time to play Gears Tactics yet (though it is high on my list). Can you describe in detail the mechanic you are after? Perhaps provide a video?

Thank you so much for your reply glad to hear you are having magic with your kid hope to have one my self soon. OK I started a brand new project and show what I do start to finish glitch 1 is at 3:24 where the camera problem happens glitch 2 is at 5:04 where the spawn units with ability’s happens. I do have both cover and stealth if there is anything I’m missing in the video or you need me to test let me know please and thank you. I tried to make the video as short as possible its about 5 mins 30 secs long.

Yes I think I can :slight_smile:
Basic level, game mode initiative (I think its optional), add initiative bar, set move_attack to from pathfinding costs, add ability system, set move attribute to 1, set action points attributes to 6, add 8 ai enemies, set their current health to 50 (optional too I think) add the heal ability to all of them, give your own unit some more health.
Add a print string to BP_Turnmanager after “run on actor selected”. You will see, that sometimes it prints out the next unit even when the previous one is still acting.

Greetings :wink:

ok there is alot to filter through in this thread. soo if someone can point me in the correct direction cause my searches are yielding confusing results.

i guess i should list a few things i am trying to do.
goal: make a text turn based tactical rpg.

  1. I want to make two teams for starters that are both controled by ai (figured that already)
  2. ai from team 1 needs to read from its list of actions given to it from various text files
  3. at the end of each round (both teams turns) return a combat log
    - return all actors alive
    - all actors current health
    - any debuffs or buffs (later on down the road)
  4. need to make scripted events along with mandatory spells that must be cast enemy ai (team 2)

Sorry for the late answer, people. Been busy with the baby, and the questions here were tricky enough that I had to test some things in engine before I could answer. Ok, here goes:

So for the camera issue, the camera panning when shooting a laser does not seem to play nice with the camera interpolation between thrid person and top down. Did not have time to fix it properly, but you can simply disable camera panning in the laser ability to prevent the issue:

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

for your second issue, this seems to be a more general ATBTT issue. I do not automatically setup the ability system component for units spawned at runtime with this component. You can modify the unit spawning code so that it is properly set up, like so:

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

Hope that gives you the results you are after!

Hmm, ok. So you have a pretty strange setup, which I guess might help explain this issue. Wait for Ongoing Actions works great if there are actual actions to wait for. But if your enemy units only have the heal ability and there is nothing to heal, they will never queue any actions on their turn, which might make it possible for the turn manager to skip between the units more quickly than I intended. This is an unforseen effect of when units have no valid abilities. I will need to look into this a bit more closely to figure out a good solution. Until then, could you describe why you need unit selection to wait for ongoing actions in your particular game? Helps for me to know the possible edge cases when I’m making changes like these.

Hi Lux, noone who makes a game like the one you describe has asked for support in this thread, so you won’t find answers to your specific questions in earlier posts. I’ll see if I can help you though.

Yes, that is as simple as checking the “bAIControlled” bool in the unit blueprints.

This is more of a general UE4 data question than an ATBTT specitic one. UE4 does not have any built-in functionality for reading external text-files that I’m aware of. I did code this for a project I did at work in C++, so it is possible, though. Probably simpler if you can format it in a way that you can import as data tables. As soon as you have access to the data there are various ways you can set things up so that what abilities a unit has is defined in the data tables. Could be simple or difficult depending on exactly what you’re after.

That should be simple. Loop over all actors and log their health and status effects.

This one I don’t really understand. Could you give some concrete examples?

Really curious what sort of game you are making here. Are there any published games similar to this that you can mention?

Nah they got Move_Attack too. Just additionally the heal ability. So just a normal setup + heal ability. The only thing, that is a bit special, is that the ai has multiple actions in one turn, during to “from pathfinding costs” and multiple action points.

Edit: while testing along, I figured out, that it mostly happens, when the second (or third and so on / the first one works) AI Unit in a row moves with move_attack after using an ability (heal f.e.). There is then no (or to short) action qued for the movement. Therefore it skips the “wait for ongoing actions” The “Move Timeline” works fine too, as far as I have checked via breakpoints. But even when “Call on Unit End Movement Animate” is not reached for the first AI unit, the next unit gets active to early.

But thats really only happening, when the ai uses an ability first and then starts moving. When they are only moving everything works fine.

I have two potential places:

  1. Is it maybe, because the array is cleared here? (screenshot) Just unhooking the “clear” crashes the engine for me when I click “play” btw :slight_smile:
  2. Or because the actions within “heal” ability f.e. are run with the immediate tag

:eek::):eek: Thank you so Much both things worked 1000% now that is resolved I can really focus on making my own ability’s and system have already converted the laser to an arrow and will be following your videos to add my own creatures and animations. also now that I know the camera issue came from the laser ability it will help in future if I do decide to do stuff with the camera to always check to make sure they are playing nicely with other camera operations. again thank you I hope you are having so much fun with your family.

  1. Congrats on the baby! new life is good life take care of it :smiley:
  2. That would make a lot of sense why i couldnt find anything
  3. ok soo it needs input into data tables first and then the ai can use the information? cool, i kinda figured as much but, im also new to all this.
    - where can i find the data tables for movement?
    - my first goal will be to force each of the ai actors on team 1 to move to only one specific tile based on the text file each turn
  4. i know there is a section in one of the videos about getting the tile location to print to the screen. i will look at that video again and start there with making the loop
  5. as far as scripted events i wanted to make scripted events kinda like boss encounters in wow. I want certain creatures to skip ability assessments and be forced to cast certain spells or move to certain areas based on certain criteria and if its been met
    - im assuming its somewhere in the blue prints.
    i have been watching and listening to the ability system videos darn near repeat and its confusing cause it feels like the word “ability” gets used sooo much.
    to use ability you must ability> ability> ability then ability will ability :confused::mad::rolleyes:
    i just need to watch em closely and do it in short intervals so i dont get ability sickness (its working)
  6. lastly, there are no published games for whats going on in my head. I wouldnt mind chit chatting about it, just not on forums. i have already had 2 ideas stolen from me. im not mad they made a bunch of money off them but, im sad cause they didnt take care of the ideas.

Sorry, I’m struggling a bit to reproduce this. Would it be possible for you to record a video showing everything from when you set up the grid and place the units until you get to the error?

Thanks, and I’m glad that it worked :slight_smile: Best of luck on your game, and let me know if you run into any other problems.

Thanks :slight_smile:

It remains an open question whether my toolkit is the best option for making this type of game, and it is a bit difficult for me to assess, since I have a hard time understanding how the game works. But I guess you can figure it out through my replies.

There are no built-in data tables for movement, but you can use UE4 data tables to store any sort of data, which can be accessed at runtime. I recommend looking into tutorials on data driven design with UE4.

I guess you could have an array of grid indexes or locations in a data table for this and iterate over these tiles when choosing a move target each turn.

There are functions for converting a world location to a grid index. You can use this index to get the location at the center of the closest tile, which you can print.

Could be something you could set up with a combination of the data table approach mentioned above and some if statements, but not sure.

Yep, a lot of this toolkit revolves around abilities, as they are used as modular building blocks that handle most player interaction, combat rules and AI, so I use that word a lot.

Feel free to PM me on Discord. If this is your first UE4 project, though, I think I would recommend that you first start with something simpler, and learn your way around the engine, blueprints, data driven design etc. You can of course jump in the deep end, but modifying a fairly complex framework such as mine to do something it wasn’t really designed for is a pretty big task, that would require decent experience in both UE4 generally and my toolkit specifically. Just based on how you describe how much experience you have. I don’t want to give you any illusions that modifying my toolkit in this way is going to be a simple task. It sounds doable, but it is certainly not something I’d choose as my first project. Just my two cents :slight_smile:

Yes ofc: https://youtu.be/FN7Lg6-dRJg

There is an additional thing/bug shown here, where the ai units swap back to a previous location before moving.

For the AI units getting active to early the print string on the upper left site shows, that they got activated to early. I have updated my post on the previous site with some more information.

Phew, ok this one was a challenge. Thanks for the detailed description. As expected the issue lies with the WaitForOngoingActions macro, which turns out to not be a fool proof way to check that all actions of the active unit have in fact finished. The reason is that calls to activate the next unit might happen earlier in the same tick at which actions are queued. It is possible to keep it as is and design around it, being very careful about where in the execution chain one puts calls to end the turn, but this is needless to say impractical. Thus I’ve cooked up a much more reliable approach. I’ll be cleaning it up in the next update, but for now this should work:

In BP_TurnManager add a new action to the AnimateAction name switch. I’ve chosen “SignalActionsDone”. This action does nothing but check that it has authority and call a custom function:

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

Set up this implementation in place of WaitForOngoingActions in whatever TurnManager you are using:

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

This should fix the issue of skipping to the next unit. I have not been able to replicate your issue of the unit teleporting back to start and moving several times, though. Are you using the latest version of the toolkit?

Hi, i’m enjoying your toolkit. But i’m a noob in UE i will like to know how to change the movement so is like the in the 2d version (turning in 90° only)

Big thanks, I will try it out :slight_smile:

Btw.: Do you mean replacing every call to “wait for ongoing actions” with this solution? Or just at this particular point?

To the second one: Have you set up “Move_Attack” and “Heal” to not end the units turns? Or the other way around - are your (and AI) units able to use more than one ability in one turn (including movement?) Yes latest version.

But maybe those problems were tight together, so that it is fixed by your first solution , I will report back after further testing, thank again :slight_smile:

Do you mean preventing units from moving diagonally? Uncheck bAllowDiagonalMovement in BP_GridManager.

I believe there is only one of these in each Turn Manager. You just need to replace it in whatever turn manager you are using.

I tried to follow your exact specifications, down to the specific tile location of units and unit activation order. I might have missed something, of course. Let me know if the issue persists.

Yes that was what i was asking for, Thanks. I have a new Q. Is any way that i can make it too be free mode with grid (just like the Hybrid map but snapping to it)

You can activate the FreeRoam ability. Here is a simple debug setup where you can press X to activate FreeRoam for the current active unit:

https://i.imgur.com/88pPhfw.png

[SPOILER]


[/SPOILER]

just like the target to Ai controlled check i want to make a target to faction check and a target to actor name check. how do i pull that info?

edited:
these are some of my attempts to get the ai to let me know if the ai is part of the goblin faction
[SPOILER]


[/SPOILER]

this is another attempt i tried
[SPOILER]


below is the function it calls
[SPOILER]

[/SPOILER]
[/SPOILER]

none of my attempts have been successful so far. any ideas?

Your solutions seem sensible. Not sure why they are not working. I tried something similar and it is working fine (in the Example map):

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

In your last screenshot the execution pin is of course not connected, but I’m assuming you’re aware?

For getting and comparing names, this should do the trick:

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

If you’re talking about a name stored as a variable, of course. If you want the unique identifying name in engine you can use GetDisplayName instead.

Maybe you’re using an ability that overrides some of this stuff, and this is why you’re not seeing anything? Test it out with the Example map which uses BP_Ability_MoveAttack first, to see if you get it working.

thank you! it helped me figure out the issue. apparently my string for goblins was not holding the value i was giving it. i got it work the way i want now. its a bit messy. buuuuut it lets me know i can move on to the next step