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.