[SUPPORT] Advanced Turn Based Tile Toolkit

Excellent :slight_smile: Glad it worked. My guess for your other bug is that the player pawns now block the trace that checks visibility for the AI. Make sure their collision is not set to block pathtrace or rangetrace.

I havenā€™t sent the update in yet, as it might not get noticed during the weekend. Iā€™ll wait until monday, early in the workday on the US east coast.

Thanks but it seems like these 2 parameters also arenā€™t in the version Iā€™m currently using :wink:
Maybe Iā€™ll focus on the UI right now and just wait for the release :smiley:

No, PathTrace and RangeTrace are in the version currently on the marketplace. They are trace channels that can be checked in the collision options of meshes with collisions. Maybe you didnā€™t add the project properly and the Config files were not included? This would happen if you migrated the files to another project, for instance. Check in Project Settings -> Engine -> Collision to see if the custom trace channels are there. If they are not, try creating a brand new project with the toolkit and copying the config files from this project (Likely located in Documents/UnrealProjects/[Project_name]) over to your old project.

Hi ,

Can you share a sort of release notes where you explain the details of this new release?
I remember you summarized a list of new features with completion percentage but I canā€™t figure out what will be changed exactly with this new release.

Sorry if my question is not so wise, maybe I missed something.

Edit:

I can explain better. Considering your list:

Planned Features (Percentage Completed)

  • Have movable and visible tiles in range meshes conform to the underlying landscape (95%)
  • Auto generate walkability and grid maps based on terrain without having to place tile meshes (95%)
  • Add more options for displayng and calculating visibility and pathfinding (sprinting, multi-turn movement (Civ-style), displaying walkability and visibility simultaneously) (95%)
  • Adding the option of spreading demanding operations over multiple ticks, improving performance on weaker hardware (50%)
  • Improved support for using sprites and 2D assets (30%)
  • Touch controls (10%)
  • Increase modularity of blueprints.
  • Add example maps of more specific TBS genres with custom code:
    ā€” 4X strategy (building and exploring)
    ā€” XCOM-like (Cover system ++)
    ā€” D&D-like (Dungeon visibility, complex game mechanics)
  • True height maps with overlapping grids.
  • Multiplayer support.
  • Units larger than one tile.****

We can expect what points?
Are you also including the new blueprint version with the five sections instead of the single Grid Manager?

@Wisdom-: The list of planned features can be seen in the original post on this thread. It is quite general, however, and the list of added features for each update will be more specific. Here is the list of added features coming in the new update. Iā€™ve probably forgotten a few things since Iā€™ve changed and added so much, but this is the gist of it:

  1. Walkability can now be generated automatically without placing a single tile. This means that you can use whatever static meshes you want or even the terrain tool and a grid will be generated based on what you have placed, as long as they have collision set to block PathTrace. Generates height information and can optionally be set to generate edge costs automatically based on height differences between tiles.

  2. Tiles in range and the various other markers can now optionally be set to decals instead of static meshes, meaning they will conform to any underlying terrain. Static meshes will also change rotation depending on the rotation of underlying meshes, though this only looks good in trully tile based games.

  3. Done a massive reorganization of the toolkit blueprints, making the toolkit more modular and making user modication much simpler. The blueprint is now organized as follows:

  • *]Grid_Manager creates the visible grid and holds all grid arrays. Holds all functions pertaining to the grid, including pathfinding and visibility. The grid manager does not call any functions on its own during runtime, but exists to be queried by other blueprints.

  • *]ATBTT_GameMode sets up the toolkit by spawning the grid camera and HUD and handles the turn based structure, including selecting the current pawn and starting and ending turns.

  • ]]ATBTT_PlayerController handles all mouse input, which mostly means deciding what happens when a tile is clicked or hovered over. Posesses the Grid_Camera.

  • ]]Grid_Camera works like before and is responsible for panning, rotating and zooming as well as following the current pawn if this is enabled. Does no longer have to be placed in the viewport.

  • ]]ATBTT_AIController controls the current active pawn if it is controlled by the AI and decides what action the AI takes during its turn.

  • ]]Unit_Parent handles the physical movement of units across the grid as well as attacking, taking damage and being killed/destroyed. Does not handle animation.

  • ]]Unit_[varies] handles the animation of the various units in conjunction with Anim_BP_Parent.

  • ]]Tile_Parent functions as before.

  1. Added new options for calculating movement and visibility. These include:
  • *]Calculating visibility and movement simultaneously. This is now the default. If the unit has movement points left it only checks visibility to enemies in range, not every single tile.

  • ]]Displaying tiles that units can move to in subsequent turns making it easy to add features like running in XCOM or setting up movement over several turns like in Civ.

  • ]]Visibility in diamond shape patterns (on square grids).

  • ]]Minimum range of visibility, for units that can only attack beyond a certain range.

  • ]]Corner crossing, diagonal movement and splitting up turns can be set individually for each pawn. Speed and acceleration along the spline can also be set up individually.

  1. Added option for displaying the grid as a plane with a repeating texture instead of meshes (currently only supports square grids)

  2. Option for sorting pawns in initiative based on an initiative value (not fully implemented by default, but easy to set up)

  3. New macros for handling spreading loops over multiple ticks (unused at the moment, but included for users who want to try them out)

  4. Lots of small improvements and improved commenting in general.

Exactly that was the case. Wouldā€™ve probably taken forever to find this error XD

If you donā€™t mind Iā€™d have another tiny question which could save me a lot of time. As I see it initiative order is created in the grid manager blueprint and values like health are defined in the pawn blueprints (with help from the unit_parent). Iā€™m struggeling with getting access to the current pawn, the next pawn and so on (and their values like Health) from other blueprints. In the current case I want to show a health bar (on the UI) for each pawn on the map in the order of the initiative (just below each other).

I think I need the initiative order array from the grid manager to read the pawns position on the array an with that determine screen position of the health bar. But Iā€™m already struggeling with getting the health value of the current pawn and displaying it (via progress bar) in a corner of the screen.
I tried casting to the grid manager and getting the initiative order array but failed to get the pawn currently at position 1 (to get its health value).

Good thing getting the config files imported solved it. Seemed likely to be the case.

The initiative array is an array containing all the units on the map. It is always sorted so that the item at index 0 is the current pawn, index 1 is the next pawn and the pawn at index array.length -1 will be the previous current pawn. If you for instance want to find the health of the next pawn in initiative you would get a reference to Grid_Manager (or ATBTT_GameMode in the coming update), get the initiative array, get index 1, cast the output node from the getter to Unit_Parent and from the output of the cast get the value of Current Health.

This should work, but if it doesnā€™t, could you send me a screenshot of how you do the casting?

For some reason my problem is to get the grid_manager ref and hook it up with the initiative array.
First of all I can create a gridmanager ref from ā€˜Tile_parentā€™, ā€˜Unit_parentā€™, ā€˜pawn_anim_blueprint_parentā€™ and ā€˜defaultā€™. I think either the unit_parent one or the default one has to be the right one. The one from unit_parent needs an input and both arenā€™t connectable with the get initiative array (which needs an input).

Edit: All of this is on an ā€˜Add Fill Percentā€™ function of a progression bar within a widget.

Youā€™re missing one piece of the puzzle it seems. From Grid Manager Ref (which should not have a blank default value) drag the node ā€œGet all actors of classā€. From that node you should have an output array of actors. From that array get element 0. Cast that element to Grid_Manager and get the initiative order variable from there.

Okay I think I understand my mistake. Everything seems to be connected as you described and thus far makes sense to me.
Unfortunately there has to be an error still. In the following image you see my current test setup where the progression bar doesnā€™t show anything.
When I drag a string from Cast Failed of the cast to the grid manager this string is printed. So the error should be somewhere thereā€¦
Unfortunately right now I donā€™t see it :frowning:

Seems one of the castings was unnecessary, but thatā€™s not it. Works fine on my computer with or without casting to BP_Grid_Manager. Not seeing anything obviously wrong with your verion either. Try relplicating what Iā€™ve made and see if you can get it working (blueprintue link here). Remember to set auto recieve input to Player 0 so that input keys are registered, and again make sure Grid Manager Ref is set to BP_Grid_Manager as its default value in its variable properties.

Hi ,

Thank you so much for sharing the new feature list.
It was critical for me and my team to know to know in advance what will be changed in order to bring our modifications to the new version.

Happy to be of service. I was going to make a list anyway, so this you just got me to make it a bit earlier. I sent the update to Epic yesterday along with e-mails to multiple different support e-mails. They havenā€™t answered me yet, but Iā€™m hoping the update will be up soon. I will try to make new tutorial video this week on how to use the new features.

Hi , I have one suggestion that might help make the transition to new updates easier from the viewpoint of customers. For people like myself who have already started using the toolkit in itā€™s original form, itā€™s not viable to move all the changed code to the new version after an update. And going through the code and comparing them to find the changes is a hectic task as well. So if you could provide some screenshots or additional info as part of the next update regarding the changes that you have made, it would be really useful. Since youā€™re planning to add more functionalities in the future, that would make a lot of sense until there is a system implemented to handle the update seamlessly. You could add it in a separate folder as part of the project with the version number of the update. I understand that this is difficult for some of the changes, but for small things like the one where you fixed the grid size (-1) bug, it would really help as itā€™s hard to notice.

Thanks for the suggestion. I am planning to make a new video showcasing the new features as well as a video describing how the blueprints are organized. Iā€™ve been wanting to make a video about the blueprintsā€™ organization for a while, but Iā€™ve delayed it because of all the changes I knew I was going to make.

Now that Iā€™ve landed on how Iā€™m going to organize the blueprint, most future updates can be additive instead of transformative, which means I can easily mark the new additions clearly with comment frames in the blueprints. Since the funtionality is spread across multiple blueprints I am unlikely to change all separate blueprints when I make an update, and users can safely keep their old, modified blueprints that have not been changed in the update.

The list of features I consider to be general enough that I want to include them in the default blueprints is also growing quite thin. When I have added touch controls, slow loops, multilevel grids and large unit support I am less likely to make large changes to the basic system.

Instead I will be creating example levels with special rules, like cover systems, fog of war, flanking, leveling up etc. These will be entirely separate from the default blueprints and use their own versions of the blueprints, with the modifications clearly marked and commented. Then users can easily copy whatever specific functionality they need into their own blueprints.

Ok, so the new big update is finally up! Epic seems to be having some trouble uploading it correctly, however, so the project and config files are missing. Not to worry, I have contacted Epic and they are working on it, but in the meantime you can get them here. Hereā€™s how to create a new project:

  • Download the toolkit and click Add to Project
  • Do not add it to a project. Instead create a brand new project. It will not show up in your library, but will appear in Documents/Unreal Projects/[project name]
  • Download the config and project files and drop these in the new project folder.
  • Youā€™re good to go!
  • If you want to add the files to a previous project, just copy all the content and config files from the new project to that project.

Love the update, imho this makes it much much easier to extend and customize with a much lower learning curve. Great work!

For the new update, I said I was going to do a new video that shows how to use the new features as well as how the blueprint is now organized. However, I have a pretty bad cold at the moment, and I donā€™t think all of you will want to listen to a snotty, coughing explanation, so I will wait until Iā€™m better until making a video. Instead I will give a quick overview of the new organization and how to access the new stuff below:

Most of the important stuff can be found in Blueprints -> Gameplay, except for Unit_Parent and Tile_Parent which can be found in Blueprints -> Pawns and Blueprints -> Tiles respectively, like before. Iā€™ll describe them in the order I think it makes the most sense to view them.

ATBTT_GameMode: Sets up the game at the beginning through its event graph. Spawns the Grid Camera (no longer has to be dragged into the viewport) and the AI controller and sorts pawns in initiative order (a new function for sorting using initiative attributes can be accessed in ATBTT_GameMode, though it requires some setup). It then chooses the first ā€œcurrent pawnā€ and activates either ATBTT_PlayerController or ATBTT_AIController depending on the faction of the pawn. ATBTT_GameMode also communicates with the HUD and changes the displayed ā€œPlayer Turnā€ text. On subsequent turns ATBTT_GameMode is called to find the next pawn in initiative and shuffle the initiative order. It holds the CurrentPawn, which is accessed from many of the other blueprints, as well as the counter for keeping track of the current turn (a feature which has no out of the box uses so far).

BP_Grid_Manager: Has gotten a lot slimmer. No longer calls anything by itself, except at the very start of the game when it creates all the grid arrays and stores tiles and pawns in the appropriate ones. Now includes options for automatically generating a grid and walkability on any meshes placed in the level, without having to place a single tile actor. Do do this, first drag the Grid_Manager into the viewport, change GridSizeX and the size of the default tile so that it covers the terrain/meshes you want to generate a grid on. Then change Max Grid Height and Min Grid Height to the maximum and minimum heights in unreal units relative to the location of the grid manager you want to generate a grid on. Then check auto height, and when you click play all meshes and terrain that does not have its collision set to ignore PathTrace should have a grid generated on top. If you also check Auto Height Based Edge Costs there will be generated automatic walkability depending on the height differences between the centers of adjacent tiles. You can adjust Height Impassable Cutoff and Height Slow increment to decide at what height difference movement cost should be increased or walkability be turned off between tiles. If you use terrain that is not flat I recommend setting the public boolean ā€œUse Decalsā€ to true, which will use decals instead of meshes for displaying tiles in range and markers. These conform to any underlying terrain. Note that decals do not work on mobile.

BP_Grid_Manager_Child_Hex: Is just a child actor of BP_Grid_Manager with default meshes and decals set to their hex versions to make setting up hex maps quicker.

ATBTT_Player_Controller: Controls all mouse input by the player. This includes deciding what happens when the player clicks or hovers the mouse over a tile. Interacts heavily with Grid_Manager in deciding what happens, as Grid_Manager holds all information of what is stored in any clicked tile. ATBTT_Player_Controller messeges Unit_Parent if it decides the input warrants that a unit should move and attack, from which Unit_Parent takes over. ATBTT_Player_Controller also initiates a player unit has been selected in ATBTT_GameMode by finding tiles in move and sight range. These have now been changed slightly so that both are generated simultaneously in most cases.

ATBTT_AI_Controller: Is activated by the GameMode as soon as an AI pawn has been selected as the current unit. The AI controller is not created one for each unit, but is a single blueprint that decides the bahaviour of only the current pawn. Holds the AI decision tree which determines what the AI does any given round. Tells Unit_Parent to go through with the chosen actions once they have been decided.

Unit_Parent: Receives commands from either ATBTT_PlayerController or ATBTT_AIController. These have already decided what path the unit shall move and whether or not it shall attack at the end of movement, and Unit_Parent simply executes this, moving the pawn physically along the movement spline and firing the Receive Damage event in the target pawn. The Receive Damage event changes the displayed health of the health bar and decides whether or not the pawn should be destroyed. Unit_Parent does not have a skeletal mesh and does not handle animation. This is handled in the event graphs of the individual units (Unit_player_melee etc.) in conjunction with the Animation Blueprints. This way it should be much easier to use custom skeletons. Unit_Parents has a few more public variables than before, and diagonal movement, crossing corners and the speed the pawn moves along the spline can be set individually for each pawn. A new option called Can Split Up Move lets the pawn move again if it didnā€™t use up all its movement in the first move. This can be modified quite easily to a Fallout-style action point system.

BP_Grid_Camera, HUD_Faction_Turn and Pawn_Anim_BP_Parent: mostly function like before. BP_Grid_Camera does no longer have to be placed in the game and is now possessed by ATBTT_PlayerController. Pawn_Anim_BP_Parent has had some minor changes because of the changes made to Unit_Parent.

Ok, thatā€™s the basic overview. As I said, I will make a video in a few days. In the meantime, like always, feel free to ask my any and all questions about the toolkit and Iā€™ll usually respond the same day.

Edit:

Thanks! Thatā€™s a relief to hear after working on the changes for so long. Iā€™m certain there are still a few more changes I can do. For instance BP_Grid_Camera is possessed, but input is still handled through the camera itself. There are probably a lot of stuff Iā€™ve overlooked or havenā€™t thought of, so I ask anyone reading this to tell me if theyā€™ve got any thoughts for further improvements.

Havenā€™t explored whatā€™s causing this yet, but thereā€™s a bug causing my pawn to revert to the 0 index after attacks(havenā€™t modified anything out of the box yet).

And here come the bugs :stuck_out_tongue: With such a big update I was of course exprecting bugs, but I was hoping they were more subtle. Iā€™ll look into it right away. Could you send me just the map file by e-mail (knuteiliv@gmail.com)? That would make troubleshooting quicker.