[SUPPORT] Advanced Turn Based Tile Toolkit

The initial collision tracing to the grid to find a location is done client side, but everything that has to do with important game variables such as the grid arrays are handled server side, including the function that checks the height arrays to find the closest tile.

Ok, happy to hear that the issues seem pretty minor. Especially for the ability bar and the abilities used in JungleRaid as I never designed those with touch controls in mind. I will take a look at this when time permits.

In my tests the floor is the grid itself and the floors are scaled cube meshes, not BSPs.

That is probably the best way to go about finding the issue. Perhaps upload the project to OneDrive or similar and PM me a download link?

Working with the decoupled animation system can indeed take some getting used to, but something like this should be perfectly doable. I might be missing something about what you’re trying to do, though. You’re basing your ability on BP_Ability_Laser, right? Is the idea to have the camera zoom in over the shoulder of the unit as it is aiming and firing on a unit? If so you can always call on the camera to do this as part of the Shoot action in the Laser ability right before the ranged animation is queued. I’m probably missing something in what you’re asking, though.

No worries :slight_smile:

This is a bug I thought I had fixed, but apparently not. Sorry about that. Really easy to fix, though. Go to the FindTilesInRange function in BP_GridManager and add the DiamondShaped function input as input to the FindVisibleTilesFromTilesInRange:

Unsure from your description here. Did you solve both these issues or one?

[quote=ā€œcrossmr, post:2494, topic:21930ā€]

So I’ve got an android version put together that, while not perfect, is a great foundation. I just recorded a gameplay video, which I’m uploading now. It was mostly fine, you’ll be able to see some camera glitchiness in it, but you’ll also see something odd at the end. When the AI was down to a single unit, it sort of, gave up? I don’t know how to describe it. It had been using that unit until then, shooting, etc. But then suddenly when all the other units were killed, it just sort of ran that unit around and didn’t do much. Didn’t shoot or anything. This is the second game I’ve played as the police and in the first game it used that unit a lot. I had quite a long battle with that unit last time, so I don’t think there is anything wrong with the unit, just thought I’d pass that along. I’ll post the video when it’s uploaded.

Hmm, I’m unsure why the AI would give up at that point. I used to have a similar, but more morbid bug where the last AI unit remaining (when all enemies were also killed) would then run to the corner of the map and kill itself. This was caused by the unit trying to find targets, which returned false which got interpreted at index 0, so it ran to index 0. Then it found itself on index 0 and killed itself. This is not what is happening in your case, though. Perhaps it is detecting so many enemies with so few allies that the expected value of an attack is 0 or less? You can try debugging this by printing the expected value as part of the AI ability comparison code in the ability system component.

Thanks for linking the video, by the way. Fun to see the development progress.

Glad you found it :slight_smile:

Right now I’m just sorting out the execution flow and how it may differ between the two abilities.

Touch Input->ClickAttempt->ServerConvertLocationToIndex->ServerInteract(FunctionCall)->ServerInteract which seems to be implemented on BP_Ability. As it both movesprint and the various shooting abilities have BP_Ability as their parent. With both abilities having BP as the parent, I’m a little confused as to why they behave differently (move as 1 touch shoot as 2 touch). I’ll keep digging in to those.

I’m going to try to adjust the camera glitchiness today where it sometimes refuses to pan or jumps around or at least see if I can figure out what is causing that.

The idea is that the camera follows the bullet to the target, from the snipers gun to wherever the target is. I have it called if the target would die from the damage received on the sniper ability that time. I’d like more ability to completely interrupt the ability, and I almost had it, but then it just refused to end the ability. On some moves I’d like to do a bit more cinematic camera work, but because of the decoupled system, I’m struggling to see where and how I can interrupt an ability. Obviously the best place to interrupt the ability is before the unit/animation is split. The problem I ran in to, is how to come back to the ability? I had it set up where in the shoot function, it would first calculate the random damage and compare it to the target’s current health. If it was going to kill the unit, then it would branch skip take damage but return a new bool ā€œbTargetDeadā€ which would be checked in the main event graph, which would then skip render beam and call a function on the gridcamera which would do the stuff I wanted, it would also pass a reference to itself (the ability) to the gridcamera, which, on finish, could turn around and call back to a function on the ability to call ā€œend abilityā€ (after calling take damage and queue action for the death at the right time). Sadly this didn’t work. The camera stuff worked, the unit died and animated at the proper time, but when the grid camera called back to the ability to run ā€œend abilityā€ nothing happened. The ability didn’t end, and I couldn’t move on to the next unit. You can see the sniper ability around 8:17 in the video I posted. He gets the kill shot on a unit and there is a bullet chase, but that’s not quite how I want it.

For the sniper ability, moving the camera from the sniper gun to the target fast enough can kind of get this in sync, but it’s faster than I’d like, and I can’t do any of the other camera stuff I wanted to do in this case. For other death camera sequences I had in mind, it isn’t as easy, unless I set it up so the camera ignores the target and focuses only on the unit initializing because I can control that easier. What I need is a way that I can pause/interrupt an ability for a special event (usually a camera and, but not always, animation sequence), then go back and end that ability when I’ve handled that. Calling a function on the camera, which called a function on the ability, really didn’t seem to work.

Yes, it’s solved, if people want to have multiheight (1/2 and full cover) on a tile they can, they just have to make sure that any squares that should have half height cover are scaled to at least 0.6 and not 0.5, or at least over the height that they wall trace at.

I don’t recall this happening the first game. As I play more games against the AI, I’ll try and make notes on any odd AI behaviour I see like this.

Just played another game and mid-way through the game the same unit had issues. It ran around, took cover, fired a few times, but then at one point they were on the opposite side of a window with an enemy unit and had a chance to shot gun blast in the face and just ended their turn. Nothing to do with the window though, because other units had no issue, Right beside it was another unit in the same situation and it fired through just fine. I’ll see if I can debug and find something wrong with that particular unit. I thought I had cleaned up an errant collisions, etc on their components.

There is one sort of large issue I did notice with the touch controls. The UI doesn’t block them. So if you fat finger your abilities, or click the information box, then you can accidentally click a move square. I’ll see if I can figure out how to block that from getting through to the grid.

Edit: Regarding the unit giving up, part of it seems tied to the shotgun. Is there a trace done from the end of the gun when checking to shoot? I saw another unit with a shotgun also exhibit the same behaviour. In front of the window, another unit on the opposite side, they couldn’t shoot (they normally can there is no minimum range). They just skipped their turn. They didn’t even step back to fire. So i’m wondering if there is a trace done from muzzle or something that the AI is failing on because the shotgun muzzle would be in a different location. The gun is otherwise set no collision to avoid that issue I had before.

Hi there. I’ve been developing in Unity for a while and I’m looking at getting into the Unreal Engine. I do have past c++ experience, and I’m quite comfortable there. I understand that this is Blueprint based (which is just fine with me), but I really like the idea of injecting some scripts to fine tune things.

I understand I can create a c++ class and whatnot inside the engine, the question that I have; is there a way to create a new project similar to how one creates a new C++ project when setting up through the new start-up wizard?

(Thanks for being nice with the newb question)

Thanks! But I have another problem with the same feature: When I try to issue an attack to an enemy that is placed diagonally, the unit wont attack or even end the turn. Regular non-diagonal directions are working just fine and the diagonal tiles without any units let me end a turn.

Hey, !

Hope it’s going well with your PhD :slight_smile:

I had a quick question. I wanted to test this DisplayMovement Frame function (as i understand it is this X-Com style frame instead of tile highlights).
But i have trouble figuring out how to get Edge Line Locations from the grid.

Where can we download this?

Hi, I’m sorry if this has already been asked. Can someone help if there is a way where the turn base only activates when an enemy is altered and then ends once they are all dead? Like the classic Fallout. I was thinking it’ll be a case of swapping game controllers and setting the AI of the same faction to a follow distance for player only.

You have to buy it on the marketplace and then you can download it through your launcher and create a project with it.

So a bunch more testing here. I’ve been looking at the camera controls since yesterday. I’m not entirely sure what is causing the behaviour. Following the execution on this, everything seems to be plugged in correctly, and I can’t reliably reproduce the behaviour. It seems to happen most if I’m trying to scroll across a larger map quickly, but it also happens when I’m swiping slowly. Basically, you could describe it as rubber banding:

I touch in some direction to pan the camera, swipe across the screen, the camera moves, but when I let go, the camera jumps back to its starting location.

I thought this was a fast swiping issue, so I changed the pan speed to give more movement on swipe to make it less necessary to swipe rapidly to move a short distance, but even when I take a noticeable pause in between swipes, it will still jump like this. My best guess is that it is somehow misinterpreting some kind of swipe as a press or something.

It’s hard to debug this kind of stuff on the device itself. Especially when it can’t be reproduced accurately. Just a little testing that might help. I’m moving on to ability clicking and see if I can’t get anymore insight in to that.

Further testing of these three things:

1 - disconnecting tick as there is a comment saying it should be for tick
2 - checking the touch bool on click attempt
3 - hooking up the node on ability base

After experimenting with some combination of these three things, leaving tick and the ability base node connected and the bool checked gave the best results for controls in game.

Good day,

Can I ask something

Im using the Toolkit for unreal 4.18. and i have a small issue.

On one map, when i do the Pathfinding, I see the path displayed (arrows or the spline path works well)

But on another map, I do not see the spline path(switching to arrows , same result, cant see anything) (i can still move normally, i see the highlighted tiles in range etc.)

i think i might have changed something and I forgot what it was

can somebody point me to where i can check??

Thank you

Sorry for the late answers, people. I’ll get to all of it now.

Ok, that is good to know. Like I said I never had touch controls in mind when I designed the abilities for the advanced tactical map, so the cause could be any number of things. I’ll let you know when I have the time to check the touch controls.

I think it should be fine to build it into the ability. One generic solution for jumping out of an execution chain to an arbitrary event graph and then jump back again to where you left off is to use an event dispatcher to bind the node that continues the execution of the ability, run your camera code, call the dispatcher, unbind the event and continue the execution chain.

Hmm, not sure what the visibility thing could be. Visibility traces are always done from the same place, which is from the center of one tile to another at VisibilityTraceHeight (defined in the public variables of BP_GridManager). What you describe does indeed seem like the sort of discrepancy where the AI in the ability evaluation phase decides that a unit can be targeted, but when it actually attempts to do so it fails out. Not sure what would be causing this, however. You could try logging the values the AI stores in TargetIndex and MoveTarget index of the shotgun ability when AssessAbilityValue is called in BP_Ability and compare it to what happens on AiActivate for the specific ability. If you can consistently replicate the issue at the same point in the combat you can add a breakpoint that activates at that time and step through AiActivate to check what goes wrong at that point.

You can always add C++ code to a blueprint project. Just choose File and New C++ Class and you should be good to go.

Ah, dang. Seems there is still one more thing to change. Just as easy to fix, though. Go to the FindVisibleUnitsInRange function in BP_GridManager and attach the DiamondShaped input variable to the input of the two CheckIfTileIsVisibleFromOtherTile functions. That should do the trick.

Thanks! My deadline is approaching a bit quicker than what is ideal, but I’m positive I’ll make it.

Unfortunately that experimental way of displaying a movement frame did not pan out. The function in BP_Ability_MoveAttack is just one I have forgotten to delete. I still have many ideas for possible ways to implement movement frames, but this has been a feature that has been surprisingly tricky to find an ideal solution for. For my current best try check out the 2D example map, which uses a post process material to display the movement frame. Works well for flat maps, but gets pretty glitchy with height differences, unfortunately. I’m basically waiting for inspiration to strike to get this feature fully implemented.

Here is the link :slight_smile:

Thanks for the detailed account of your testing. It will be helpful when I get around to fixing it. I’ll try to make it a priority to look at once my thesis is handed in since you’ve put so much work into this.

Hmm, very hard to know what is wrong without more specifics, unfortunately. If the issue is caused by your own changes it could be almost anything. Could you explain a bit more? What are the main differences between the two maps? Are you using the same abilities?

I fixed the UI to catch errant taps. You just need to override touch and mouse down and return ā€œhandledā€. That way if you click a part of the UI that doesn’t have a button it’ll just eat that click and do nothing with it.

I may have to go with that. That’s something I’m coming back to after having a look at the camera/controls. In theory my execution flow that I had set up, should have worked, but somehow it interrupted the chain in a way that ā€œend abilityā€ got confused. End ability doesn’t get passed any parameters, so I’d need to look in to exactly how that works, but binding something, like is already done there, might be the best way to do that.

I’ll see if I can log that, it does seem directly tied to the shotgun. As I’ve seen the AI with a pistol stand in the same spot and shot an enemy on the other side of the window. The Pistol and shotgun abilities are identical, except that the shotgun shots a spread of projectile tracers and it’s longer. Hence my wondering about a trace from the muzzle. The muzzle location is further out from the body (and may possibly clip with the wall or something like that). I’ll start testing and see if I can figure out what’s going on there.

A little more testing on this now: Pistol, assault rifle, uzi, all fine. Testing a little further, it seems that if a shot gun unit is directly beside a target, it can’t shoot at all. Even with no wall in between. The minimum range on it is 1 the same as all my other shooting abilities. The mystery deepens. if I put a pistol unit right beside an enemy unit, he’ll run a couple squares away and shoot. The shotgun unit just stands there and gives up his turn. if i start a shot gun unit 2 squares away, he runs up beside the enemy unit and gives up his turn.

Edit: Mystery solved. This was related to my ā€œchange weaponā€ ability that I created. Apparently the AI didn’t know what to do with that, so instead of shooting its gun when it was close, it just gave up. I either have to remove those from AI players or create some functions that tell the AI what to do with that ability.

In terms of where I am right now:

  1. Touch controls/camera movement
  2. Weird bug with some meshes and the floor snapping

Are the two things I don’t think I can solve without your input. But I’ve got a few other things to keep me busy that should take another 1-2 weeks (in app purchases, multiplayer, the action camera, building additional levels). My only suggestion for the touch controls is 1 tap ā€œhoverā€ and then second tap ā€œexecuteā€. it makes the most sense for me. This would help prevent errant clicks moving a unit and also give a player a chance to evaluate hit percentage.

@crossmr Hey Cross, thank you for your extensive reports on your development. It is very helpful to others like me. I’m super interested on your approach to action camera shots: from what I gather, for certain actions (kill shots, overTheShoulder character running) you are calling a function you wrote in GridCamera, which momentarily teleports the camera to film these shots, then goes back to its default position?

I would have thought creating different cameras for this would be more organized (I could be totally wrong but from what little I saw of the Xcom scripts from their modding toolkit, this is the case). Anyway maybe it’s all the same and there’s no real benefit to it.

Everything you’re doing is inside blueprint graphs too, and you’re not using other tools like the Sequencer (I dont know much about it myself yet)?

Any inputs on this would be greatly appreciated, since I’m basically doing the same thing.

From what I’m reading, you were able to overcome some of the initial problems you faced when making action cams. Has your opinion on this changed at all? Is making these shots in your opinion a more-than-it-should-be tedious exercise, and if so, what do you think/wish could be done about it?

Not exactly. I am using 2 cameras. In the gird camera, I position another camera for running. I detect when the camera is moving (which only happens when a unit is moving) and then turn on the over the shoulder camera for that. Then I turn it off when it stops moving.

For other ones yes, I have a custom function which activates another camera for that. I haven’t overcome the issue of stepping out of the ability to do camera work and then stepping back in, that’s something on my list. For some things, like the over the shoulder camera, it’s not important. The over the shoulder running camera just follows normal movement. For a kill cam, you might want to run custom animations, or do other things with the camera that would take longer than (and not in sync with) your existing actions. I almost had that figured out, except that the ability wouldn’t end when I went back to it. gave me a suggestion there, so I’ll try that today or maybe tomorrow and see if that helps get that working. Yes, everything I’m doing is in blueprints, no other tools at this point. Blueprint is pretty powerful and you can handle all aspects of cinematic camera work in there, just within the confines of the ability system, you have to be more aware of how you do it, otherwise you’ll end up breaking your turn system.

Thanks! I’m confident everything will pan out, with brain like yours :smiley:

Yeah, i’ve already started looking into the 2d example. I was scratching my head a lot trying to find those edge tiles locations,now it makes sense. :slight_smile:

I’m going to need that kind of frame style display (not for movement though) so i will research how to implement it better as well.

My Action Camera system is set up now, took more than one bind, a timeline and some other stuff, but now I have a system that I can use to step out of the fire sequence to run some camera work. https://www.youtube.com/watch?v=trYDo9xyxb0 I wish it was easy to deploy to other abilities, but quite a bit of rewiring. Luckily I don’t have too many abilities yet.

Just a bit of a bug I found here. I’ve had this happen once. the game ended, the unit appeared to be at 0 health, but didn’t ā€œdieā€. I’m guessing there might have been some slight discrepancy between the health value and value being fed to the health bar. I’ll see if I can see what it is, but I haven’t seen it again since and I guess it’d only pop up in very rare situations.

I just bought this Toolkit and it looks just what I need. Now only problem have been that Tutorials and Toolkit are different. Like I was watching Tutorial 8 (UE4 - ATBTT - Tutorial 8 - Multi-level grids and the 1.6 update - YouTube) and in 14:30 there Walls_Combined blueprints and said ā€œSee there how it’s doneā€. There is no any Heightmap_example or those blueprints. Anyway great Toolkit and I am enjoining it!

Yes, he did a big refactor not that long ago, so a lot of his older tutorials are not accurate. I believe he’s planning to do more, but he’s got quite a bit on his plate right now. The tutorials from a few months ago are more relevant than the older ones. If you have questions people here will try to help you

On a side note, I got my camera system full set up, and this is a test run of a sniper kill cam.

Hey, So I had posted a couple weeks ago about trying to get this to work from a multiplayer standpoint (I had asked about anything that would need to be changed from your toolkit standpoint regarding the server). I am hoping to have my players connect on a main menu, join a network together and then enter a level from there.

This tutorial (and the many videos that are associated with the one above) is basically what I have set up. This tutorial is in ThirdPersonMode, which I’ve actually kept because I may let the players walk around in the ā€œmain menuā€ area to choose characters or upgrade items, but the actually game itself will be Turn Based and will use your toolkit. If you skim the video, you’ll see there is a separate ā€œlobby game modeā€ and ā€œlobby player controllerā€. It also uses ā€œserver travelā€ and a ā€œtravel mapā€ to get into the level.

In the tutorial itself, its ā€œlevelsā€ are also third person, and obviously I’m able to travel and control the character they give me when I get there. When I switch it to a level with the tile, for whatever reason, the entering player controller doesn’t possess anything. I can’t use the ā€œplay in editorā€ to do server travel, so I’m unable to really debug the process and see what’s messing up.

I looked all over the place for this and can’t seem to find a solution or understand whats going on under the hood to solve the issue. Any thoughts why the entering players don’t take control of the grid manager or the units placed on the viewport?

Any help would be really appreciated.