[SUPPORT] Advanced Turn Based Tile Toolkit

Hi @SpineRazor. There are a few ways I can think of doing this, though the simplest and most flexible (though a tiny bit less performant than some other methods) is to create a new grid sized array designating tiles as blocked/unblocked. I’ll show you how with some screenshots.

First, initialize the new array:

Then make pathfinding skip tiles that are blocked:

Now you can set any tile index to impassable by setting the appropriate index in the GridBlockedTiles array to true. When you do so, make sure to store the tiles you modify so you can revert them later (I do it in a very simple way here, but in your game you could store separate CurrentBlockedTiles arrays in your various incendiary grenade blueprints so that when one fire goes out it does not remove all other fires on the map):

Remember that if you do something to the grid to affect pathfinding it will first affect pathfinding the next time the Pathfinding function is run. If you have already run pathfinding and then detonate an incendiary you would have to re-run that pathfinding for the change to take effect.

Hope that helps!

Thanks @! I’ll give this a shot this weekend.

Good luck! Let me know how it turns out :slight_smile:

Small update. I’ve decided to split the next update into two separate ones to get the new features to users more quickly. I will be including networked multiplayer and transform-independent grids in the first update, and then add multi-tile units in the update after that one. This does not mean that you guys will have to wait longer for multi-tile units, but that you will get the rest of the features earlier.

Hello, @!
I need to develop few features and could use some directions where to start.
Features come from games like Jugged Alliance and Fallout:Tactics, where you move your units RTS style untill you see enemy (or enemy sees you), after that it’s turn based.
Turn based part is already pretty good in ATBTT, but RTS part is missing.

  1. Realtime movement while player doesn’t see any enemy.
    I’ve found “free roam” boolean, which makes pawns move without switching turns. But i can’t change destination while moving. Pawn recalculates path only after it reaches his destination. What’s best way to implement immediate path recalculation if clicked while moving?

  2. Group selection and moving in formation, while we don’t see any enemy.
    Right now, as far as i can see, movement is initiated and calculated by PlayerController blueprint, meaning that for group movement i need to move this logic to Unit_parent blueprint, so it’s run separately and simultaniuosly for each pawn. Or, maybe, more easy way would be to change CurrentPawn variable in GridManager to CurrentPawns array?

Hey @, I’ve done a lot of work on my basic multiplayer setup and am trying to port it all over to work in the “Jungle_Raid” map. For some reason, the above seems to have difficulties with the multi-level platforms, where a specific tile has two separate locations to stand at two different levels. The remote player isn’t always walking at the correct level. Is there some other piece of information I should look at to try and tell a unit what path and what tile to take? (As some example, go from 0, to the bottom tile of 1, to the bottom tile of 2, to the top tile of 3). Thanks!

Are you using the same indexes for each level? The index of a tile at level 2 is equal to the index of the tile directly below it + GridSizeX * GridSizeY, so for a 3*3 grid with two levels, the tile above tile 5 would be 14, for instance. If you want to display the tile indexes in the viewport select the grid manager and check PregenerateGameplayGrids and ShowTileIndexes.

UE4.16 is out and I’ve checked the latest version of ATBTT as compatible with the new version, so it should now be available through the launcher. There are no differences between this version and the 4.15 version of the toolkit, so if you are working with ATBTT in 4.15 and want to continue in 4.16 simply open a copy of your 4.15 project in UE4.16. The next feature update is still in the works.

Does this mean future versions of the toolkit will only work if you have a server? We have decided to not use multiplayer in our first game because balancing would take too much focus away from our game’s story, however we would still like to use multi-tile units. Will these two features be optional in the updated toolkit? Or would we need the server only version to have the multi-tile units as well.

Sounds like you’re making great progress!

By no means. If you are making a single player game the computer the game is running on counts as the server, so this has no impact on single player. The toolkit works just as it always has, but with the added possibility of networked multiplayer if so desired.

Certainly :slight_smile: There is still much to do, but I’m getting there.

hi, really awesome kit, excelent to place the tiles.
but personally i really don’t like the restrictives rules and seek something more freely like fallout or wasteland:
free select and move of the pawn if have no visible enemis, attack or select another pawn dont finish the turn, select a pawn when click on it (not only when click on the tile), separate attack and move mouse buttons (to avoid the fails clics).
i try to by myself but it’s really difficult to turn the game rules of this template to do that. ^^’

Hi Drackart, glad you like the toolkit. The things you are asking about are all fairly straightforward to implement. I’m away this weekend visiting the in-laws, so I cannot explicitly show you how to implement this, but I’ll do my best to describe it, and if you find it difficult to implement I’ll show you using screenshots when I get back.

For having free movement uninterrupted by turns you need to set the FreeRoam boolean in ATBTT_GameMode. When this variable is set to true the current unit has infinite move and never ends its turn. Whenever you want to return to turn based combat you need to set it back to false and run the EndTurn event in ATBTT_PlayerController.

For selecting units when clicking the unit mesh, not just the tile it is standing on, you could run a line trace for objects specifying Unit as the class in the filter. Run this trace in the event graph of ATBTT_PlayerController before the line trace by the channel PathtTrace is run. If it returns true, get the index of the clicked actor and set the Clicked Tile variable to this value. Then skip the regular line trace and jump right to the part of the event graph where the faction of the clicked unit is examined to determine the appropriate action. Make sure that your units have collision enabled and do not block PathTrace or RangeTrace (as this will disrupt pathfinding and line of sight calculations respectively).

For separating attacking and moving by different clicks you can add a new right-click input and add this in the same place as the left click event in ATBTT_PlayerController. Connect it to the same spot, but for each click event set a boolean so that you know which button was just clicked (for instance add a bLeftClick boolean that is set to true when LMB is clicked and false when RMB is clicked). Later down the execution chain check if the value of this boolean is set to the appropriate value before executing the nodes associated with movement or attacking.

I hope my description was clear enough for you to implement your desired changes. If not I’ll try again once I have access to my home computer.

That’s incredibly cool that it sounds like multiplayer is coming along nicely! I’m rooting for you, great job!

Hello! Sorry if this has already been asked before but I’m planning on making a few maps ahead of buying your toolkit on the marketplace so I have to ask; Is there is a set “distance” or “size” that the automatically generated grid will be using that I can use as a measurement when making the map? Or does it scale according to the textures? Rather new to the programming side of things, mostly done level development, so any information on this would be incredibly helpful. Thanks in advance.

Thanks! Yes, multiplayer is working for the base toolkit at this point, though having it work with the skill-system will take some work.

Hello Crux, I don’t think that has been asked before and it is a good question. I’ve designed the toolkit so that it can be used with grid tiles of any size, so it is completely up to you when it comes to designing your levels. The default size is 200x200 Unreal units (cm) for square grids and 200x231 Unreal units for hexagonal grids, but changing this is as easy as swapping the default tile mesh. With the coming update you will also be able to scale the grid in the editor like you would scale any other actor.

Hi ,

Have you created a function that identifies all of a player’s units at the beginning of their turn? I would like to create a function that adds an action point for each unit on a specific type of tile at the beginning of each player’s turn. Do you have any suggestions on how to go about doing this?

I have made no function for this, but I’ll give you one way to do this. Get all actors of class (unit) -> run a ForEach loop -> check if the unit is standing on a specific tile (I assume you have already added a method for this) -> if true set the unit’s action points to current action points +1.

Any ETA on when this update will land? If it’s a week or more away I’ll dive in the current version and learn my way around but if it’s a few days away then it might be worth the wait since I’m looking into building a primarily skill driven combat system.

Way more than a week away, I’m afraid. Though I’m working on the toolkit daily the update won’t be done until a couple of more months at the earliest. There is still a lot I want to do. The skill system will still be very similar in the coming update, so converting any skills you’ve added should hopefully be quite easy.

Alright, thank you for the information. I’ll use the current version.