[SUPPORT] Advanced Turn Based Tile Toolkit

I’m having the same problem. Every time I convert the project to 4.8 it keeps trying to move to the #1 Index tile. Seems to break the AI as well. If I had to guess, I think the character’s think they are possessed at Index 1.

Edit #1 - Yep, looks like the game thinks they are always at Index #1. Know why that would be?

Hmm, not good. And you’ve followed my conversion instructions in the original post?

Ahh, I imagine that would be the problem. I’ll be able to follow your steps in a few hours.

And I wanted to thank you for the outstanding toolkit . It is saving our studio a tremendous amount of time!

Edit #1 - Looks like your changes did the trick. Although, some of the nodes are still becoming disconnected, such as the Set Target Marker. Maybe it’s a glitch within 4.8? I’ll probably wait for 4.8.1

Thanks, glad you’re enjoying it!

Good to hear the changes are working. The disconnects seem to be a bug with 4.8. I reported this to Epic a few days ago, but they were apparently not able to fix it before the update. If you want to have it working now, a workaround is to drag out a vector and select “make new vector” instead of splitting it on the node itself. I’ve just sent a new patch to epic which makes the toolkit compatible with 4.8. It uses the mentioned workaround among others. It will hopefully be up in a few days time.

Oh my god, thank you! It worked.

I have not thought about that, but it would make sense to have such a switch. There are a few ways to do this, depending on what you’re after. One way would be to have a gate right at the beggining of the ChooseNextPawn custom event in ATBTT_GameMode. If you want to disable the toolkit you would close that gate and call the End Turn custom event on the current pawn. When you are ready to start the toolkit again you would open the gate and run ChooseNextPawn. You would also have to add a similar gate after the event tick in ATBTT_PlayerController.

Hey, you don’t owe me anything, but thanks anyway :slight_smile: At the start of each unit’s turn both Pathfinding and Find Tiles in Range are called (as you can see in the Begin Unit Turn part of ATBTT_PlayerController). Both are called at once, but if current move is higher than 0, then Find Tiles in Range is set to only detect enemy pawns. That means that with the current setup all tiles in range are displayed in red only if current move is 0. The code for displaying the red “Attack” squares are all in the Find Tiles in Range function in BP_GridManager. Call it from anywhere with index set to the center and range set to the radius, and select “display tiles” if that’s what you’re after.

I hope the toolkit will make more and more sense as you work with it, but hell is other people’s code, as they say :stuck_out_tongue: I’ve tried to make it as intuitive as I can, but it’s sometimes hard to see what is less obvious in something you have expert knowledge of something. With your background in writing blueprint tutorials I’d be interested to know of what parts of the toolkit you find particularly confusing or poorly commented, and I’ll try to remedy that.

Glad the solution was simple, and I can see why it’s an easy mistake to make. I’ll try to improve the commenting on variables in the future, to make this clearer.

Yeah, I think I misunderstood your question the first time, so I gave the answer to something else. So all you want to achieve is not to show the red squares if there are no enemies in range? One way to do this would be to do a find tiles in range function with “find only pawns” set to true. Then if the length of the pawns in sight array is 0, just clear all Tiles In Sight Range MC instances. If the length is 1 or more, run Find Visible Pawns Step 2 with Find Only Pawns set to false. That should do the trick. By the way, you’d want to do this in the Begin Turn part of ATBTT_PlayerController instead of the regular Find Tiles In Range.

That sucks… Again, I haven’t experienced anything like that myself yet. If anyone else reading this thread are having similar bugs, please let me know. This happens with the vanilla 4.8 converted toolkit?

If it occurs again, maybe you could quickly check all the parts you’ve edited when you converted it to 4.8? Maybe I described something poorly and you haven’t set it up exactly right? In that case it will be resolved when they upload the newest version. It’s pretty weird that you can control the enemy pawns. Something must be wrong in ATBTT_GameMode in that case, which should activate either the player or AI controller depending on the faction variable of the current pawn. What do you exactly mean when you say that all values reset to defaults, by the way?

Are you changing the values in Unit_Parent, the different unit blueprints (Unit_Player_Melee etc.) or in the individual units? Either way I’m not able to replicate this bug. Does it happen at once or when you close/re-open the editor?

Here is a pastebin of my solution: http://blueprintue.com/view/tfYSQvQa/. I modified it a bit more so that the current units turn will end automatically if there are no enemies in range after it has moved. Just replace the “Begin Unit Turn” stuff in ATBTT_PlayerController with the stuff in the pastebin.

Hmm, there are certainly a few ways to do this. You would have to prevent pathfinding etc. from firing immediately when a unit is activated. Have a closed gate right after the activate unit custom event in ATBTT_PlayerController for instance. Then flip some other bool which opens a gate that opens input to your buffing code. When your buffing code is done, open the gate at activate unit again and run the pathfinding/find tiles code as normal. Is anything preventing you from doing it like this?

Ok, then there is probably not much I can do. No other users have reported anything like that, as I’ve mentioned, but it does seem like a strage bug to only affect one user. Again if anyone is reading this and is experiencing similar bugs (or any bugs really), please let me know.

Error after playing in editor

Whenever I close PIE, it get this error message (attachment). The floor is a BSP. Any idea what this means/how to fix it? Thanks all.

Hi guys,

Is somebody trying to implement a cloud networking/game management system like GameSparks into 's toolkit?

Ah, I had forgot about that error message. That’s something that happens if you use automatic heightmap generation from tracing. Traces hit the center of all tile locations across the entire grid and add their heights to the Vector Field Array. At the same time, rotations of any actors that are hit are added to the Rotation Array. If the traces hit something other than an actor (such as terrain), Hit Actor will return false and this error message will appear. You can safely ignore the error as it does not affect the game, but I will change the toolkit so that the error no longer appears in the future. If you want to remove the error yourself, here is what to add to the Add Viewport Terrain to Arrays function in BP_GridManager (it’s in the top left part of the function’s event graph):

Well I certainly haven’t tried to yet, but I’d also be interested in hearing the results of any such attempt. Are you going to try it out, Wisdom?

Yes, I’m actually trying to integrate GameSparks into Unreal Engine 4 and, less generally, on your toolkit.
Basically I’m working on GameMode and PlayerController, I’ve added a new Actor naming it Faction_Parent and I’ve also added 3 children of this actor: LocalPlayer,CPU,NetworkPlayer (actually the game implement only 1vs1 battles).

By adding also a new value (Network) in the faction enum, I’m starting to make the PUSH/PULL messages events for propagate every toolkit action on all network clients.
Pull event will be a new “Activate Network Unit”, where grid manager just listen from network until they push “End Turn”, finish their troops movement or their turn countdown time expire.
Push is more difficult, because I have to push through network every action of the flow, from showing highlited Tiles to movement, from attack to use skills.

I will keep you in touch.

Great! Sounds like you’ve made a lot of headway already. Feel free to ask if you have any questions regarding the toolkit, though I won’t be much help when it comes to the specifics of multiplayer integration.

I want to change the way attacking works so it does not immediately end a pawn’s turn. That way a pawn could attack and still take other actions afterwards.

The code that ends a unit’s turn is in the event graph of Unit_parent. In the 4.8 version that Epic haven’t uploaded yet this triggers at the end of the “Attack Victim” part of the graph. In the 4.7 version, however, this triggers roughly at the middle of the “recieve damage” part of the graph. If you want to prevent the turn from ending after a unit has dealt/taken damage you have to remove the “choose next pawn” node and connect it to whatever code you want to end a unit’s turn. If you still want the AI’s turn to end after it has attacked you’d still want to keep it there with a branch, though. Here is an example:

Thanks so much for the clarification!

, I remember when you first released it you were having trouble with networking and had not yet implemented the map to work with height (in so far as having two units sharing the same grid space on two different height levels).

Did you ever resolve those?

Hi ,

networking remains something I know very little of, and is not something I’ve tried to implement yet. After release there have been many other things that have been higher priority, though when I made the toolkit more modular that was partially to make multiplayer intgration easier. There are a couple of users who are working on implementing multiplayer in their own ATBTT projects as we speak, who have more experience with that sort of thing than me. If they manage to get it to work I will ask them how they achieved this and try to replicate their efforts. If not I will try to make it from scratch when I’m done with adding the features that lie closer to my areas of expertise. Even though I have improved the heightmap functionality it is still not possible to have troops above and below one another at the same XY position. This is still on my to-do list, but it’s one of the trickier features to implement. At the moment I’m working on improving the AI among other things. You can see the first post in this thread for my list of planned features.