[SUPPORT] Advanced Turn Based Tile Toolkit

Hi, .
I’ve been speaking with you in the comments of some of your videos but I am currently working on an Idea for a dungeon crawler similar to your 2D game example.
However I wanted to implement an action points system where both movement and skill use are drawing from the same ‘stamina’ pool. So if a player decides to spend an entire turn on using abilities he can do, the Idea being that you will be a lone hero attacking a dungeon so you will be outnumbered at all times so you must combo your skill and use them effectively in order to do well.
I am using max move and current move variables in the unit parent to base this off and currently have it working so the game checks that you have more action points than the attack cost cost in that i added to the blueprint.
Ive intended the attack cost and range to change depending on what skill is selected.
Right now what i’m really unsure about is how to allow characters to attack multiple times and how to allow them to move after a skill has been cast. I realise that currently you have it set like Xcom where attacking ends that units turn whereas I would like it to be free flowing.
The other thing I need to ask about is how to implement skills, as far as the effect of skills such as dealing damage or stunning/slowing units goes then I believe i have that figured out its just getting the initial blueprints for the skills set up that I am confused about.

Glad you figured it out! That is indeed a strange glitch and I’m able to replicate it. I’m glad you found it so I’ll be able to fix it. Since the enemy units considered the player units to be their allies they skipped their turn. Sometimes I feel a bit bad for fixing a bug that causes units to be humane and not kill each other. Guess I’ve been watching too much Westworld :stuck_out_tongue:

Ok, after a bit of toying around I’ve come up with something that works. I’ve created a new child actor based on Tile_Parent which has the following construction script:

Since construction scripts are run when an actor is spawned in game we do not have to use a separate function in game as long as the construction script is set up with that in mind (which it is :slight_smile: ).

Here is a quick way to test out if it works during gameplay:

Let me know if it works (does on my end)

dnHgy1N.png

Glad my suffering could help you and others who come across the glitch. Haha. At least, “no player units were harmed in the making of this glitch.” :wink:

You sir, are amazing! Works Perfectly! (I did customize it a bit for my needs so that I can override (turn off) the offset if needed.) And Now I don’t need to tell them to be offset manually. It is awesome.

By the way, I love the name you gave your tile! :smiley: :cool:

Glad it works as you wanted it too! I usually name temporary projects and objects after the usernames of the people I’m helping out :slight_smile:

Tackling this issue got me thinking some more and I played around with a different way of achieving the same result. ATBTT uses two different methods for generating a walkability grid; one of them is manual by modifying edges directly, while the other one is procedural using line traces. I’ve become more and more a fan of the second method myself so I tried my hand at setting up a similar system using line traces. In the process I discovered a bug in my Trace for Walls function that causes the toolkit to ignore some walls in cases where there were multiple walls surrounding one tile. Here is the updated version, which will be included in the next update (a new trace channel, wall trace and a new public float, Trace for Walls height are added here as well):

This version needs to be set up like so in the event graph and construction scripts of BP_GridManager to work properly at startup:

Enabling Trace for Walls in BP_GridManager and setting Trace for Walls Height to something appropriate for your game (100 unreal units seems to work pretty well for the default toolkit) allows the toolkit to procedurally search for walls at startup and remove edges from any tiles surrounded by such walls. As such you would not need to program any functionality for modifying the edge array in your custom wall objects for them to block movement, and it would work for walls set in any direction. For spawning walls in game you could similarly spawn a very simple actor containing just a mesh that blocks WallTrace and then run the Trace for Walls function for that specific tile index and it should work instantly.

It is worth noting that this is a pretty costly operation, so I would not do this to a very large amount of tiles at the same time during gameplay. I would also check pregenerate gameplay grids before packaging the final build to cut down loading time.

This might not be the ideal solution for you, but it is perhaps the solution I would have used myself. This way you will not need to create a lot of different functions for various types of walls and buildings with various shapes and orientations, provided you keep the Trace for Walls function in mind when designing your meshes and levels.

Hi !

I have a question for you: I’m currently using an amazing plugin for UE4 that allows me to procedurally generate a dungeon at play time (specifically in the begin play event).
My question is: is it possible somehow to spawn the grid manager TileByTile and calculate the Grid X and Grid Y ad the end of the level building process without spawn the entire grid manager somewhere?

Hello Wisom-! I assume Dungeon Architect is what you are using? It is certainly an impressive piece of kit and I think it should work really well together with ATBTT. I was actually working on a dungeon generator as a side project a while back, but scrapped it once I saw Dungeon Architect. I don’t understand everything in you question (spawning the gird manager tile by tile), but I’ll tell you what I would do if I wanted to get ATBTT and Dungeon Architect working together.

I would run the dungeon generation code before activating any nodes in BP_GridManager. Then in BP_GridManager at the very beginning (of the construction script or the event graph depending on you want to pregenerate dungeons or not) I would calculate the bounds of the generated dungeon (I don’t know enough about Dungeon Architect to say what would be the best way of finding this) and set GridSizeX, GridSizeY and the heightmap cutoff point (unless you want a flat dungeon) as well as the location of the grid manager based on these bounds. Basically GridSize X would be the size of the dungeon bounds along the X axis divided by the width of your tiles. You would of course also need to set DungeonArchitect and the grid manager up so that they use grid squares of identical size.

You would have to make sure that only meshes you intend the player to walk on block PathTrace and that any meshes you do not want units to attack through block RangeTrace. I would change the Trace for Walls functions to the way it is set up in my previous post, including adding a new WallTrace channel that should be blocked by any meshes you do not want units to walk through.

At this point you should enable line trace based heightmap generation in the public variables of BP_GridManager, check Trace for Walls and ATBTT should hopefully be able to procedurally build a walkable grid on top of any dungeon Dungeon Architect can generate. This should even work for dungeons with an arbitrary number of overlapping levels, thanks to my line trace based heightmap generation.

I’ve wanted to test this out myself for some time, so let me know how it works out!

Thanks for your reply!

I already use your incredibile toolkit together with Dungeon Architect (sorry for being mysterious on the plugin name but before you mentioned it directly I didn’t intend to set any unrequired advertisement on your support topic) and as you suggest the “Trace for Walls” function was the key to make them working fine together.
You got the point: I actually create the dungeon in the viewport by using “Build Dungeon” and then drag the BP_GridManager inside the level, but I want instead to build dungeon using a different and random seed every time I push play.

So, my hope was that I could spawn a Tile_Parent tile together with Dungeon’s Architect “ground” marker, overlapping them, and then, after all tiles have been placed, the grid manager somehow could auto-calculate the position, rotation, GridSizeX, GridSizeY and the heightmap starting from his tiles position.

But with the last reply you pointed me out to a different approach, which probably is the most correct one. So I asked directly to the Dungeon Architect plugin owner how to get the max size X and Y of the dungeon.
In this way I should be able to spawn the grid manager at runtime.

Thanks again for your precious reply.

Great, I hope it works out :slight_smile: I’m sure Ali will give you an easy way to find the bounds of the dungeon, but if not I’m sure I can think up a solution.

Using placed tile actors was the only way to create ATBTT maps in the early versions, but these days you do not really have to place a single tile actor. As long as you place your meshes with the grid in mind and set up collision correctly you can just use regular placed meshes and landscapes, place and resize the grid manager appropriately and let it do the work for you. This is definitely the way I would go if working with Dungeon Architect.

HEY !

I’ve been working with the ATBTT for the past month or so and I’ve been able to do pretty much everything one way or another. But. Right now i just hit a wall.

I need to stop my unit midway trough movement. I have trigger box triggering dialogues or pop-up boxes but the units need to stop AS SOON as they enter the trigger box. right now you can click somewhere and your unit will move where you click even while a dialogue box is up on screen. I tried calling the End Movement event in unit parent with no success.(units will stop the animation but not the ACTUAL moving)I tried reducing the spline length to 0, no good here either. I tried a lot of simple thing again to no success. So before I go and add my trigger boxes to the grid manager and have the units stop the path finding when a trigger is met, I’d like to know if someone found a solution or perhaps as an idea I have yet to try.

Hey , love the toolkit and really appreciate the ongoing support. I’m trying to figure out if I should do the cover system engineering myself or wait for your update. I know you don’t want to give a timeline but are we talking about about a double digit number of months?
Not that I really expect or demand an update :slight_smile: I’ve already got way more value out of the toolkit than I had possibly hoped! If you are going to GDC let me know and I’ll buy you a beer.

Hey Jiyko, I think it is a very fair question and though I will not give an estimate for the reasons I have mentioned I’ll try to give you a better idea of how far off I am. It will certainly not be in a double digit number of months and I have completed most of what I want in the update. I think probably the best I can do is to list what I have made so far and what I intend to add before the update is done.

What I have:

  • Cover system, including accuracy and dodge
  • modular skill system including the sample skills Fire Laser, Overwatch, Heal, Explosive Shot, Sprint and Mind Control.
  • advanced AI built into the skill system where the AI decides the best skill of all availible depending on the situation. Added for Fire Laser, Overwatch, Sprint and Explosive Shot.
  • Basic VR support with a simple VR level
  • Added several awesome creative common meshes for example games, including environments, units and weapons. Skeletal meshes have been rigged by u/Bankworthy.

Left to do:

  • Make a good looking example level demonstrating the cover and skill system, using the mentioned creative commons assets.
  • Adding a few common features to the VR level, including teleportation.
  • Extensive testing and bug fixing of the new features.

I hope that gives you a general idea. I have far less remaining than I have done, and I will try to stop myself from coming up with new features to add (and especially my recurring urge to reinvent something I’ve already made :stuck_out_tongue: ). If you want to have use my cover system before then I’ve detailed the method I used in a post here. Afraid it will be difficult to make it to Cali and GDC this March, but thanks for the offer! I’ll be enjoying the icy winds of Norway’s west coast instead.

How do you find the get node that has an array of indexes as the output. The only Get node I have access to gets the individual item, but not index array.

Edit: I just figured it out! You right click the item pin and select “split the struct pin.”

Also, for your new trace channel: WallTrace. In your project details what did you set the default response to be?

Shouldn’t the outward event pin be connected to completed? Other wise it is going to go through the rest of the construction script and event graph events until finished.

Oops, you are right about the wrong pin connections there. Rookie mistake :stuck_out_tongue:

I’ve set WallTrace to block by default. Generally I feel there is generally more stuff that you do not want units to be able to move through than the opposite, so I think it makes sense as a default. You should configure the defaults so that commonly movable stuff such as pawns, vehicles etc. ignore this trace. You could probably also just use PathTrace or RangeTrace for walls, though if you used PathTrace it would not be possible to click “through” any such tiles and click the tile behind the wall. Also, not using RangeTrace gives you flexibility in case you want walls that can be attacked through, but not moved through (windows, maybe) or the opposite (thick fog).

Hi ,
I’ve been working on an accuracy system, currently it multiplies the number of tiles distance by an accuracy cost (currently 3.5) and subtracts it from a base accuracy value that is a customizable attribute of each pawn. Ive contained all of this in a function in the ATBTT_player_controller blueprint because It contained all of the variables that I needed within the function.
However I intended to use the function in Unit_Parent just during attack victim just before Receive damage, If it true then it does damage if not It minuses the damage value from itself and runs that into recieve damage, so damage is done.
The issue i’m having is when I call the function in Unit_Parent I need a reference to it, I created a reference but when I run it in game every shot misses and every time I try to take a shot I get this error;
Error Blueprint Runtime Error: Accessed None trying to read property ATBTT Player Controller Ref from function: ‘ExecuteUbergraph_Unit_Parent’ from node: Accuracy Calculation in graph: EventGraph in object: Unit_Parent with description: Accessed None trying to read property ATBTT Player Controller Ref

Its probably a rookie mistake as I am quite new to blueprints but any help you could offer would be amazing. If you need to see my blueprint then I can take a few screenshots if its neccsary.
Thanks

Hello Gojiberries,

you are probably just not accessing the reference in the right way. Could you show me a screenshot of the part of the event graph of Unit_Parent where you are accessing the player controller?

Hey ,
Here is the Unit parent Graph, thanks for getting back so quick.
Regards,
G

Hi Gojiberries,

I ran into a problem similar to this where it wouldn’t recognize my player controller ref that I had created in the Unit_Parent’s event begin play. When setting up the reference, I was trying to use find all actors of class and then get the actor with index 0. However, you should instead get player controller and cast it to the ATBTT Player Controller then set the reference from the cast node. Only after changing it to this, did my reference work. Hope this helps.

I would be interested in seeing the blueprints for your Accuracy Calculation event in your Player controller, if at all possible. If not, that’s fine. :slight_smile:

Hey Mewbits,
Thanks for the response, Ive added what you said in and use the get player controller function and cast it to ATBTT_Playercontroller just wondering If i need to have an index going into the player controller function?
I’m happy to show you the accuracy calc I did get some help from someone with a cover system some parts of the accuracy and would not have anything close to this without his help, but I have reworked some things things myself, It’s not finished yet as I need to add in some extra stuff in as right now it’s just down to that pawns attribute values but i’m working on having the pawns equip weapons and have those weapons affect accuracy eg.pistols having a higher accuracy cost for distance and having each weapon have its own base accuracy stat.
Ill try and do what you suggested however i am still a bit confused when it comes to so of the blueprint functionality.


Thanks Gojiberries,
Index 0 should be fine so long as it is not a multi-player game.

@ I finally got around to taking another look at moving multiple units simultaneously. Your original example works just fine, I messed up some of the connections, but it looks like it’s all good now. I’ll let you know if it causes any issues later down the line.