[SUPPORT] Advanced Turn Based Tile Toolkit

Ty for your response. Hope to see your new ability system) I’m new to this and for me its hard to track what action is running right now (especially with ue debug coz for some reasons it hates interfaces and most of the time refuses to proceed to the interface’s function execution and just skips it (it was a nightmare to fix my bug in Select actor event).

I hear you. The current implementation of the action system is indeed tricky to debug, and easy to lose track of. I am making many changes in the coming update, but making the action system simpler to work with has been my number one priority.

-From Google Translator-

Hello, I want to debug in “Bp_ActionManage", and I want to get the name of the “current action” to understand the currently executing action, but I found that just adding “totext” will cause a crash, even if you delete it and run it, it will crash.

And, using “getActionName” is the same

What could be the reason for this?
Or is there any way to track the sequence of actions?

Sorry I didn’t notice that many people have mentioned the issue of tracking actions. I don’t know what keywords to search for to get the answer

Thank you very much

Engine version: 4.25 ATTBT version: 2.61

20200924164941.png

Hi, thanks for the bug report. I have previously done what you describe without having any issues. However, when I test it now I get the same crash that you are seeing, In fact, any change made to BP_ActionManager seems to cause the engine to crash when you run the project. The same thing happens when I open older versions of ATBTT in 4.25, but not in 4.24. This thus seems to be a bug in Unreal Engine and not ATBTT. I have sent a bug report to Epic and I will experiment to see if I can find a workaround. I’m sorry for the inconvenience, but there is not much else I can do at the moment.

Edit: Ok, I’ve found a hack that seems to work, but it is pretty weird. Every time you make a change to BP_ActionManager, rename the Actions array to something new, then compile. I do not know why, but this seems to work. You can try doing this until I find a proper fix or Epic fixes this bug in the engine.

Thank you for your enthusiastic reply. I just learned to use blueprints. I have benefited a lot from reading your work. It looks very elegant

Is there a problem with the old version of ATTBT? I bought it recently, I thought it was a new version

Will the new version of ATTBT also have this problem in 4.25? How can I get the new version of ATTBT

if the updated version is released, can the content of the new version be added? I saw the update of the action system mentioned above, I think it is very useful

No, this is a problem with the newest version of ATBTT. More specifically it seems to be a problem with Unreal Engine 4.25, since the same problem happens if I open older versions of ATBTT (which I know did not have this problem) in UE4.25. As you have read I am working on an update that improves the action system. It is not available yet, but I will release it along with the first full version of UE4.26 UE4.26 preview 1 got released yesterday and it usually takes 1-2 months between the first preview release and the first full version release. Converting an ATBTT project to the new version will require quite a lot of manual work, as I have made many substantial changes to the toolkit.

Hello again!

I’ve been making some great progress, but ran into another issue tonight. I made an ability in which the owning unit kills itself. This seems to mess up the turn manager - once the ability finishes, the game hangs on the current player’s turn. Even clicking the manual End Turn does nothing.

Per your suggestion, I am using BP_TurnManager_Strategy. Here are the relevant BPs:

Turn Manager Strategy

Kamikaze Ability

I stepped through the Turn Manager in debug and it seems to process everything through EndActiveFactionTurn and EventBeginActiveFactionTurn correctly.

Thanks in advance!

Hi, I tested it out with some slightly simpler code and it seems to work fine? This ability is a duplicate of BP_Ability_MoveAttack with an overridden ExecuteAbility function:

https://i.imgur.com/S8Z6X1Z.png
Here is the result:

https://thumbs.gfycat.com/HardtofindJampackedGalapagosdove-size_restricted.gif

Perhaps you’re going for something different?

Nope, that is exactly what I’m going for! I reverted my changes and tried again, and this time it worked…there must have been a missing node connection somewhere :confused:

Thanks for looking into it! I’m also starting to make some Status Effects, can you give me a quick explanation of how that system works (or point me to a tutorial somewhere?).

Cheers!

Great! As for status effects I haven’t made a tutorial yet, but here is the rundown:

Status effects are actors. They have an event called Activate that takes a unit as input. When it is called the status effect is added to a status effect array in the ability system component of the unit (it fails if the unit has no ability system component. If you’re adding a status effect through an ability you can use the AddStatusEffect function in BP_Ability. If you want something to happen when the status effect is activated you will extend the Activate function in the child blueprint (remember to call the parent event first. Check out the mind controll status effect for an example).

After this status effect has two main events you want to care about, which is the RunOnTurnStart and RunOnTurnEnd events. These are called as part of the RunOnActorBeginTurn/EndTurn events in BP_Unit, which are again called form the turn manager. Different turn managers call these at different times. BP_TurnManager and BP_TurnManager_Strategy call these for all units when a faction starts/ends its turn, while BP_Turn_Manager_Initiative call them when each individual unit is activated/deactivated.

Awesome, this worked like a charm! I was able to make Stun and Poison effects pretty easily, complete with FX.

Next up is Traps. I’ve had some different ideas about how to implement them - as specialized Units, as Status Effects, or as an entirely new BP class. Do you have any thoughts on this? It seems like a new BP class is the way to go, with OnTriggered events being called from the Grid Manager when a unit enters the Trap’s grid index or when a turn countdown expires, and giving the Grid Manager a new Grid Array (GridTraps).

There is an example map with traps included in ATBTT. Check out Maps/Experimental/InterruptedMovement. They are a separate actor (based off BP_GridObject). They are a bit hacky in their current form, but I am working on improving them in the next update.

Hi,

First of all, thanks so much for your recommendation a few months ago to try Steam Remote Play for my game. It was the perfect recommendation for what I needed and I got a beta on the Steam store :slight_smile:

I’m thinking of taking on a C++ project to build an AI for the game. I know there is functionality within ATBTT for AI but I want to learn C++ and need to build something more complex. Couple questions:

  1. Is my assumption correct that I would be able to build a more powerful AI in C++? (obviously will also require much more work)

  2. AFAIK, for the program to be able to capture the game state, my whole project (maybe just part of my project?) would need to be represented in C++, so do you know if there is a reliable way to convert from blueprints? Or any other ideas you have here could be helpful.

  3. Alternatively, if I didn’t need to convert my whole project to C++, from what I understand, I can add C++ elements to the blueprint project, and I just wanted to make sure that was also correct.

Thanks, and hope you’re well

Happy to hear that! Feel free to post a link :slight_smile:

Yes and no. The great benefit of C++ is of course speed. For a lot of stuff that much speed is unneeded and blueprints work just fine, but AI is one of those things that can get really resource heavy depending on what you want to do. So if you are designing the kind of AI that will be doing a very large number of calculations in a very short time C++ will let you do more.

If all you want C++ for is your AI, then all you need to expose to C++ is whatever your AI will be using. You likely want access to the grid arrays such as GridLocations, GridEdges etc. as well as pathfinding, LoS etc. But you probably don’t need access to how you are animating your units, for instance.

Your C++ code will not be able to access variables you have declared in blueprints (without a lot of awkward workarounds), so you would want to create C++ versions of the classes you want to access in C++ and reparent their respective blueprint classes to these new classes. Then you would define any variables you need to access in the C++ version of the class and replace any references to the old blueprint variables with the new C++ variables.

I have already converted many of the resource heavy blueprints such as these to C++. I can share them with you if you are interested. Be aware that implementing it will take some work, though.

  1. Alternatively, if I didn’t need to convert my whole project to C++, from what I understand, I can add C++ elements to the blueprint project, and I just wanted to make sure that was also correct.

Thanks, and hope you’re well
[/QUOTE]

Indeed you can. It is absolutely possible to combine C++ and blueprints in a UE4 project. Epic does this for all their internal projects and blueprints were designed with this in mind.

Hey, so im posting in here in response to my recent comment on the ue4 marketplace about the hybrid units with the attachment issues. To describe why this would be necessary for the my game-the game functions in exploration with a third person camera but for a party of 4 user controlled players. I am setting it up so that you can switch between the four to which you are controlling and which 3 are set to follow (think similar to wasteland except the non combat camera is closer in).

Another question I have- i am setting it up so that movement and attacks are using the same action points resource. The idea here is that if an attack costs 2 ap and you have 4 ap then you can attack twice with that one unit in the same turn. However I’m having trouble finding where exactly it calls the units turn to end on an attack. Ie by solving this i am in hopes that I can have it so that you could potentially with enough ap have a turn with one unit that goes- Attack, Move, Attack.

Lastly as a suggestion (idk if you take them but i think it would be really great for this kit) - the only thing that feels like a disconnect between this kit and many games that emulate it are that you can’t tell when a movement will put you in range of an attack. I suggest something similar to wasteland 3 where a line draw is made between a tile that is hovered over and a unit that is in range of an attack. I will try to come up with something for that as follows (and correct me if there’s a better way with this kit’s setup): in the hover over tile function during movement- get the current units array of abilities. Check this array of abilities for each ones range. Take the highest value and draw a line from the tile hovered over to all units within that range. (might have to separate out abilities cast to enemies and allies and draw out green and red lines respectively)

Hi Toad, this should do the trick:

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

All the default abilities call the SignalAbilityExecuted event after they have been used. This in turn calls RunAfterAbilityExecute in the TurnManager, which by default ends the current unit’s turn if it has 0 AP remaining. Abilities have a bool called bUseEndsTurn which causes AP to be set to 0 no matter how many remain if PayAPCost is called. You would naturally want to set this to false for your ability. Also setting MoveCostType in the ability to FromPathfindingCost will cause the AP cost when moving to be determined by the cost of moving to a tile (this can be overridden in abilities). Hope that is enough to get you started.

Thanks for the suggestion. I actually had that feature in some earlier versions, where a crosshair showed up next to the health bar of enemies that could be attacked from a tile. It got removed during a refactoring, but it is something I’ll put on the list of things to add back in the future.

Hello, .

It was me, who wrote you a comment under the “ATBTT Turn Manager” video a couple of days ago about differences in “BP_TurnManager”. So, let me get to the point.
First question sounds like this (other question will be later, if I shall not be able to find any solutions): I need to restrict (block) unit’s moving in certain direction, i.e. I need units cannot move back at all. And always. So, in which direction do I need to dig in the ATBTT asset’s blueprints to solve my problem (tried to search via forum’s topic without any results).

I’ve tried to solve this problem with a primitive solution:

  1. In the “BP_Unit”, I added a “Cube” mesh as a child of the “SceneComponent”;
  2. Set its “Collision presets” to “NoCollision”;
  3. I opened the “BP_TurnManager” and added two blocks of code in the “Run On Actor Selected” and “Run On Actor Deselected” sections.

Result: I have the messages (though the “Print string” node) about working collisions, but nothing happens in real time: collisions not changing. Other words, it doesn’t help me (is it a bug, or is it just me - I can’t figure it out even now). But, the case is I’m convinced I can reach my goal with inserting changes somewhere in blueprints, and without such type of the “hack perversions”. There must be more elegant solution, I guess.

Would you be so kind to help me? And if you can, please, give me detailed explanation. Thank you.

PS: I can make some pics with my code, if you need it. Or send you my changed BP’s.

Hey kup, I’d love to help, but it would be useful to get some more info first. For questions like these it is most helpful for me to get a somewhat detailed description of the desired end result. That way I might see potential solutions to your problem that are different than the ones you have come up with and are struggling to implement. How does the game work? Particularly what you mean by blocking movement in a certain direction. Is this something like a Monopoly board where units can only move in one direction around the board? Is it something like tiles crumbling and becoming impassable after moving over them?

Yes, exactly.

Ok, this is something I would solve by manipulating the GridEdges map variable in the Grid Manager. GridEdges holds arrays of which tiles can be reached from each tile on the grid. All you would need to do is to remove all edges that point back towards the start. There might be a simpler way to do this, but here is the first thing that came to mind.

Add an invisible wall between the start tile and the end tile. Then call RunPathfinding starting on the start tile and with a Move argument equal to or greater than the full distance in tiles between the start and the end tile. Keep the Paths output for the next step.

Next loop over GridEdges and do a nested loop over each of the nested arrays within the values of GridEdges. For each edge check Paths and find the cost. If the cost of the tile the edge connects to is lower than the cost of the source tile (meaning that it is closer to start), remove the edge (use the RemoveEdgeBetweenTiles function). Lastly when all is done add a new edge between the end tile and the start tile and you have your Monopoly board.

That was my first thought. See if you can figure it out, and if not I can give it a try tonight.