[SUPPORT] Advanced Turn Based Tile Toolkit

Just wondering if you could point me in tge right direction for a teleport strike. The way I have it now breaks the unit, causing it to show up on the edge of the map and be unable to attack or take damage after the ability is used.

Depends on what you mean by teleport strike. What precisely are you trying to achieve and what are you currently doing? Teleporting to the edge of the map indicates that you are interpreting a function that returns false as a grid index, causing it to return index 0 (which is at the edge of the map)

hi

ok in order to be more clear on my problem here is the steps I did :

1.started a new project
2. copy all the code of the move to segment, QueueMoveSegment function and simulate move (override) into the bp_unit_unim.
3. place the unit on the grid with a ladder (the 3D widget appropriately sit over the tile at the top of the ladder ). 4. move my unit - the result is in the gif below:

giphy-2.gif

so I got lost what have gone bad there, didnā€™t change anything

also if you use the experimental movement you have to make sure your grid manger location is at zero,if not you get wrong placement. is there a way to change it? I need my grid not to be on the 0,0,0

cheers

leo

Ok, thanks for clarifying. Seems like I forgot to correct for the location of the grid in the experimental unitā€™s SimulateMove function. Here is a version of the function where Iā€™ve corrected for the gridā€™s transform.

Less certain about your other issues, though, as Iā€™m not able to replicate them. Do they still appear if you use BP_Unit_Anim_Ex instead of your own custom unit? Also, what is the precise height of the box the unit is climbing and where have you placed the ladder blueprintā€™s 3D widget?

hi

thanks for the corrected function - problem solved

the other issues was solved too. it seems that In my abp_unit in the transition rule of the animation I had the blend setting duration set to 0.2ā€™ I just had to set it to zero. sometimes I have this small things that I get stuck on them for hours :slight_smile:

anyway sorry for the time, and thanks a lot for the help

cheers

leo

Glad you figured it out, Leo :slight_smile: Getting stuck on something small and stupid is one of the great joys of game development. Let me know if you come up with a better solution for the climb animation while working on it, as Iā€™m not too happy with the current implementation.

Hey ,

First off, fantastic package you have here. Really appreciate how much work you put into support for it too.

Now Iā€™m pretty new to UE4 blueprints as are a few other people Iā€™ve seen here. I have had a number of searches but not found exactly what I was after so I thought Iā€™d ask, sorry if it has already been covered.

If I was trying to create a free roam game that changed over to turn based for combat but was not using the grid (think Divinity with AP used for movement based on distance as well as abilites) would you suggest just starting from scratch using your turn based stuff as examples, or is there a simpler way to remove the grid? Iā€™m guessing not since most things are tied into it in one way or another but just wanted to check before I spend time reverse engineering things.

Thanks!

hi

I am going to make my own animation for climbing (this one is not good for me)

but in order to make the climb animation in the toolkit more smooth and flowless here are the steps to correct it:

  1. in abp_unit_ex in the anime graph you have to change some of the transition rules settings. first go to transition between the idl_walk_run and climb start and change the duration to 0.1 (under the blend settings). next do the same for all the transition except from the last one that go back to the idl_walk_run (it should be at 0.0).

  2. in the abp_unit_ex event graph go to the climb up event and disconnect the pan to location (its mess up the blend).

  3. make sure the animnotify at the ladder_loop is at the very end.

thatā€™s it ! you good to go. its not perfect by any mean(the position of the keyframe in the 3 animation is not the same from start to finish ) but it good.

hope its help, let me know if you need more Clarifications. its working good on my part.

cheers

leo

Hey Loadout, happy to hear you think highly of the toolkit. Iā€™m not sure Iā€™m able to give you an unambiguous answer to your questions, though. If I was to make a game like the one you describe myself Iā€™d use the toolkit as a base, but then I naturally have a very good overview of everything the toolkit does, including what functionality assumes there is a grid and what does not.

As this will likely not be the case with you you might potentially lose a lot of time trying to figure out what can be used and what cannot, which means that a clean slate and using the toolkit for inspiration might be the best answer. Iā€™m not certain, though. With the newer version of the toolkit things are very modular and most gameplay stuff is defined in the abilities. For the most part you would be able to use stuff like the turn order, action system etc. mostly as is, while you could implement your gameplay within the abilities.

For instance, you could create an ability that instead of using RunPathfinding to find a movable area on the grid, uses UE4ā€™s navigation system to find an area you can navigate to within a radius. Then in the ServerInteract event for the ability, instead of checking the movement cost of the clicked index and using that to reduce AP you would get the clicked World location and check it against the navmesh. Stuff like that.

So yeah, a bit difficult to answer. If you like how the toolkit is organized it is probably worth a try, but if it keeps feeling like youā€™re being constrained by my grid based design decisions perhaps start from scratch instead.

Thanks a lot, Leo! Iā€™ll test out your suggestions and will add them to the next update.

To clarify Iā€™m trying to make the damage modified when certain units hits each other and i was wondering where i can modify that in the blueprint as i couldnā€™t find the health variable from within the Bp_Unit.

BP_Unit has two health variables. CurrentHealth is the one you most likely want to modify. MaxHealth is primarily used to inform the health bar. These variables are both in BP_Unitā€™s public variables. Perhaps you cannot find them because youā€™re looking for them in one of BP_Unitā€™s child actors and have forgotten to select show inherited variables? Note that CurrentHealth is used to inform the game logic, but modifying CurrentHealth will not lead to any visible changes for the player. For this you need to queue an action to ReceiveDamage. Check out my video tutorials on the Action System if this part is unclear.

hi

not sure, maybe it was on an old version but i saw once that you fix the spline of the climbing but i cant find it. is it still in the toolkit?

thanks in advance

leo

Oh, good catch. Seems Iā€™ve set the wrong default ability for the unit in the experimental map Use Ability_Move_Ex for the corrected spline

great, thanks a lot

Hey,
in the 2D version of the GridManager the tiles in move range are displayed with an outline, as seen in XCOM, Mutant Year Zero etc. Would it be possible modify the way tiles are displayed in the 3D version in the same way?

Depends on the game. Making XCOM-style outlines is a problem Iā€™ve tried to tackle at multiple occasions, and finding a generic implementation that is performant works for all sorts of games has been very challenging. The approach used in the 2D example uses an outline shader and instanced static meshes. It works great for maps with flat tiles and limited variability in height between tiles. For games using terrain (such as your game) the outline will look jagged and weird. I have not yet found a solution Iā€™m happy with for such a game.

Hey, hope youā€™re well.

I was looking to add the functionality for changing oneā€™s active unit in faction by clicking on them. This is built in to BP_Ability_MoveAttack, but Iā€™m having trouble finding it so that I can copy it over to BP_Ability_Move, as thatā€™s my default ability for units.

Currently, nothing happens when you click one of your own units using BP_Ability_Move (it just assumes the square is invalid). Would love to know how you did this with MoveAttack.

Thanks!

If you have time, your help on this would also be much appreciated, otherwise hopefully we can take a crack at it another day. Thanks :slight_smile:

  1. Selecting multiple Units to be able to attack together/add their damage together for a single attack. This is also a case where range isnā€™t an issue, the Units only need to be able to attack adjacent enemies and adjacent corner objects.

Unit switching functionality is built-in as the ā€œDefault Clickā€ function in BP_Ability. Call DefaultClick from your ability when you click a friendly unit and it should work.

Iā€™ve given this one a go no. I threw together a basic implementation that should hopefully be enough to get you started. Here it is in action:


I created a new ability that is a child of BP_AbilityBase for this. For testing Iā€™m activating it through the player controller (as well as hiding the current active unit marker):


The rest is done within the ability. Whenever I click a unit owned by the active player I spawn a marker on it and add a reference to the unit and the marker in a TMap. When I click a unit already in the map I remove it from the map and delete the marker. When I click a unit not owned by the active player I deal damage and queue attack actions from all units in the TMap, the action being handled within this ability.

Here is a link to the pastebin. It could be better organized as I kept everything in the event graph to make it possible to link as a single pastebin.

Hope this is enough to get you started.

Hey , currently attacks are only processed when clicking directly on the ground tile - I was figuring out how you can redirect the click event from the clicked actor/unit mesh to the tile.
It Seems to work for now - but I was wondering wether this is a legit solution for this case?

Added a custom click notification event to BP_Ability_Attack that communicates the grid index of the clicked unit to the event ServerInteract.


And in the BP_Unit (in our case the character which is a child of the unit) I added this logic to find out wether we clicked on an enemy during a user controlled playerā€™s turn.