[SUPPORT] Advanced Turn Based Tile Toolkit

You figured it out on your own again before I got back to you :slight_smile: I’ve tried to find the sweet spot for the default decal size where the decals will still fill the ground on fairly steep inclines and still not bleed over to meshes above or below in most cases. If your game does not have steep inclines you can experiment with reducing the x scale further.

I did experiment with some different ways of doing this when I first implemented multi-level grids. With the current setup tiles that are on a higher level grid-wise (meaning that there are more tiles directly below it) can potentially be lower in-game than tiles that have fewer tiles below them. For your suggestion to work you cannot look at a tile’s grid index, but instead at the actual height of the tile in-game. I’ve tested this out and have a solution below that will hopefully achieve the result you are after.

First make the following changes to VectorToIndex3D (changes highlighted). This will return whatever grid index is closest in height to the location inputted by checking all possibilities. Slightly less efficient than the default implementation since it does not break out (can be improved), but does the job.


Now with those changes made we need to change the value we input. In the GetHitTileLocationAndIndex, instead of getting the z location of the hit location of the mouse, we use a custom height variable. This is the one we want to adjust with PageUp/Down. With this solution we can still hover on click on tiles that are far away from CurrentLevelHeight if there are no good, close, candidates. You can always add a branch comparing the height of the outputted index to CurrentLevelHeight if you want to prevent this.


Lastly, we want to skip the following branch in ATBTT_PlayerController in Display path on hover:


Hope that gives you the result you want.

I was poking around in collision settings on my mesh and couldn’t find anything for RangeTrace or WallTrace, are these in one of your actors? I’ve been using the HA_Wall as the actor for all of my architecture. Not sure if that’s the best thing to use or not though.

Also, is the SciFi gamemode standalone, or does it rely on the main ATBTT gamemode? I’m sure most people are using the SciFi one since it has a cover system and stuff, but I don’t see cover in the main mode.

@Axebeard: They should be in the collision settings for the mesh of the actor you are inspecting. Do you see the usual collision channels, but just not the custom ones? If so, might you have altered the default config files of the project in some way?

The scifi versions of blueprints are all child blueprints of the regular ones. If you open a blueprint you will see what blueprint/C++ class is its parent at the top right hand side.

Hello , I am changing markers(Meshes) using the sci_fi grid manager with hexes, all are working except the hover tile, the stock hover marker is showing with the path, and my custom marker stays stuck at 0,0 on map…do you have any idea what I might have messed up…or am I missing something ?

Hi!

First of all, thanks for your work on the toolkit, it’s been amazingly helpful! I am developing a project with a Fallout-style action point system for moving, shooting etc. I got it working almost as intended, but ran into a couple of problems:

  1. AI turns lead to a loop where the pawn runs a set amount and spawns back to the starting points, runs again and spawns back, etc. Output log shows an error, which leads to me thinking that the array of move choice candidates is not being generated correctly, but I can’t find the reason for this. Any ideas where to start poking around? Most of the pathfinding functions seem to use the pawns current move variable, which I’ve been replacing with the current action points variable, but I’m not sure if it’s the right way to go.

LogScriptCore: Warning: Script Msg: Attempted to access index -1 from array ā€˜Move Choice Candidates’ of length 1 in ā€˜/Game/AdvancedTurnBasedTileToolkit/Blueprints/Gameplay/BP_Grid_Manager.BP_Grid_Manager_C:Decide the final target from viable options’!

  1. The game deducts one action point if the pawn attempts something without having enough AP. For example firing a shot when the AP cost is too high leads to the skill deactivating correctly but the pawn is left with one less AP regardless. I can’t seem to find the right spot for the fix.

Edit: Got the second issue solved, removed the ap cost from the skills and replaced them with my own ap cost calculations.
Any help is much appreciated!

@: For the skills, the target marker is individually defined withing each skill. Go to Skill_Move and change SkillMarkerMesh to whatever you want to use.

Thanks , I didn’t even notice that…I am also using custom skills…All fixed up, Thank you. All the best in the new year to you !

Easy to miss :slight_smile: All the best to you as well. Here’s to another year of productive game development!

@ : Any clue on where to begin solving this issue? I’m pretty stumped over here. It seems that at least the with the scifi game mode the AI doesn’t work with more than two action points. I’ve found that it does the run-spawn loop until it has just one action point left, but I can’t find where I should begin modifying to get it to work correctly.

Hello , A few more questions then I can leave you alone…( I hope), how do you start the pawns in jungle raid "awake, and second I need to call a function after the last player pawns turn, where is the best place to do that ?

Thanks for rundown! As you said, I was easily able to connect the tiles via AddEdge, but getting the unit to animate properly is turning into more of a task.

I’ve played around with two methods for the animation part:

A) When a unit arrives at a tile that has a ladder, I have the unit temporarily break off from the movement spline and travel along a custom spline that I’ve added to the ladder’s actor. At the same time I trigger an animation on the unit’s AnimationBP, but I’m having trouble timing that animation with the unit’s overall movement along the spline.

or

B) When the unit arrives at a time with a ladder, I have the unit break off from the movement spline and trigger the climbing animation with root motion turned on. However, this doesn’t work because Pawns don’t process root motion, at least not in the way that the Character class does.

My preference is to use option B because that should give me more natural looking movement. So I guess my question is, how big of a task would it be for me to convert ATBTT from using the Pawn class for units to the Character class? Is there anything major you foresee I would break if I did this?

EDIT: I went ahead and switched the parent Unit class to inherit from Character and it works fine. I had to make a few decisions about what to do with all the inherited components, but there wasn’t anything I had to change in the blueprints, so that’s good. Now I have my units using root motion animations to climb up ladders and vault over cover. So that’s nice.

Sorry for the late answer, Haukifile. You must have postet it while I was writing my answer to , so I did not see it.

The error reported is inconsequential. I have fixed this error in my internal build already, but it is not something that should cause any issues. The movement issue you are seeing must be caused by something else.

I’m guessin the problem might lie in the movement nodes in the Unit blueprint. Either in Decide whether to Move or to Stop or in Accelerate and Move Pawn along Spline. I believe it is likely that after reaching the end of the spline, the unit loops back to the beginning instead of ending movement. Check the branches here and see if it the movement end conditions are ever met. This is as far as I can go from the information you have given me. Start searching there and come back to me with your findings if you cannot solve it.

Don’t worry about asking too many questions, . I’m happy to help :slight_smile:

Awake/not awake units in the JungleRaid map are set up by modifying the SortPawnsInInitiativeOrder, which you can see in the event graph of ATBTT_GaemMode_SciFi. Here I add units to initiative only if they are of the player faction. You can change the requirements by altering the condition on the branch there.

For your second question, I would do this in ATBTT_GameMode early in the ChooseNextPawn event. Compare the faction of CurrentPawn to the faction at index 1 of InitiativeOrder (the next unit). If the CurrentPawn has faction Player and this is different than the faction of InitiativeOrder[1], run your function.

Thanks for the answers , With the enemy units awake your answer to my second question will work, if the enemy is not awake the compare factions will not work because it loops back to player units after the last player pawn, so I am gonna wake everyone !..besides if you are at war you should not be sleeping ! I’m just experimenting for now waiting for your next update, how is that going for you? any way thanks again for your help.

@: Yeah, my suggestion does not work if the initiative order array only contains one faction, but there are other things you can do. At the end of each unit turn I set its exhausted variable to true. When a new unit is activated I check if exhausted is true for this unit. If it is, I then set exhausted for all units to false and increase the turn counter by one, which signals the start of a new turn. You could exploit this, by adding to the condition I explained in my last post. So if the faction of the current unit is different from the next OR the next unit has exhausted set to true, run your function.

As for progress on the update, I’m in the last grueling stage of bug fixing, commenting, testing and reimplementation of things like VR and touch controls. You can follow my progress on [my trello]( if you’re interested. The update is more or less finished, and I have run successful multiplayer tests over Steam, but testing and bug fixing takes more time each time I add a new feature. It is close, but the exact time remaining is hard to predict, as I do not know how many issues I will encounter, and thus have to spend time fixing.

Thanks for the info, but I didn’t manage to solve it. You can replicate the issue easily by giving the AI more than 2 action points, at which point it begins looping until is down to 1 AP (at least most of the time). I am going to have to do a major AI rewrite regardless since the weapon system is very different, so I’m going to continue tweaking with it. If you have any ideas on where to start solving the AI move issue, I’ll appreciate help since it allows me to concentrate on other issues, such as getting the AI logic to a point where it can use the weapons as well.

@ Can you tell me where AI movement is handled in the Scifi game mode? I’ve tried debugging the movement issue by setting breakpoints in Skill_move, but it never breaks on AI turns. I’ve found that with > 2 action points available the AI starts its run-loop while in the skill-evaluation loop in the Scifi AI Controller, but I can’t seem to pinpoint the place where movement is handled.

@ fantastic addon/Template! holy cow mate you have opened my eyes! I know basically nothing about UE4 so this has been an exciting purchase. keep it up!!

@Haukifile: I never did any testing of units with more than 2 actions points in the SciFi example map when I made the previous version, so I’m not surprised that there are some issues. The example map was made to emulate an XCOM-style game, where they have only two actions, and I used the label Action Points to be able to expand upon in the future. In the WIP version multiple APs for AI works, but I have changed it so heavily that I cannot immediately say what you need to change in order to have the AI correctly use >2 AP in the current version. I will look into it, though.

As for where movement is handled in the SciFi map, that is within each individual skill. Each skill includes calculating movement for the AI, in order for it to determine the best tile in move range to use a skill from. Thus, you want to add break points to the specific skill the AI is using (laser, grenade etc.). The move skill is only used by the AI its enemies as so far away that it cannot reach them with any other skills.

@Stormoffires: I’m happy to hear your first impressions are good! I’ve tried to make the toolkit as easy to understand as possible, through comments and my tutorials, but the scope of the toolkit means it is still pretty complex and can take time to understand fully. If you are new to UE4 I recommend going through Epic’s official blueprint tutorials before moving on to working with the toolkit. I hope it helps you make a great game :slight_smile:

Hi all! I’ve integrated this great system into a game I’m workikng on. This game up to this point has been using ā€˜SimpleMoveTo’ to move the player and AI around the map. My goal is to utilize ATBTT for combat, and utilize simple move functions like ā€˜SimpleMoveTo’ for navigating cities and such when not in combat.

To merge my game and ATBTT I created a new project specifically for ATBTT and migrated my blueprints into that project thinking I would have an easier time acclimating my blueprints to whatever environment is setup by ATBTT. Unfortunately now I can’t get any of my AI or Player’s to move using blueprints utilizing Simple Move. Even if I replace the Game Mode and player controller with my versions, and replace the Units with my Player and NPC pawns so no ATBTT blueprints are factored in. I have of course made sure there is a nav mesh (cause I know the grid doesn’t generate one by default) and still my home brewed stuff just won’t work in this environment even if I’m not using any of the blueprints for ATBTT.

I’ve also ensured that any mouse click inputs in my blueprints now are looking for the inputs set for ATBTT. My pawns appear to be getting the orders to move, and the coordinates of where to move they just don’t. They report the error. Warning 'SimpleMove failed for ATBTT_PlayerController_C_7: movement not allowed’

Is there a project or world setting that is preventing my characters from moving now? Any insight into this would help.

UPDATE:

I figured it out. The camera is auto possessing pawns making it impossible to possess the pawn after that… apparently. This seemed odd and I’m delving into further but disabling auto possess fixes this. Of course this breaks the camera but I’m sure I can find a way to make this work without the camera auto possessing.

An update for everyone waiting for the next ATBTT version. The next version will be released when UE4.19 (which just got its first preview) is released. The update is far enough along that I’m confident it will be ready by then. That means that for anyone who has spent a lot of time working with the current version and do not want to convert their project, the curent version will always be available through the launcher with the 4.18 version of UE4. Converting this version to 4.19 seems to work flawlessly, but if there are any conversion issues for future updates I will do my best to resolve them.