Not sure if this was asked before might have missed it. Are there any games using this currently available? I wanna check out projects other people have released.
Hmm, well thatâs not good. Have you made any modifications? Does it happen every time a unit shoots and how does it freeze? Do you hit the loop limit and the game crashes or is the game running, but the game doesnât proceed to the next unit in the turn order?
No modifications to the jungle raid map, nor any of your code.
Yes, it happens every time.
Youâre locked out of the game (canât click on anything)
Once it freezes, I stop the game so I donât know about hitting a loop limit. Unless the loop value is extremely high, it should have triggered.
Game doesnât crash, it just locks you out (yes, you canât proceed)
Have you been able to repro this? I may just have a corrupted install and could try re-downloading.
Edit: I removed the local content and re-downloaded the project and it works OK. Something must have gotten corrupted.
Question from discord âIâm having trouble getting a door to open and close and be able to walk though it. So far this works but only for a door facing south. I used a child of the south wall blueprint to make a door. What I was trying to do was get the rotation of the door and have that go into the direction ENUM switch and use the correct get tile in direction so I donât have to have different doors for each directionâ
The execution pins from âset relative locationâ went to a rats nest of âGet tile locationsâ and a switch on EDirection. I actually got it working somewhat. with two box triggers on the same door seemed like a better solution. Seems to work on start in North south east and west. But iâm guessing that will cause problems if I have lots of doors on a level? The AI also does not go though the doors and cant detect me at all even with the stealth system disabled. Could that be related to the issue of if the door opens and your turn ends you can no longer move though the door but you can if your turn does not end?
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.
Hi ,
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!
Hello , 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.
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
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.
Iâm having a hard time visualizing what you are attempting here. Think you could try to draw it?
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.
Hi ,
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?
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.
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.
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:
https://i.imgur.com/QhlYXiG.png
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:
https://i.imgur.com/cnz01QF.png
Next in CheckIfValidTarget you return valid even if there is a unit on the tile:
https://i.imgur.com/DRZvSTS.png
Now place a couple of units. Set their default ability to your new move ability and their PathfindingType to Custom1. And voila:
https://i.imgur.com/4S7YsPx.gif
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?
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?
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.
[quote=â, post:3470, topic:21930â]
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 .
-
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?
-
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.
-
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.
-
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
Hi ,
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.
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.
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!
Sorry about the late answer, people. Yesterday got really busy. Iâll get to your questions now
[quote=â, post:3471, topic:21930â]
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:
https://i.imgur.com/i04elB8.png
https://i.imgur.com/N5jOGpp.gif
Note that DefaultTile does not have collision, so you would want to add your own mesh instance with collision that blocks PathTrace
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.
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.
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.
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.
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.
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.
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.