Great Let me know if you run into any other issues.
Awesome to see the evaluation bug fixed! Whats the easiest way to implement that code? Iāve fixed it on my end but curious how it was fixed in the latest. Iām still on 2.4.
clearly im doing something wrong i cant get the name the same you did in this post. as you said display name just gives me the bp_anim
Hi Luna, good to see you again. Here is what you need to add:
https://i.imgur.com/jEktW8C.png
The name variable is defined in BP_Unit, which is a child of AACtor. OwningActor is of the AActor class, and thus does not have direct access to that variable. If the OwningActor is of class BP_Unit (which it always should be by default for BP_Ability and its children) you can cast the actor to BP_Unit to be able to access the variable. However, since this is something you often need to do a lot inside abilities I already do so and cache the result in OwningUnit when the ability is activated. So you can use the OwningUnit reference instead of OwningActor to access the variable. I recommend checking out some general blueprint tutorials on blueprint communications, references and casting.
I find that players walk through stairs as if they werenāt there. Iāve got to be missing a setting. Does anyone have any ideas?
Does the stair mesh have working collision geometry, has collision enabled and is blocking the PathTrace collision channel? It is probably one of those three things.
Edit: Also, the Heightmap setting for BP_GridManager cannot be set to false if you want height differences between tiles.
All of the above look OK so there must be something fundamental that Iām missing. Thanks
Hmm, that is odd. A few things you can check: Import the mesh insto something like Epicās third person template and see that collision is working fine there. If that works try firing some debug line traces through the mesh and see if they are blocked. You can similarly enable debug displays for the traces used for generating the heightmap in ATBTT (the appropriate nested function in SetEdgesBasedOnTerrain in BP_GridManager) to see if they are blocked. Also, these stairs are placed in the level beforehand, right? If you spawn it during gameplay the walkability will not update unless you do so manually.
Hello and thank you for your amazing work! The toolkit is just great.
I am trying to implement a combat system like the one thatās in Divinity Original Sin 2, so:
- thereās no grid, but actors move freely
- every action costs action points - be it moving or attacking
- the turn sequence is based on individuals and not teams
- the turn based combat begins on triggers (as I saw in your hybrid example)
Can you please point me in the right direction? What are the blueprints that I need to modify for these customizations?
Thank you in advance!
Hi emmedand, Iām happy to hear that youāre enjoying the toolkit! Divinity Original SIn 2 is one of my favorites as well. Iāll do my best to answer your questions.
Ok, so this is the most difficult one by far. The toolkit is built on an assumption that your game is grid based. There are things you can do to use ATBTT as a starting point and go in this direction, by modifying abilities to make use of the clicked location instead of the clicked tile, replacing RunPathfinding calls etc. with navmesh based approaches ++, but it would be a massive alteration of the toolkit. Iām not sure I can with good conscience recommend using the toolkit for a game not based on a grid. There are things you can do to disguise the grid. You can use a terrain actor instead of tile meshes to represent the world, remove grid indicators like the hover marker etc., but the game would still be grid based underneath. I hope this is still acceptable for your game.
This boils down to how you design your abilities. As a starting point, make a duplicate of BP_MoveAttack and set the MoveCostType variable to be āFrom Pathfinding Costā. Next set the move values of your units to 1 and their MaxAP and CurrentAP to some relatively high value. Also consider setting bUseEndsTurn to false in your abilities if you want to be able to move after attacking.
Set the game mode of your map to BP_ATBTT_Initiative. This will set BP_TurnManagerInitiative as the active turn manager, which will order units in initiative based on the value of their Initiative variable.
Well, the code is all there in the example. What parts of it are you having trouble reproducing?
Thank you for your answer, ! Itās of great help.
Yep, I guess that it can work. Iāll try it!
Actually none. I just mentioned it to give you a full overview
Sounds great, Iāll try to customize the blueprints as you suggested. Thanks again!
Best of luck, and let me know if you have any additional questions!
Hello Thank you for all your help so ran into another odd thing that is happening so if I move the gridmanger to any location other than 0 0 0 it makes it not work correct. is that correct?
I think this might be a fix going to try and see if this works
Ok I looked around to try to find out where to put this fix but im unable to find it im using the hybrid map if you could point me in the right direction so I can move that grid manager from 0,0,0 I just need to know where to put the fix sorry
Hello .
I am trying to understand what I need to modify or create in terms of pathfinding in my game. You mentioned a video on pathfinding and edge costs at the very end of this one https://www.youtube.com/watch?v=r5j3ā¦15jXKF&index=9 but I could not find it.
I have a Title type with a Boolean variable called Hindering (represented by the blue tiles in my screenshot). I want the pathfinding to stop movement on those tiles and not go beyond if you start from a regular tile. If you start from an hindering tile, you can go anywhere at half the speed.
The screenshots represents only a portion of the grid. The unit can move 4 squares in any directions. The first one shows the output of pathfinding from a clear tile. The second one shows the output of path finding if starting from a hindering tile on the second move command since the unit is half speed 4/2=2.
Any pointer on how to implement this would be greatly appreciated. I think I need to modify Search and Add Adjacent Tiles Custom 1 but you would save me time if you have a hint for me.
Thanks,
Chris
N.B. I made a mistake on screenshot 1. The unit can reach 14001 due to the diagonal entry but not beyond. Sorry.
Hi, seems like I forgot to convert from grid space to world space in one place in the experimental hybrid map. Sorry about that. This should hopefully fix things:
https://i.imgur.com/5A2Vbnj.png
I am currently working on this problem. I will update this post when I have a solution.
Hello .
thanks for looking into it. I am still a newbie when it comes to Blueprint but after some work I was able to achieve something. I just need to validate that this is a good approach if you donāt mind. Attached are the modified Custom Pathfinding function in GridManager and the Move ability I use. I decided to make use of the SpecialEdges enum. The third attachment is my tile Begin Play. I just check if the tiles as a zero index specialedges that is of enum type Hindering.
That do you think?
Thanks,
Christian
Nice work! Pretty close to what I had in mind, though I would make a few adjustments.
So first what I did was to create a new integer Set in BP_GridManager which I called GridHindered, which holds the grid indexes of all hindered tiles.
Next I added a new type of GridObject which adds its index to the GridManager on BeginPlay:
https://i.imgur.com/JoOJhaa.png
I modify the Custom1 pathfinding type so that pathfinding search stops if it reaches tiles that are in the GridHindering set:
https://i.imgur.com/QyP9GEZ.png
Lastly in the ability I am using I select pathfinding type based on if the index the owning unit is standing on is in the Hindering Set:
https://i.imgur.com/Dsg1324.png
And there we are:
https://gfycat.com/scarcecourageouscreature
All in all pretty close to your implementation. I used a custom set instead of SpecialEdges, as SpecialEdges is designed to mark the edges between tiles as special, and not the tiles themselves. Also, although the way you modified the pathfinding function will work, it is not very performant. That particular function is potentially called a very high number of times during pathfinding, so it important to set it up so it does not do any unnecessarily expensive calls. You want to order the branches so that the ones that are most likely to be false are called first, which will usually be after the stored paths have been checked.
The reason I have not made the pathfinding tutorials yet is that I am in the middle of a refactoring which changes the pathfinding a bit. The current way of having to expand an enum and modify a function to add new pathfinding types is quite awkward, as is having to copy paste a lot of the standard pathfinding function each time you make a new pathfinding type. This is something I am fixing in the next update. It is mostly a change in organization, but the code looks visually quite different, so I did not want to make new tutorials only to have them be immediately outdated when the next update hits.
Hello ** that worked almost but now anytime I move the camera that snaps camera back to location 0 going to try and see if I can find the camera in the blueprint and convert that with the same node
Note I was not able to find it for the hybrid again thank you so much for your help plan to show a small demo video of what I have so far all thanks to you.**