[SUPPORT] Advanced Turn Based Tile Toolkit

It was quite challenging hardest part was getting the replication working.

Great progress! Weā€™re there any specific tutorials or material you followed to get going in the right direction? This is exactly what I was going to work on next for my own project.

Does the fog of war affect pathfinding at all? For example if an enemy is around a corner doesnā€™t the array of valid moves still reveal that there is a unit in the way by not allowing you to move through that hex?

Great to see you showing off your multiplayer implementation in the forum thread, westcut! Looks almost perfect, with just a few things showing up a bit differently on the two clients. The most obvious one is the current pawn marker. I guess its per tick movement is not replicated? You can find the code that moves this marker in the bottom left of the event graph of ATBTT_PlayerController, right after the event tick.

In the 2D game example that comes with the 1.5 update there is fog of war that affects pathfinding. In that example I have an array that keeps track of whether or not a tile has been discovered. If it has not then it cannot be moved to. This works well in combination with letting units do partial moves, so that they can move a bit to reveal new tiles, then move again to the revealed tiles in the same turn. I think this is ideal with the sort of pathfinding I use in my example, where the fog of war is completely black.

In Lodemanā€™s version it is probably better to do something like in Civ V, where you can generate and show a path to any walkable tile within the fog of war and then stop unit movement the moment something blocking the path is discovered. There are a few ways to do this, but it is a bit more complicated. It would be something like checking the pawns in sight array against the Path Index Array every time new tiles are revealed and stopping movement/rerunning pathfinding if the same index is found in both arrays.

Yeah Iā€™ll most likely be doing something like that for my pathfinding. My FoW currently doesnā€™t affect AI behaviour yet, but it will in timeā€¦Iā€™ve only just got this toolkit last weekend :slight_smile:

, I watch the video with the height test. Very impressive. I did notice that he did not seem to have a jump down option from heights under a certain distance. That would be one feature that would be a must have other than that it looked great. I have not had a chance to look much into what we talked about in PM. I will try and get some time this weekend.

@Lodaman: Almost forgot how little time youā€™ve had with the toolkit considering what youā€™ve accomplished so far. Good luck going forward!

@Anzak: Thanks! Many of the changes Iā€™ve made to the toolkit lately have partly been to make it easier to add efficient multi-level grids. Adding the possibility to jump down can certainly be done with the new edge array. Any tile can be connected to any tile, meaning that you can add edges that can be traversed one way but not the other (which is what I think you want to add). The trickiest part for me would be to create animations for jumping down when moving between these particular tiles, animation not being my strong suit, but to as far as gameplay is concerned it is pretty straightforward to add.


Not sure if its me having a strange moment or im having an issue that has very likely come up before.
Spawning a child of tile parent in-game with edge costs of 0 because I dont want it to be walked on, when it spawns units can still move onto it
In game debug confirms the edge costs are 0 so I think the units can walk there because it doesnā€™t recognize the new tile, how do I add it to the grid?

I need to know a bit more before I can help you. What version are you using? Could you show me the nodes you are using to spawn the tile?

Using the newest version out in the past few weeks unless it automatically updates

Ok, so you are simply spawning the actor, but not modifying the Edge Array? If the edge array is not modified spawning a tile does nothing. If you are using one of the older versions of the toolkit where the edge array is not a nested array this is as simple as setting the value of Edge Array at the appropriate index to 0,0,0,0,0,0,0,0. For the newest version (which Epic told me they would upload this week) with nested arrays this is quite a bit more complicated, as edges are only one-directional, meaning you need to modify the edges of all tiles that are connected to the spawned tile index. Because this is more tricky I have created a Spawn Tile function that does this for you, which is located in the Utility section of the functions of BP_Grid_Manager (only in version 1.5)

Thanks I got it working and il keep an eye out for the update!
Going to play it safe and make a copy of my project to integrate with your new update so if it does break badly I can revert

Looking fantastic! I canā€™t wait for you to roll out this update, as Iā€™d much rather you do this painstaking work than I. :stuck_out_tongue: Seriously, though, this is exactly what I need for the urban combat scenario Iā€™m working on (heavily inspired by XCOM gameplay, to be honest). Gives me more time to work on meshes, skeletons, animations, and UI, which are going to be a bear and a half to begin with.

Hey Nateight, Iā€™m also trying to do 4&5. Did you manage to find any solutions that you could share?

@BlackWolfe: Good to hear more people are looking to make use of heightmaps :slight_smile: It will still be a while before this feature is released, but Iā€™m steadily working on it.

@Bradform_hinkle: I cannot see anyone named Nateight who has posted in this thread. Did you post in the wrong thread?

Howdy!
Iā€™m using your 15_WIP2 build and at the stage that I want to get the AI to use the cover system, the new AI controller and pathfinding functions are overwhelming! Wondering if you can give me some insight in where to interject my checks.
Iā€™d like to get the AI to select a target, then find tiles in LOS from the target, with appropriate cover. The AI can currently get the direction that the target is in (0-7). Looks like the Find Path to Tiles in Range might be the place to add the cover checks, just not sure whereā€™d be best! Many thanks, Aidan.

@Bankworthy: Yeah, the new AI is pretty complex compared to the old stuff. I plan to make a tutorial video about it soon. There is already a function that finds all tiles in range of the selected target called Find Path to Tile In Range. In this function all such tiles are stored in the Indexes With LOS integer array. This is done in the first part of the function, while the second part finds the preferred tile to attack from based on the Preferred Range variable of the current unit. Instead of doing this second part you should loop through all indexes in Indexes With LOS and find the one with the best cover instead. After this continue the AI event graph as normal.

I was looking over this thread and I swear somebody has already asked this, but is there a way to get the A.I. to guard, value and/or protect a certain tile? My idea is something similar to the system in the old Panzer General and Panzer Corps games, that guarded tiles designated cities for instance.

There have been similar questions, sure, but how this should be solved depends a lot on what exactly you are after, so you will need to be a bit more specific. Would it be something like: If there is a tile that should be protected within move range and it is not occupied, move to this tile. If already on said tile, stay put?

, thats exactly what Iā€™m looking for. Just something that gets the AI to take a more defensive stance when guarding a city tile.