[SUPPORT] Advanced Turn Based Tile Toolkit

Good that it worked :slight_smile: Those functions are absolutely necessary I’ll think. The new way of handling edges is efficient and flexible, but modifying them at runtime is less straightforward, hence the functions. Some of the difficulty stems from an inherent issue with UE4 that prevents modifying the values of nested structs which I had to find a workaround for.

In other news I have been attempting to implement large multi-tile units and it is proving to be a lot more difficult than I expected. For basic grids that have tiles that are either walkable or not (no thin walls), no difficult terrain and no multi-level grids adding large units is still a challenge, but one that can be overcome with relative ease. With all these factors to take into account as well as hexagonal grids it is extremely difficult to find an efficient and general solution.

Because of this I think I will not add large units as a feature of the base toolkit. Instead I intend to include it in a game example where I can provide a less general implementation.

Hey - has there been any news on the 1.5 Update from epic?

Hi HeadClot. Read post #774 above for an explanation for the delay. The update will be uploaded when UE4.11 is live. The 4.10 version will remain as ATBTT v.1.4. If you need the update before then, send me an email (knuteiliv@gmail.com) and I will send you the update after verifying your purchase with Epic.

Ah ok,

Thanks for the heads up. :slight_smile:

  • HeadClot

Hey I recently bought your toolkit, money well spent. And I can see the great support your giving on this thread and through videos. Btw, do you have a donation link somewhere?

Now for the question. :slight_smile:

I’m needing “synchronous resolution turns” like nateight in a previous post. But before I hit that brick wall I wanted to see if you have a suggestion for the player to select their path similar to “Can split up move”, but they select all the points before they move. So the player could map out a u-turn if they wanted to avoid a square.

Hi Redsett, glad to have you on board :slight_smile: I don’t have a donation link, no. People have paid for the toolkit, and should not feel any obligation to give me more than what I have priced it at.

If you have read through the thread you are aware that I regard synchronous resolution to be pretty tough to implement, so do not attempt to tackle this until you are comfortable with the toolkit. Setting up waypoints so that you can split up move before moving the actual unit is a significantly easier challenge, but will still take quite a bit of work.

The way generation of a path currently works is to look at the target tile, find the parent of this tile in CanMoveToArray, find the parent of this tile and so on until you reach the start tile. While searching through the array from parent to parent each tile index is added to the Path Array (possible Path Index Array. I cannot check at the moment). Then a Path Spline is generated by finding the vectors corresponding to these indexes in the Vector Field Array. For splitting up movement you would want to run something similar to what is run in ATBTT_PlayerController when clicking an empty tile that can be moved to, but instead of initializing movement on the Current Unit you would append the Path Array to another array (say Long Path Array or Split Path Array) and then run pathfinding from the endpoint of your first path with move set to the move of the current unit minus the move cost to the first waypoint. This could then be repeated a number of times depending on input from the player. The spline path would be generated based on the Long Path Array instead of the Path Array in this case, and the unit would move along it as normal.

I hope this is enough to get you started. Testing this out myself would take quite a bit of time, and I’m rather busy fully implementing features for version 1.6 at the moment.

Thanks for the overview . I’ll give it a go and post my results!

I LOVE THIS PLUGIN.

shut up and take my money @@!

After a couple days of tinkering in my off time I’ve made a little progress but not sure if I’m headed in the right direction and would appreciate some advice when you get the time .

At the moment I’m just trying to get multiple clicks into one spline.
Right now I’m just adjusting the “Start Index” when calling the “Pathfinding” function in the controller. After clicking, the start index will be where I clicked then I’ll call the pathfinding function again to refresh the “CanMoveToArray”. This seems to be ok at this point. Then in the grid manager bp and within the function “Find path within pathfinding array”; I added an array “SavedPathIndexArray” to append the path when I click.

I get something that resembles what I’m looking for but it’s still a bit broken.

**@Retrotation: **Hehe, I’m happy to hear that :slight_smile: If you have bought it I have already taken your money, so I guess I should shut up.

**@Redsett: **Looks promising! Your method seems like a good starting point. Is the only way it is “broken” simply cosmetic, with the extra arrows that appear when displaying the path or are you having other problems as well. It seems like the unwanted arrows are pointing to the starting point of the previous path.

The double arrows are breaking it I believe. And somehow the beginning of the spline connects to the end as well.

Ok, I gave it a whirl. It turned out to be a lot more work than I anticipated, but I’ve figured it out. It still requires some more work, but the basics are mostly working.

For input I made a couple of additions to ATBTT_PlayerController so that you can place waypoints by holding left control:

eWVEazn.png

Then add all of this near the end of “Initiate movement towards and/or attacking target”, right after Find Path Within Pathfinding Array:

You are going to need my custom reverse for each loop for this, so here is the macro library.

Then make these additions to the Find Path Within Pathfinding Array function in BP_Grid_Manager:

That should be enough to get it mostly working. Hope that helps!

Thanks a million .

I did exactly as you have, then changed the index in “Create Spline Path” function to the current pawn index. Works great.(at least doesn’t seem to break anything)


Ah yes, I added that myself, but forgot to include it in my post. Good thing you figured it out!

Hi there I recently purchased the ATBTT for a university project and it’s been really helpful.
I just had a quick question after going through the blueprints, how would I go about removing the AI? and having it so two human players can alternate goes locally?
thanks in advance for your help.

so its probably sloppy but it works… I’m having a matinee play before each level starts but don’t want the game functions to mess with anything. So I created a new bp I put in each lvl that lets me set the delay that is sent to the game mode. I just set it to however long the matinee is and poof.

anyone have thoughts to simplify it?

7e462fbf03159d98ac4b033f7845b3956500b0e9.jpeg

@markps: Hi there! In the update I’m currently working on it will be possible to add any number of factions and set them up as either allies or enemies. It will also be possible to specify whether a unit is player or AI controlled on an individual basis, making things like summoned units or mind control easy to implement. This is probably overkill for what you need, though, and having two player controlled warring factions (and no AI factions) is easy to add in the version currently on the marketplace. The general idea of how to implement this is to remove any branch of switch that checks if the current unit is AI controlled (since this should never happen) and to change any switch that checks the faction of a target unit so that it compares the faction to the faction of the current unit instead of naïvely assuming that the current unit is of the Player faction. Here are the specific modifications to make:

  1. In ATBTT_GameMode simply skip the “Find Faction of Pawn” part of the event graph and set the default value of Player Turn to true:

  2. Similarly skip the branch that checks whether Player Turn is true at the end of the event graph:

  3. In ATBTT_PlayerController change both switches that check the faction of the target so that it is compared to the faction of the current unit:

  1. In Unit_Parent at the end of the event graph, skip the switch that checks the faction of the unit:

That should hopefully do the trick. It seems to work well based on my limited testing.

@Jopel: They say that if it is sloppy but works, it still works. I personally have a hard time living by that creed, though, as I often spend hours obsessing over making something as elegant, flexible and efficient as possible, while the same time could probably be spent developing new, cool features :stuck_out_tongue: I don’t think you are far off the mark with your solution in any case. The only problem I can see is that it’s a bit awkward to manually specify the duration of your matinée every time you change it. I have not worked with matinée at all, actually, but I assume it should be possible to have the matinée automatically run an event when it is finished instead of using a delay. I do not know for sure, but I would be surprised if this was not the case.

yeah… I’m sure my programmers at work would cringe but for a vertical slice build it might be a hackathon and then do cleanup and polish once I can get a programmer on it full-time. So yes… the matinee plays fine but the issue is the controls take over and if someone starts clicking or you place the matinee camera where the first pawn is at the game is technically active. I wanted to delay the start of the game without using a seperate level for cinematics so the timer thing was the easiest thing I could come up with. I’m totally sure there is a better way to do it. I may even change it to using something like a UMG widget or whatnot since what I"m going for is like a advance wars/final fantasy tactics text /w avatar cutscenes.

Again, as long as it works and you do not foresee any major issues you will run into because of your solution I do not see anything wrong with it. I am in a bit of a different situation myself, since everything I make will be scrutinized by users of the toolkit and put to use in ways I cannot predict. Because of this I have gotten into the habit of trying to find the optimal solution for anything I add. This has some benefits, of course, but it is also very time consuming. I frequently hack together stuff quickly when I’m prototyping, however, and that is frequently the most fun part of development :slight_smile:

Hi thanks for your speedy reply!
This works well, the only issue I’m having is that when the Enemy melee unit attacks it’s teleported to what I can assume is the 1,1 tile. Ranged units work fine as do both the player pawns, any idea what could be causing this?