[SUPPORT] Advanced Turn Based Tile Toolkit

A new version of ATBTT has been sent to Epic and should hopefully be live sometime this week! This is a new feature update, though most of the features are changes to the structure of the toolkit to allow various game specific features to more easily be added rather than ready-to-use additions, though there are a few such features additions as well.

This version is built with UE4.21 and will be the version you download if you select 4.21 when creating a project with the toolkit. If you prefer to keep using the previous version of the toolkit in UE4.21, simply create a ATBTT project in 4.20 and convert it to 4.21, which does not seem to cause any issues.

I am choosing to call this version of the toolkit 2.0. And yes, I know that it is fine to make version 1.10 after version 1.9 (the last version), but I feel the toolkit has gone through so many changes that it is about time to slap a big 2.0 on it; not to mention it will add another T to the name of the toolkit, making it even more difficult to pronounce :stuck_out_tongue: Even though this is a fairly substantial update, it is certainly not the biggest update Iā€™ve made, with 1.8 certainly taking that prize, so donā€™t let the name fool you. Nevertheless I hope people will appreciate all the new changes and additions and realize the new possibilities that open up thanks to some of these changes.

Since I have altered some core aspects of the toolkit, this will unfortunately be a fairly difficult version to update an old project to if youā€™ve made a lot of modifications. My recommendation for that is as always to port over your own additions manually and integrate them into the new toolkit rather than going the other way around, as you presumably know your own additions better than you know mine. Still, Iā€™ve tried to be as transparent as I can with what has changed, by adding boolean version markers and commenting. Below is a list with the highlights of what has been changed in this update, though you can see a more complete list at my Trello.

v2.0 (files pending - sent to Epic 13.11.18)

  • Refactored how tiles are indexed to allow for adding tiles beyond the edge of the grid manager at runtime.
  • Refactored multi-level heightmaps so that they are predictably indexed based on their relative height.
  • Added subgrids, which are blueprints that can be placed outside the grid and treated as being part of the grid.
  • Moved hexagonal grid math to separate child blueprint.
  • Hex grid math now uses a cube coordinate system, simplifying math and making it more efficient. Thanks to Amit Patel for his useful guides on hex math.
  • Switched the skeletal mesh of BP_Unit_Anim and its children to the default UE4 mannequin instead of the mobile mannequin.
  • Experimental: Added outline post processing material for displaying move range as an outline. Thanks to Tom Looman for his tutorial.
  • Experimental: Added new blueprints (ladders and teleforters) for automatically adding custom tile edges.
  • Experimental: Added new experimental unit, which has movement animations that change based on the underlying array (utilizing a new SpecialEdges TMap in BP_GridManager)

hi

Even though Iā€™ve told you before, Iā€™ll say it again:
I speak for myself (but Iā€™m sure others feel the same way). I have a lot of appreciation for how you invest in this project, and itā€™s not Taken for granted!!!
I as a developer feel a lot more confident with your product, which I know there is unceasing support behind it.

I just wanted to say thank you, and do not think Iā€™m going to stop babbling you with a bunch of questions all the time :slight_smile:

cheers
leo

[USER=ā€œ641905ā€]leo bar[/USER], 110% agreed !

Looking forward to sub grids :slight_smile:

Thanks! Iā€™m glad to hear it is appreciated :slight_smile: Donā€™t worry about asking questions. For the most part I very much enjoy providing support.

I see it as a win-win. When you guys find bugs or features that are confusing/difficult to modify you are basically playtesting my own future games that will be build on top of ATBTT for free :wink:

Also since marketplace searchability is horrible thanks to a lack of good sorting options, having an active support thread is one of the few ways new people can discover the toolkit (not to say I would slack off on support if discoverability improves, of course).

Lastly, since I do provide a toolkit that is so huge and feature rich, even if I made a million tutorials, I do realize that having access to custom support needs to be part of the package that you buy, or a lot of people would get stuck. To flip it around on the self-serving side again, I think that if I cut out support for this toolkit, the star rating of this asset on the marketplace would probably start falling quite rapidlyā€¦

But yeah, even with all that Iā€™m just super proud to see so many people developing stuff on top of what Iā€™ve made, and being able to play the role of guru for something I have complete knowledge of is a nice contrast to the life of uncertainty (scientific and otherwise) that is being a PhD-student.

Thanks a lot! ( [USER=ā€œ641905ā€]leo bar[/USER]: looks like just beat you by 10% in the praise department. You need to step up your game :wink: )

They will hopefully prove a useful feature. A word of warning before I get to make a tutorial on them: I believe they might be slightly unintuitive to understand immediately. They look like a mini grid manager, but donā€™t expect them to act exactly like one. Also, you cannot place to of them on top of one another. Think of them as zones on your map that tells the main grid manager that it needs to add those tile locations to the grid arrays as if it was part of it. You can achieve the same effect now by just making a huge grid manager that overlaps all areas of the map where there might be a section that is walkable, but this means the grid manager will run path traces looking for tiles at a lot of empty space on startup. The subgrids are essentially an optimization feature that allows you to specify what sections to add if you have a world that is sparsely populated with walkable ā€œislandsā€ with lots of empty space between.

hi

I have a few questions, hoping you can clarify them to me:

  1. big maps:
    in my project i have several big maps. if i set the max loop iteration count in the project settings from 1,000,000 to 10,000, 000 then the project run ok. But Iā€™m a bit afraid of this situation, after all, they did not just limit this count to the existing number (I realized that the max iteration count is not affect just for the loops), so i started to think maybe i should change the loops to loops with delay or something like this, what do you think?
    also there is strange behavior which i cannot understand, when i try to play a big map with default settings i get an error( because of the max loop iteration count) then when i change the max loop iteration count to higher value the project work fine. and then i set the max loop iteration count back to the 1,000,000 default settings and its still working.

  2. nativization
    no matter what and how i tried to nativize the blueprints ( all or just one of them) the project does not work. i mange to get it packaged but when i tried to lunch the project i get an error. basically i want just for the beginning to just nativize the grid manger blueprint but i am getting an error. any idea?

leo

Hey leo, both of these are known issues of the toolkit. The first I intend to solve just as you are suggesting, by splitting up map generation over multiple ticks. Increasing the loop iteration limit is a way to get around it, of course, though it will increase the time it will take for the game to realize it has encountered an infinite loop if it happens. Not the worst problem, but not ideal, of course. It might be possible to tell Unreal to decrease the loop iteration limit after the game has started, but Iā€™m not sure how.

As for nativization, this does not work with the grid manager currently. This mostly seems to be due to a specific issue in UE4 that has to do with maps and arrays of structs. I reported this issue to Epic quite a while ago, and they have unfortunately not fixed it yet. You can vote on it here to give it more recognition. If you add your own stuff that you want to nativize you can choose to exclude the grid manager and the blueprints that are dependent on it from nativization, but grid manager functionality cannot be nativized until Epic fixes this issue, unfortunately.

Edit: In other news, 4.21 is now live, though I immediately realized there is a small annoying bug there. When doing some last minute testing I switched the static move cost value of BP_Ability_MoveAttack from 1 to 2 and forgot to change it back, meaning that units in the example map cannot attack unless they are already in range of a target at the start of their turnā€¦ Iā€™m sending an update to Epic now.

hi

ohhā€¦i didnā€™t know that the problem with nativization is old (i have tried for hours to make it work :)), thanks for letting me know that , you saved me a lot of time and i will sure vote for this.

leo

hi

another one :slight_smile: in the new build how can i implement the new Experimental move outline instead of the old spawn tile marker?

Yeah, that is unfortunately how it is at the moment. Hereā€™s hoping Epic fixes it in a not too distant update :slight_smile:

You need to add an unbounded post processing volume to the map which has PP_Outline as one of its Post Process Materials. Then for the move marker meshes you want to spawn, in rendering settings disable Render in Main Pass and enable Render CustomDepth. Note that this is experimental so the current implementation only works really well for grids without height differences. For grids of varying height you will need to find a way for there not to be any overlap between any adjacent tiles, or there will be gaps in the move outline. I have experimented with using procedural meshes and line traces for this, but have not gotten anything Iā€™m really happy with yet. Hence this is still an experimental feature, though it works well for flat maps.

great, thanks

Hello , Nice work on the update, Thanksā€¦I have a question about spawning at run time, is it basically the same as your nodes on page 33? or has it changed because of the newer versions?..also good work on the transporter, works good !

Should be possible to just spawn them using the SpawnActor node, and the construction script should take care of the rest, though make sure to set the owner to the appropriate player controller.

I was also wondering about this. I keep getting the following error; ā€œattempted to access index 0 from array charges of length 0!ā€ and the same error for the charges array. The actors Iā€™m attempting to spawn in real time are parented to BP unit. Iā€™m thinking each spawn needs to be updated to some arrays but am having no luck.

Hmm, odd. I thought the construction script of Unit should take care of this now. I will look into it and see if I broke anything by accident when finalizing the update. In any case this is fairly simple to do manually. After spawning the unit, convert its location to a grid index using ConvertLocationToIndex3D. Set the GridIndex variable of the unit to the output index and also add a reference to the unit at that index in the GridUnits TMap in BP_GridManager. Lastly add the unit to the InitiativeOrderActors array in BP_TurnManager, wherever you want it to appear in initiative. Use Add if you want it to act after all the currently existing units have acted.

Thanks Mon! Iā€™ll try the manual way tonight after work and let you know.

Hi , first of all your turn based toolkit is excellent, huge thanks for making and updating it! I found a discussion in the this thread about how to make Fallout 1-2 style gameplay, when you can control main character and as soon as it is seen by enemy AI the turn based combat starts. U suggested to use a simple top down template for free roam walk and when the combat starts simply draw grid and start turn based combat but you also suggested to snap AI position to the nearest grid tile. So I was wondering if by any chance you could make a tutorial about this last bit how to snap AI to the nearest grid tile when turn based combat starts? Thanks in advanced if you can do this tutorial.

hi

i encounter something strange in the new build, i do not know if its a problem with the new function - Create Locations And Heightmap, but i think i am the fault and i do not understanding something.

when i place a mesh in a multilevel grid at about 250 above the grid and the Heigh Between Levels set like default at 200, the spline path no longer go under the mesh (in the old build it is ok). but when i set the Heigh Between Levels in the grid manger (in the new build) to something low like 50 then its all good, can you explain this behavior?

cheers
leo

TLDR:

in 2.0 witt 4.21, if I duplicate the BP_PlayerController_ATBTT, it creates errors, specially regarding the pins that read Self. Why does this happens, and how can i overcome this? Iā€™d like to tweak and experiment with the BP, but leave the original untouched for a convenient referenceā€¦I guess I could duplicate it, leave it with the compiler errors, and just modify the original one and use the copy as the referenceā€¦

Longer noob ramblings:

To anyone who may have words of advice: Iā€™m currently trying to make an isometric-ish 3rd person setup with real-time WASD movement thatā€™ll switch to the turn-based system has made. For this, unless Iā€™m mistaken, I need to modify the ATBTT Game Mode, Game State, Player Controller, and Default Pawn Class, correct?

Default Pawn Class should be something like my third-person character+camera Iā€™ll be using, and the rest of the BPs should basically wait until a signal is given to activate/switch everything with the turn-based stuff, right? With this signal given, Game Mode would initiate the ActivateATBTT Event, Player Controller should switch from the WASD and camera controls to basically everything thatā€™s inside the ATBTT Player Controller, and Game Stateā€¦still not sure about that one lol, need to read more on how exactly itā€™s working. Iā€™ll probably need to also delete the Character object when the turn-based game begins and replace it with an Actor for the Grid Manager to interpret it as a unitā€¦

Anyway, any words of advice from anyone who knows how to tackle (but SPECIALLY about the duplicating error of the PlayerController) this would be awesome. I was sick af the entire weekend and it was the perfect excuse to sit down and start learning more about basic games frameworks, blueprints and ATBTT hahaā€¦Learning and game-making can be so much fun guys. u da bestest and have a great day!

thumbsUp.gif

hi

in my project i implemented a third person real time with the turn based toolkit. it was a pain in the aā€¦ to archive this, but if i manage to do it so everyone can :slight_smile:
here is the way i did it:

  1. made the bp_unit reparent to character(so you will have the benefits of the character component - for real time) and that mean that you have to fix some blueprints of error after the reperant (the engine will tell you where ) just look in all the blueprints for the fix you need to do (most of them related to the grid index) . and you have to copy in the construction scripts(in the bp_unit) almost every code from the grid actor.

  2. in the BP_PlayerController_ATBTT i wrote all the code that posses a unit and move to third person view in real time.

3 made the ABP_Unit animation to suit this kind of game play (real time)

  1. while moving your unit in real time you have to remove unit from grid and add it to grid so the grid manger will know where is the new position of the unit after moving.

  2. i also added, when i finish movement and i am going back to the grid camera view, a snap to grid, in order that my unit will position in the middle of the tile.

  3. add logic so when moving unit in real time it cannot stand on same tile with other unit.(i just manipulated the capsule component - but you can do it in a better way)

  4. you will have a problem that after you want to posses the grid camera back your unit that was unposses will no longer be associated with your playercontroller and you will be stuck. in order to fix this you have to set owner again to your unit with the player controller.

hope i could help you and didnā€™t confuse you :slight_smile:

start by doing step by step, and if you are stuck just ask and i will try to help you

cheers
leo