Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Sorry about the late answer, people. Yesterday got really busy. I'll get to your questions now

    [QUOTE=Skulldug;n1783222]
    Originally posted by Monokkel View Post
    Ok, so like a donut? Is it important that this is done using a subgrid? Can it be done at runtime? If so, FindTilesInRange with a minimum range of 1 can be used. What is the gameplay purpose of these subgrids?

    Yes like a donut and and being done at runtime would be perfect. Thank for the help and do not spend to much time on this, its not that important. I have to go out of town tomorrow and will
    reconnect with you when I return in a week or two
    Thanks again Knut.
    Ok, here is a hardcoded example to give you a starting point. This creates tiles and add them to the grid in a hexagonal donut at a specified grid index:





    Note that DefaultTile does not have collision, so you would want to add your own mesh instance with collision that blocks PathTrace

    Originally posted by Infest1908 View Post
    1. Yes thanks. I searched hours because it was working in a blank project until I found out, that this will not work when you have "use Decals" on true. Where can I change it when I want to have it active?
    Ah, sorry. I assumed you were using meshes. For decals, change the value of TileMarkersDecal (and for BP_Ability_MoveAttack also TileMarkerMoveDecal). Both are variables in BP_Ability and its children.

    Originally posted by Infest1908 View Post
    2. So for the spline works too but where can I chance the color/material? As everything still shines bright white after changing the static mesh.
    Yeah, this is my mistake. Seems like the material is being unnecessarily overridden due to an old setup that is no longer needed. Go to the DisplaySplineWithSplineMeshes function in BP_GridManager and remove the SetMaterial node.

    Originally posted by Infest1908 View Post
    3. Where for "AbilitityMoveAttack" is for the AI defined, that after movement, with having no AP left, it still has the free attack/Action? I found for the player and changed it, but can´t find it for the AI.
    AI is a bit more complicated. Generally AI abilities try to find all reachable tiles, with a move range defined by the PossibleMove variable in the ability. If the unit has only enough AP left when assessing an ability to use the ability, but nothing more, PossibleMove is set to 0 (in UpdateAttributes) and the unit will only use the skill if it can do so from its current position.

    Originally posted by Infest1908 View Post
    4. I am trying to access the float for damage within "BP Unit" and parse it to "Animate Death" like its done the same way for "animate Hurt" already. But when I conect the pin, it will givge me the errormassage once it tries to access it during gameplay. I have added a screenshot.

    Thank you Mono
    That error indicates that there is no value stored in the float array of the action. You need to pass the damage into the QueueAction(death) macro where it is called.

    Originally posted by RTE1984 View Post
    Hi Monokkel,

    This is super detailed and helpful, I implemented it with no issue. I appreciate it!

    Curious though, my blue move markers are gone now. Where did you have me turn those off in this breakdown?
    Maybe you forgot to connect the ForLoop to the Add node in BP_Ability_Move when you deleted the branch? Check your code and make sure it looks like my screenshots.

    Originally posted by RTE1984 View Post
    As far as this issue goes we now just need a way to differentiate visually that multiple players are on the same space, we were thinking of maybe adjusting where they're at on the space, so not every player will be centered on it.
    Many different ways to do this. Not sure which is best. Perhaps create a grid TMap that holds the number of units on each tile and when a unit wants to enter a tile, check the number, reference it against an array of predefined relative locations and make this the end point of the path? Something like that.

    Originally posted by Munchydo1 View Post
    Hello. Thank you so much for making this tool. I just bought it yesterday and it's looking very informative and useful for what I'm doing! I'm still relatively inexperienced at coding and Unreal Engine, but I have a question.

    I added attack and defense stats that determine how much damage an attack should do to a target. The attack is added to a unit's equipped weapon and put into the damage variable that was already a part of BP_Unit. In the Take Damage function I have the target's defense subtracted from the damage to determine how much health should be lost. It seems like its calculating the damage correctly, but the health bar is not displaying properly. It is removing a percentage based on the damage calculation without factoring in defense, yet the unit's current health stat after being attacked is correct. This leads to situations where the unit disappears from the grid as if they died once their health bar reaches 0, but they can still be moved around and have health left (although they cannot attack or be attacked).

    Basically I would like to know how to correctly update the health bar and what I would have to change with my current system to do that. Sorry if this is a silly question, I just can't figure out what is going wrong.
    Hi Munchydo, that is a very common mistake people make with the toolkit, and understandably so, since the game logic/action system distinction takes some getting used to (check out my tutorials on the action system if you have not done so already). I'm making some changes in the next update that will make it more difficult to make these sorts of mistake.

    The problem is that you are damaging and killing the unit in the game logic, but you are not sending this information to the action system, which asynchronously displays this to the player. So in other words you need to make sure that any time you deal damage you also queue and action to display that damage being dealt. Infest has been kind to show one way of doing this. If you are using the TakeDamage directly you can also set the AutoAnimate boolean to true, which will automatically queue the appropriate hurt animation and health bar change dependent on the input damage.

    Leave a comment:


  • replied
    Originally posted by Infest1908 View Post

    Hi Munch,

    maybe I can help you out. In my case it has worked to to modify the damage within the ability function "Execute Ability" that is used. I have just createt functions within the ability (lets say "move attack") I have attached a sreenschot for example critical calculation. That works fine on my side. What you will maybe have to take care about, is that in the first "self created" function the damage of the specific unit is set again to normal, by getting the damage value of the current unit. You could do this even in the same ability though, but at least in my case it is not needed.
    This definitely pointed me in the right direction. The health is now being correctly displayed when factoring in defense. Your example was also very helpful since it gave me some direction as to where to implement things like hit chance, critical, and multiple attacks.

    Thank you so much for your help!

    Leave a comment:


  • replied
    Originally posted by Munchydo1 View Post
    Hello. Thank you so much for making this tool. I just bought it yesterday and it's looking very informative and useful for what I'm doing! I'm still relatively inexperienced at coding and Unreal Engine, but I have a question.

    I added attack and defense stats that determine how much damage an attack should do to a target. The attack is added to a unit's equipped weapon and put into the damage variable that was already a part of BP_Unit. In the Take Damage function I have the target's defense subtracted from the damage to determine how much health should be lost. It seems like its calculating the damage correctly, but the health bar is not displaying properly. It is removing a percentage based on the damage calculation without factoring in defense, yet the unit's current health stat after being attacked is correct. This leads to situations where the unit disappears from the grid as if they died once their health bar reaches 0, but they can still be moved around and have health left (although they cannot attack or be attacked).

    Basically I would like to know how to correctly update the health bar and what I would have to change with my current system to do that. Sorry if this is a silly question, I just can't figure out what is going wrong.
    Hi Munch,

    maybe I can help you out. In my case it has worked to to modify the damage within the ability function "Execute Ability" that is used. I have just createt functions within the ability (lets say "move attack") I have attached a sreenschot for example critical calculation. That works fine on my side. What you will maybe have to take care about, is that in the first "self created" function the damage of the specific unit is set again to normal, by getting the damage value of the current unit. You could do this even in the same ability though, but at least in my case it is not needed.
    Attached Files
    Last edited by Infest1908; 07-03-2020, 03:12 AM.

    Leave a comment:


  • replied
    Hello. Thank you so much for making this tool. I just bought it yesterday and it's looking very informative and useful for what I'm doing! I'm still relatively inexperienced at coding and Unreal Engine, but I have a question.

    I added attack and defense stats that determine how much damage an attack should do to a target. The attack is added to a unit's equipped weapon and put into the damage variable that was already a part of BP_Unit. In the Take Damage function I have the target's defense subtracted from the damage to determine how much health should be lost. It seems like its calculating the damage correctly, but the health bar is not displaying properly. It is removing a percentage based on the damage calculation without factoring in defense, yet the unit's current health stat after being attacked is correct. This leads to situations where the unit disappears from the grid as if they died once their health bar reaches 0, but they can still be moved around and have health left (although they cannot attack or be attacked).

    Basically I would like to know how to correctly update the health bar and what I would have to change with my current system to do that. Sorry if this is a silly question, I just can't figure out what is going wrong.

    Leave a comment:


  • replied
    Originally posted by Monokkel View Post

    The shared files might not be the best example anyways. Lets start with the basics and take this one step at a time, then we can figure out what works along the way. So first let me give you a basic setup to allow units to end their turn on the same space as other units.

    Modify SearchAndAddAdjacentTilesCustom1 in BP_GridManager so that tiles are added to the open list even if there is a unit on them:



    Then make a duplicate of BP_Ability_Move. In PlayerActivate you can skip the branch that does not display move tiles if there are units on them:



    Next in CheckIfValidTarget you return valid even if there is a unit on the tile:



    Now place a couple of units. Set their default ability to your new move ability and their PathfindingType to Custom1. And voila:



    There are obviously a lot of limitation here, but this is a good starting point for a discussion for what you need and what you don't need for your game. What here is missing that you need in your game?


    Hi Monokkel,

    This is super detailed and helpful, I implemented it with no issue. I appreciate it!

    Curious though, my blue move markers are gone now. Where did you have me turn those off in this breakdown?

    As far as this issue goes we now just need a way to differentiate visually that multiple players are on the same space, we were thinking of maybe adjusting where they're at on the space, so not every player will be centered on it.

    Leave a comment:


  • replied
    Originally posted by Monokkel View Post

    The best place to change the appearance of the move/range tiles is in the specific abilities you are using. Just set the Static Mesh directly in the Details of the TileMarkers component.

    The appearance of the spline is still defined in the Grid Manager, though. You can change its value in the SplinePathMesh public variable of BP_GridManager.
    1. Yes thanks. I searched hours because it was working in a blank project until I found out, that this will not work when you have "use Decals" on true. Where can I change it when I want to have it active?

    2. So for the spline works too but where can I chance the color/material? As everything still shines bright white after changing the static mesh.

    3. Where for "AbilitityMoveAttack" is for the AI defined, that after movement, with having no AP left, it still has the free attack/Action? I found for the player and changed it, but can´t find it for the AI.

    4. I am trying to access the float for damage within "BP Unit" and parse it to "Animate Death" like its done the same way for "animate Hurt" already. But when I conect the pin, it will givge me the errormassage once it tries to access it during gameplay. I have added a screenshot.

    Thank you Mono
    Attached Files
    Last edited by Infest1908; 07-02-2020, 06:25 PM.

    Leave a comment:


  • replied
    [QUOTE=Monokkel;n1783185]
    Ok, so like a donut? Is it important that this is done using a subgrid? Can it be done at runtime? If so, FindTilesInRange with a minimum range of 1 can be used. What is the gameplay purpose of these subgrids?

    Yes like a donut and and being done at runtime would be perfect. Thank for the help and do not spend to much time on this, its not that important. I have to go out of town tomorrow and will
    reconnect with you when I return in a week or two
    Thanks again Knut.



    Leave a comment:


  • replied
    Originally posted by RTE1984 View Post

    Hi Monokkel,

    I didn't know it had tile sharing. I tried testing it but I am not sure how to get it to work. For testing purposes I placed 2 units, one as player 0 and the other as player 1 but it says waiting for other player to arrive. Is there no local option?

    I also tried setting both as player 0's units (which my game will not be doing) and they can only start on a shared space but won't share a space afterwards. Same if I set one of the units as an enemy/other faction. Is there an option somewhere to allow space sharing between players to turn on?
    The shared files might not be the best example anyways. Lets start with the basics and take this one step at a time, then we can figure out what works along the way. So first let me give you a basic setup to allow units to end their turn on the same space as other units.

    Modify SearchAndAddAdjacentTilesCustom1 in BP_GridManager so that tiles are added to the open list even if there is a unit on them:



    Then make a duplicate of BP_Ability_Move. In PlayerActivate you can skip the branch that does not display move tiles if there are units on them:



    Next in CheckIfValidTarget you return valid even if there is a unit on the tile:



    Now place a couple of units. Set their default ability to your new move ability and their PathfindingType to Custom1. And voila:



    There are obviously a lot of limitation here, but this is a good starting point for a discussion for what you need and what you don't need for your game. What here is missing that you need in your game?

    Originally posted by Skulldug View Post
    Thanks for the reply.. I am having a problem uploading pics here.. I will try to explain better. (using hex tiles) Drag a sub grid into level, set size to 9 x 9.
    In the very center, I would like to remove the tile including index, mesh etc.. so there is a hole. Is that possible without messing the whole grid system ?
    Or is there a way to make the sub grid place tiles on a static mesh like the "old" height map example from long long ago ?
    Hope this helps.. if not I could pm you some images.
    Thanks.
    Ok, so like a donut? Is it important that this is done using a subgrid? Can it be done at runtime? If so, FindTilesInRange with a minimum range of 1 can be used. What is the gameplay purpose of these subgrids?

    Originally posted by Joker of Souls View Post

    Thanks for the help and sorry for the late reply took a break from unreal to work in blender. In the end I went with a Simpler approach. I removed collision from the doors so the player can see what tiles they can move to without opening the door. What I'm thinking of doing now is setting up a animation trigger when a unit gets close to a door they will kick it open or something so they don't just clip though it.
    Ok, sounds like a reasonable solution. For splitting up movement into multiple animations, such as stopping to open a door etc, I recommend looking at the SplitMove example map in Maps/Experimental.

    Leave a comment:


  • replied
    Originally posted by Monokkel View Post

    Ok, thanks for letting me know. Good to hear that a clean reinstall solved it.



    Hi, so this is something I would personally solve with the new UpdateTilesInRange function, which will help you not having to hardcode all the directions. If you use UpdateTilesInRange with bTraceForWalls set to true, you can input the door ar the origin index with a range of 1. You would have a collision volume overlapping the tile of the door that blocks WallTrace. If you open the door you set CollisionEnabled to false for this volume and then run UpdateTilesInRange. This will work for all directions.

    As an aside, there is an issue with the blueprint you provided. The update execute pin in a Timeline executes every tick while the timeline is running. That means that in your code you add edges probably a hundred times or more. You should instead have called those nodes either before the timeline or on Finished.

    For the AI I will need some more info. The AI has no way of knowing that doors can be opened, and just work with the pathfinding they calculate at the start of their turn. For them to consider moving through doors you might want to "open" all doors at the start of their turn (without animating them) so that the AI knows it can pass through them.
    Thanks for the help and sorry for the late reply took a break from unreal to work in blender. In the end I went with a Simpler approach. I removed collision from the doors so the player can see what tiles they can move to without opening the door. What I'm thinking of doing now is setting up a animation trigger when a unit gets close to a door they will kick it open or something so they don't just clip though it.

    Leave a comment:


  • replied
    Thanks for the reply.. I am having a problem uploading pics here.. I will try to explain better. (using hex tiles) Drag a sub grid into level, set size to 9 x 9.
    In the very center, I would like to remove the tile including index, mesh etc.. so there is a hole. Is that possible without messing the whole grid system ?
    Or is there a way to make the sub grid place tiles on a static mesh like the "old" height map example from long long ago ?
    Hope this helps.. if not I could pm you some images.
    Thanks.

    Leave a comment:


  • replied
    Originally posted by Monokkel View Post

    Glad you figured out what was not working. Apologies that I was not able to discern what you were doing wrong.

    As for units sharing a space, did you get to test out the files I sent you? It had tile sharing that worked with some assumptions about your game.

    Hi Monokkel,

    I didn't know it had tile sharing. I tried testing it but I am not sure how to get it to work. For testing purposes I placed 2 units, one as player 0 and the other as player 1 but it says waiting for other player to arrive. Is there no local option?

    I also tried setting both as player 0's units (which my game will not be doing) and they can only start on a shared space but won't share a space afterwards. Same if I set one of the units as an enemy/other faction. Is there an option somewhere to allow space sharing between players to turn on?

    Leave a comment:


  • replied
    Originally posted by RTE1984 View Post

    Hi Monokkel,

    Wanted to let you know that we FINALLY got the UpdateTilesInRange function working. It looks like we were having trouble because the subgrids we were using weren't inheriting from the grid_actor blueprint so we couldn't cast properly or something, we weren't getting access. So we are using new ones inherited from the grid_actor and it works! It updates the tiles correctly when they spawn and correctly prevents the player from clicking outside of them.

    Did you have an update though on how we can solve the issue we mentioned earlier about getting players to be able to share a space?

    Thanks!
    Glad you figured out what was not working. Apologies that I was not able to discern what you were doing wrong.

    As for units sharing a space, did you get to test out the files I sent you? It had tile sharing that worked with some assumptions about your game.

    Originally posted by Skulldug View Post
    Hello knut, I have some questions about sub grids, working with hex tiles
    is there a way to make sub grids say 10 x 10 shaped like round or diamond shape,
    what would be easiest way to make a sub grid with a hole in the center (remove certain tiles).
    If these questions have been asked and answered could you point me to the page number..
    Thanks.
    I'm having a hard time visualizing what you are attempting here. Think you could try to draw it?

    Originally posted by Infest1908 View Post
    Hi Mono

    short one i guess. Where can I change the mesh/material of the spline and move/range tile appearences? Changing it in the gridmanager does not work for me completely. Thank you
    The best place to change the appearance of the move/range tiles is in the specific abilities you are using. Just set the Static Mesh directly in the Details of the TileMarkers component.

    The appearance of the spline is still defined in the Grid Manager, though. You can change its value in the SplinePathMesh public variable of BP_GridManager.

    Leave a comment:


  • replied
    Hi Mono

    short one i guess. Where can I change the mesh/material of the spline and move/range tile appearences? Changing it in the gridmanager does not work for me completely. Thank you

    Leave a comment:


  • replied
    Hello knut, I have some questions about sub grids, working with hex tiles
    is there a way to make sub grids say 10 x 10 shaped like round or diamond shape,
    what would be easiest way to make a sub grid with a hole in the center (remove certain tiles).
    If these questions have been asked and answered could you point me to the page number..
    Thanks.

    Leave a comment:


  • replied
    Originally posted by Monokkel View Post
    New tutorial video is up! This is the next in my series of the toolkit's basic features. This one covers tile actors:





    Did you follow my previous instructions exactly? Did you place the GridManager at location 0,0,0 (with a GridSizeX and GridSizeY of 1) and a subgrid at location 100000,100000,0 (and use this subgrid as your starting location by placing a unit there)?
    Hi Monokkel,

    Wanted to let you know that we FINALLY got the UpdateTilesInRange function working. It looks like we were having trouble because the subgrids we were using weren't inheriting from the grid_actor blueprint so we couldn't cast properly or something, we weren't getting access. So we are using new ones inherited from the grid_actor and it works! It updates the tiles correctly when they spawn and correctly prevents the player from clicking outside of them.

    Did you have an update though on how we can solve the issue we mentioned earlier about getting players to be able to share a space?

    Thanks!

    Leave a comment:

Working...
X