[SUPPORT] Advanced Turn Based Tile Toolkit

ATBTT is now updated to allow for creating 4.17 projects without conversions. No changes had to be made for this update, so if you’re working with a 4.16 version with your own additions, just convert it directly to 4.17 and you should be fine.

@: Thanks a lot for your help! I have set it up like your example but i have still the same issue i had before, that my char jumps on the first move to an undefinded location. From there he is moving “correctly” but he’s ignoring the grid. He is only moving inside the positiv range along the X and Y Axis and Z = 0 ,from the world location.(marked area on the image) When he’s rotating to a new direction, he’s not rotating in place, he first “spawns” a small step back and than continues to move to the desired location. I’m using a duplicate of the Unit_Player_Melee (renamed to MyPlayer) for testing purposes.

@AceD: Hmm, I’m guessing your grid manager might not be placed at location 0,0,0? I have not corrected for the location of the grid manager in the nodes posted above, so if this is the case I would either add the location of the grid manager to all places where you set a location or move the grid manager to 0,0,0. If this doesn’t work, let me know and I’ll figure out what went wrong in the translation from my project to yours.

@: Ok, i figured out what was wrong. You were right, the grid manager wasn’t at 0,0,0. So i changed that. But i also noticed that after placing my character on the grid, i have to make sure, that the pivot is centered to the actor.

The pivot issue seemed odd, so I looked into it. Just realized that by changing the game mode, the grid manager is never activated, which means the function for recentering all units is never called. Go to the grid manager’s event graph and swap the Activate Grid Manager event for Event Begin Play to fix this. Also, here are some changes to the unit event graph that I sent in the last post to make the movement independent of the grid manager’s transform and to update the pawn array appropriately:

Thanks for update! It’s working, but when i stop the game, i am receiving Error/Warnings and i have no clue what they mean:

@AceD: That’s odd. I didn’t get any such errors. All the errors seem to stem from the same isue (the MyPlayer blueprint not having its reference to the grid manager set up correctly). However, without a working reference to the grid manager the movement should not work at all, as it gets the location vectors from the VectorField array in the grid manager. I guess this might happen at the first tick of gameplay, with the reference being set up later in the same tick. The grid manager reference is by default set in the construction script of the unit blueprint, though, which should predate anything happening during gameplay. You are basing the MyPlayer blueprint on the Unit_Player_Melee blueprint, right? Have you deleted anything from this blueprint or made any modifications other than the ones I’ve suggested?

Yeah the errors have no influence to the gameplay though… Or not that i have noticed it so far. I receive the errors first when moving my character. Not when i start and stop the game without any action. MyPlayer is based on the Unit_Player_Melee, yes. I removed the AttackVictim_1 and DestroyUnit Custom Events and disabled the Event Move Timeline Update Func. Inside the Unit_BP i removed only the “set up the Health Bar” part in the construction script. In the Event Graph i deleted the Attack Victim, Receive Damage and Kill Unit parts and disconnected the other events, which shouldn’t be a problem if i’m not mistaken cause the are all not needed for the WASD-movement.

Hey there, I can’t recall if this was covered in one of your video tutorials already, but is there a way to programmatically change a tile from passable to impassable in blueprints, and can we programatically place thin walls and thick walls from blueprints. I’m mucking around with procedural map generation in Paper2D and wanted to know if there was a way to setup a grid manager to match my procedural layout data. Thanks!

ok, hard to know what the cause might be. I would double check that the reference is set up correctly in the construction script. It should be right after setting up the health bar. You are not setting its value yourself anywhere?

There are a few ways you cann do this. Firstly you can leverage ATBTT’s procedural grid generation by setting TraceForWalls to true in the grid manager public variables and have your procedural algorithm place meshes (or invisible collision boxes) that block the WallTrace trace channel. If you generate your map before the grid manager is activated, then this will work even for things that were not placed in the viewport by hand. Another way is to use the MakeTileImpassable and RemoveEdgeBothWays functions, which respectively remove all edges from a tile and that removes a specified edge. Passability between tiles is decided by the EdgeArray and EdgeArrayInteger arrays. EdgeArrayInteger stores an array for each tile index which determines what tiles can be moved to from that tile. The EdgeArray does the same, but also stores the movement cost. Check the RemoveEdge and AddEdge functions in BP_GridManager to see how to manipulate these arrays appropriately. One thing to remember is that you should never alter just one of these arrays, but modify them both in the same way any time you alter anything.

Ok i found the issue. When i had rebuild the changes you made to the Unit, i somehow created a new Grid_Manager_Ref inside this Unit, who were connected with the pawn array and vector field array. I deleted them and connected it with the original Grid_manager_Ref. Now it’s working without errors!

Been playing around with using this system as the basis for a VR game now I own a rift and boy does it (mostly) work well!

https://puu.sh/xiKwH/2cc949c8ac.gif

ah, yes that makes sense. I tried to understand how you could get errors trying to access an empty reference, while at the same time that reference was accessed without issue in another part of the graph. There being two different reference variables solves that problem :stuck_out_tongue: Glad it works without errors now.

Looks awesome! I’ve been meaning to add Unreal’s default VR movement to my VR example map, like you have in the video. Happy to see someone is using the VR features of the toolkit :slight_smile: I own a Vive and want more VR TBS games!

Hi guys I’m trying to add a custom menu using a widget and a new hud class I can get it to show the menu when I press play the level loads but I have no control over any character has anyone else set up menu if so what where your settings ? Cheers

Hi there! Loading levels should work out of the box. Check if this very simple setup works: Create a new, empty map. In the level blueprint add an input event that triggers loading the default example map, like so:


Check if this works, just as a starting point. Then replace with your custom map and see if the issue persists. This is a problem that occurs only when you load a map, and not when that map is the starting map, correct?

Hi , where is multiplayer? We talked about it in may, you said a “A couple of months”. Where is this great update?

Hello yep I got it I shouldn’t try to do things when I’m tired but this is to addictive ha ha. I’m looking to put a round timer in I’m using the sci-fi mode not sure if anyone has done this but my thinking was to give each player 30 seconds a turn and have a total round time of say 10 mins have it displayed on the view port. If anyone has an idea where to start with this please let me Know.
cheers
P.s thanks for your help appreciate it

Hello again !

New questions incoming :

  1. Can you have two grids on a same map overlaying each other. (One type of units will see/snap to and use their own grid and second type of units will use their grid? Can they interact properly in this case?)

  2. In Bp_Camera_grid , you have a Get All actors of class node in Event tick. Unreal documentation says that it is a very slow node that should not be used every tick. This might be a performance issue when a project gets more beefy. What do you think?

Best Regards
Malokai

Hey, good day. I have a small question.
I place destructible meshes on map and they work fine - they can be destroyed by grenade blasts and block line of sight. However, as pawns can not shoot through these objects, they can simply move through them. Tiles appear blocked for shooting LoS (and block everything behind these meshes), but they are not blocked for movement.
Though destructible meshes block shooting, they also do not grant cover.
My “move” and “shoot” skills use almost identical pathfinding structure (based on your skills) and I can not find the difference or the problem. Did I miss something?

Ideally, I would like to have a cover system of blocks that can be destroyed by shots and blasts, so if you have any better idea on how to do this I would gladly hear it.

After trying for many hours how to use this plugin for my game I have few conclusions that maybe will make it better.
First of all it would be nice to have separate forum. It is almost impossible to find anything here.
Second thing. Would be really nice to focus more on grid functionality than other functions that most people wont use. For exapmple (in my case), its good to know how to make laser shooting in a game but I don’t really need it. On the other hand, I am trying 3rd day in a row to make AI unit move to a specific tile if unit is damaged and I get only two results: unit is going to that tile but ignores that it has no action points to reach that tile in one turn or it goes out of the map. Such thing as moving unit to a specific tile should be highest priority to have in this plugin and it should be simple to use and setup. I watched all movies that you submitted and still don’t understand all to be able to make units move to a tiles that are few turns away. Most games need that functionality if not all.
Another example would be that one cant use for example only grid map in game because it is hardcoded to reference other things that I dont need to change like game mode, camera and others. Why I cant use only nicely ordered hexes and have to change code everytime I start new project?
Otherwise it is really good plugin and I hope it will be improved even more but like I said - made more universal and more focused on grid functionality because other things are game specific anyway. For example by adding Before Enter Tile (with ability to cancel move or choose action) and After Enter Tile events.

Edit: One small thing. In game mode-> event begin play, script checks if game camera is spawned. If it is, it resets rotation and location to default values. It could be added that it does so only if follow unit is enabled (or remove it entirely) - in my case I rotated camera in editor, disabled following units and then had to look why in game it is pointing in other direction than I set up in editor :slight_smile:
Also for some reason AI units still are attacking with 0 move even when I disable it in unit options (I am using basic example not skill one).

Edit2: I don’t know if that two problems are not related (AI unit that is going few turns at once and attacking with 0 move when it shoudnt) - maybe somewhere AI controller is not updating current move variable? I have no clue if it is the case and how to fix this. But I found that while checking if it should attack it still had max current move like it was not moving at all. Hope it helps.

Edit3: I managed to solve somehow to force AI to move to a specific tile when it is damaged but it is more a hack than a solution since I don’t understand what I actually did. I used Find path to tile in range in AI controller to move close to a destination and then I checked if distance is close enough and used Find path within pathfinding array before initializing movement. I can’t use Find path to tile in range only because unit stops one tile before destination and dont want to enter there(when I set range to 1) and when I set to 0 then it goes out of the map. Whem I use Find path within pathfinding array only - units goes directly to destination tile in one turn without checking if it isnt too far. It could be useful to have Find path to tile (without checking range). Or maybe it is already there and I don’t know where.
Sorry for too long post but maybe someone had similar problems so I posted what I found.