[SUPPORT] Advanced Turn Based Tile Toolkit

Yep, it can be set within the cover component.

Yes, anything within the bounds of the grid that blocks the PathTrace channel will be added to the grid.

You just need the one grid.

Hello,

Iā€™m still running into issues where the AI never stops assessing abilities. The error says it is thrown in update attributes, but I think it is constantly comparing it with another ability of equal value. Iā€™ve logged the assessed value and it is 0, so I would assume the AI would pass its turn. But it just reassesses. How can I ensure they stop their assessment loop?

Edit: I verified all of the abilities it considers tie for 0. I guess it would still prefer to do one over the other, and continues to loop. Is there a good place in the BP_Ability BP to address this globally?


This will cause them to do nothing when they could but it does stop my error I think. I actually moved it directly after the branch.

Hey all, Iā€™ve begun work on replacing the ancient tutorials that explain the basics of the toolkit with a new tutorial series. Here is the first video in the series. I start with some very simple stuff, so nothing someone who follows this thread wouldnā€™t know, but I think there will be some good info for even experienced ATBTT devs in the coming videos.

Thanks for the report, Luna. Is replicating this issue as simple as having two abilities both assessed at value 0? I will look into this tomorrow.

Edit: Reuploaded video with stereo sound

Hi ,

Sorry, weā€™re still having issues with the tile meshes spawning out of bounds of the grid. We canā€™t figure out how to use the new UpdateTilesInRange function to supposedly prevent this. In the blueprint below of our tile mesh would you have any idea? They spawn just fine where we want them to in relation to the other tile meshes. I posted a gif link below of how it is going out of bounds. Unless I am misunderstanding its purpose and there is no way to ever go out of the 100x100 grid and we need to use another method to simply not allow spawning them at the border of the gird?

https://imgur.com/a/ZdUblIQ

New tutorial video is up! This is the next in my series of the toolkitā€™s basic features. This one covers tile actors:

Hi, Iā€™ve confirmed this issue on a fresh project now. If an AI unit with the ability system gives all abilities a value of 0 it does indeed cause an infinite loop. I would solve this in the same way you have done it, just that I would exhaust the unit before FinTurnManager. Thanks a lot for bringing this to my attention. I will submit a hotfix.

Did you follow my previous instructions exactly? Did you place the GridManager at location 0,0,0 (with a GridSizeX and GridSizeY of 1) and a subgrid at location 100000,100000,0 (and use this subgrid as your starting location by placing a unit there)?

Glad I could contribute! Itā€™s been great working with the toolkit so far. What do you mean by FinTurnManager? I moved it just before Find Turn Manager In State. Is that what you had meant?

This still unfortunately will make my unit have 0AP when they may still have some left over prior to the turn ending. Other abilities in my game may give back AP, so this kinda ruins the AI turn sometimes.

I bought the toolkit yesterday and wow thereā€™s a lot of stuff! Iā€™m really glad you are updating the videos because itā€™s hard to know where to start. I am curious as to how one switches between 90 deg turns (E & Q) and continuous turns. I would also like to use the right mouse button to rotate, if you have any tips. Amazing asset; I canā€™t imagine how much work you must have put into this.

New video is up!

Hi Dijon, hope you get good use out of the new videos :slight_smile:

To disable the 90 degree rotations set bNinetyDegreeRotation to false in BP_GridCamera. As for mouse rotate, the way the grid camera is set up currently it is tricky to get working, but it is on my list of things to implement.

@ Thanks for the feedback. The more I look under the hood, the more impressed I am with the amount of detail. This is truly well done and Iā€™ll write a review for it soon.

Much appreciated and thanks for the kind words :slight_smile: Since Epic started requiring written reviews instead of just star ratings Iā€™ve received just 3 new reviews (and 38 questions :stuck_out_tongue: )

@ In your Jungle Raid map the player faction has green health bars and the enemy have red ones. In the current version they are all red. Iā€™ve looked in the ā€œswitch on factionā€ BPs but I canā€™t find where you set the value.

Currently (again in Jungle Raid) with the characters in the centre of their grid, trying to play a cover animation will look silly because the character is half of a tile away from cover. Have you come across this before and, if yes, how did you solve it? Iā€™d rather not start playing with grid offsets, so the only thing that I can think of is to shrink the size of the tiles or scale up the characters. Your thoughts?

Iā€™m pretty sure that I saw in one of your videos that an event is fired when a character enters a new tile. Would that event contain any information about the tile, such as whether it is a cover tile?

Also, do you have a roadmap of any planned future changes? Iā€™d like to change the movement areas, that are currently colour coded to show move distance, to the XCom 2 / Gears Tactics style where only an outline of the move distances are shown.

Hello again! Having a weird issue, and Iā€™m having trouble debugging it. Seeing which nodes are/arenā€™t firing correctly is rather difficult with a small, one-monitor setup. Iā€™m hoping to get some clarity. For context, Iā€™m trying to randomize stats from character to character, and I am succeeding in what Iā€™ve applied so far for simple things, like health and movement speed (effectively the number of tiles a character can move). Iā€™m taking advantage of the basic PrintString node just to see that yes, different variables are being applied correctly, and yes, those variables are showing as in-game effects. Perfect so far, and thank you for the help getting me there!

However, when I change the health of units, sometimes things break in regards to taking damage and removing units. Right now, Iā€™m generating a random integer for health that falls between 62 and 160, converting it to a Float, and then setting the Max Health config variable to that. Some units take damage correctly, show the death animation, and are removed from the grid, while others will take damage, still show a small amount of health remaining and will stay on the grid, but will act as if they have died (cannot be targeted or controlled, AI ignores them, can move into the same tile, etc.).

I canā€™t seem to figure out the root cause of this. Iā€™ve tried looking at the TakeDamage function in Unit_BP in particular, that seems to be the function that would control the issue Iā€™m having, but I canā€™t see what could be going wrong. Could you take a look at this for me, or at least point me at the correct variables/functions to examine closer? Thank you!

(Also the updated tutorial series is deeply appreciated, I will absolutely be diving deeply into that as you upload them.)

Good day someone make turn based strategy?

hi mono

thanks a lot for the new videos, they are great!

few questions :

  1. in the new version I noticed that there is some lad/ delay when starting the game. after a lot of searching i ended up in the turnmanager in the NotifyPlayerReady event there is a delay for tick node that is set to 20. i think its a mistake and probably should be 2. but if you did it on purpose can you explain why?

  2. in the setup base edges function in grid manager you made minor change in the new version. that change made some problem with my outer line display i did. it seems that is now (with the new version its gives me incorrect line).

  3. this is a Very general question. i have like 40 character a player could choose from to start a mission. my base character have a lot of variables and some components. i have few option on how to have all the 40 character and there data store in the game , but i need your input on what way you think is the best to organize every thing. one way is to make to each one of the 40 character a separate character with all his stats and variables on his character, but making 40 like this doesnā€™t make sense to me (does it?). the other way is to place a tmap list with struct somewhere like in the gameinstance and store all the variables for each character there. and just spawn from this tmap the character according to there name (for example). is this a better way to do it? is there another way you would have done this? performance and memory wise.

thanks

leo

Hmm, how about that, I had forgot that I used to color the health bar by faction in Jungle Raid. Here is a quick way to achieve this result:

https://i.imgur.com/8xvj4BH.png

You could of course resize the tiles, but in any case you would probably want to detect the direction of the cover so that you can play your cover animation leaning against that cover (where the unit can move closer to the cover within the tile as part of an animation). Does that sound like a way to do it? Not 100% sure if I understand the question.

The event dispatchers OnUnitEnterTile and OnUnitEnterTile are both called during movement simulation, and they have the GridIndex of the tile as input. This GridIndex can be used to get values from any of the grid sized TMaps. This includes things like GridLocations in BP_GridManager for the viewport location of a tile, or the GridCoverTiles TMap in BP_CoverSystem, from which you can get the cover data for each tile on the grid.

There is a link to my Trello on the original post of this thread, which shows current WIP and planned features, as well as lists of all significant changes that were made in each update since the early days of the toolkit.

Move outline are my one great nemesis. Iā€™ve tried to implement it several times, and each time Iā€™ve gotten something that almost works, but breaks for certain map combinations. It is something I plan to tackle again someday, as it is a much-requested feature, but I need to come up with a good way to solve it first. The result of my previous attempt can be found in the 2D map HydrasLair. This uses procedural meshes and post process outline shaders. It works fine if your map has flat tiles, so you could look at it and see if it can work for your game.

Hi, this seems likely to stem from a mismatch between what is held in the unit variables and what is passed to the action system. The health bar is not automatically updated when you change the value of health. It has to be separately modified. This is done since game logic things are done instantly (so the moment you click an enemy, damage is applied), but you generally want to delay modifying the health bar until after the attack animation has played. So, in other words, after changing health and max health set the scalar parameter value of the health bar to a percentage that reflects it. Hopefully that should do the trick.

Indeed they do :slight_smile: Are you looking for examples of things made with this toolkit?

Glad you think so, leo!

That delay is to make sure everything is set up before starting the game. The value is so high to make sure clients with slow connections will not have issues in networked games. However, it is unnecessary to have the value be this high for local games, so I should have added a Select node based on if the game is networked or not. I will put it on my list of things to fix. More long-term Iā€™m also working on a setup that would eliminate the need for a hardcoded start delay altogether.

Oh, thatā€™s right. It is a pretty subtle change, but one for which it makes sense that would screw up some things in custom projects. So the base edges used to be ordered clockwise, so North, North-East, East, South-East etc., more or less arbitrarily.

However, this caused some minor visual pathfinding issues in some cases for multi-level grids. When edges are added between tiles on multi-level grids, they do so in the order specified in the base edges. This is also the order in which pathfinding will prioritize adding tiles to the open list when searching for a path.

With this old ordering, units would sometimes prioritize walking North-East rather than East on a path, if both had the same cost. The path is just as efficient, but it looks weird to have the units zig-zag like that. Because of this I reordered the BaseEdges array so that the straight edges go first (North, East, South, West) and then the diagonal ones (North-East, South-East, South-West, North-West).

Sounds like something that would be a good fit for a data table. Create a struct with the relevant unit data and make a data table from it. Then populate it with your unit selection.

New tutorial video is live. This one is about working with height differences in ATBTT, including overlapping multi-level grids. Enjoy!

Thanks so much for the updated tutorials, this latest pointed out something I didnā€™t realize I could use.

Were you planning on making a tutorial soon using the UpdateTilesInRange function to show how to spawn meshes dynamically creating our own heightmap bounding box?

Thanks for these new tutorials; Iā€™m so appreciative since they really help in understanding the toolkit. Iā€™m that one person who can use the Height Slow Increment so Iā€™m glad you pointed that out! That feature was not created in vain :cool:

I might do an extra video at some point on things like subgrids and UpdateTilesInRange. UpdateTilesInRange is fairly straightforward, though. Input a location or GridIndex, set a range and the tiles in range will be added as if they had been within the bounds of the grid at BeginPlay.

Happy to hear that! Iā€™ve had to learn the hard way that even if something is simple and quick to add initially, having to keep the feature updated through all versions is a lot of continued work. The HeightSlowIncrement is one of the prime examples of this, so it is good to hear it was not all in vain.

How does a unit entering cover know that it is in cover? Is the unit also aware of what is in the surrounding tiles, or just the edges? I would also like to replace the existing combat system with my own, but I want to keep your ability system. It seems like I could just change the BP_Ability_Laser, for example, to how I want it to run. Is this too simplistic (i.e. is there a better way)?

Itā€™s taking me a while to get my head around the toolkit, but Iā€™m really liking it, and the videos help a lot. It would be nice to have written documentation, rather than having to watch an entire video when I get stuck, but Iā€™m one of those dinosaurs who prefer written tutorials.