[SUPPORT] Advanced Turn Based Tile Toolkit

Another thought:

While creating the multi-tile unit system, would it be possible to implement a (toggle) parameter on units that would allow them to shrink down to one space during movement to allow larger units to “squeeze” through gaps in obstacles that are smaller than the unit’s initial size?

That would be possible to implement, but it would mean altering the pathfinding so that it can identify tiles it can move through, but not end its movement in, and display this in some intuitive manner to the player. I don’t think I will implement this in the next update to avoid delaying the update even more. I’ll keep it in mind while working though, if I suddenly think of an easy and elegant way to add this feature.

Another question:

I am trying to generate a blank level, then add pawns to the map via blueprints. However, when I do this, the game mode doesn’t seem to operate. Could you point me in the right direction as to how I would add actors to a blank map and still have the game mode initialize?

Thank you for your quick response! Excellent support!

This question was originally posted on the store page. I have pasted the question below. The forum thread is a better place for providing support since I get notifications, there is not a restrictive character limit and because one can include images.

There are a few ways to do this, to be sure. Which one is the best depends on the specific needs of your game, but I’ll give you something that should be enough to get you started.

First, the reason collisions are not working is because units do not have collision enabled by default. You should first do this by going to the units you are using and enabling collision and overlap events for either their skeletal meshes or a new simple collision shape you add. Then, add a collision box or sphere (depending on whether you have a hex or square game) to the Unit blueprint. For a collision sphere a radius of 200 means it covers all immediately surrounding tiles for a hex grid. Enable its collision for queries and overlap events and have it overlap whatever channel you have set your units’ collision to. Like so:

Now to add some nodes to the Unit blueprint so that it can detect if it overlaps any units during movement and damage them if they do. But first, set “Update Index During Movement” to true as the default for the unit blueprint. This causes units to automatically fire an event whenever they enter a new tile, which we can use to our advantage.

After that, add the nodes shown below after the Entering New Tile event. This will cause overlapped units to be damaged when the unit moves into an adjacent tile. I’ve also added a couple of branches to make sure only enemy units are damaged and that any one unit is only damaged once per turns. The Aleady Overlapped Units set is used for this. You also need to clear this after unit activation so that it does not carry over from previous turns.

For your other question, having a unit rotate to face a location is pretty straightforward. Simply use the SetActorRotatin node to set the Yaw of the unit to the output of a Find Look at Rotation node, where the input to this node is the location of the unit to be rotated and the location it should be facing. I do exactly this in the Attack Victim custom event in the event graph of Unit:

Hope that helps!

Thanks for the help! Much appreciated!

Ok, after reading through more of this thread, I was able to discover the Spawn Unit function and was able to dynamically generate a playable pawn. Thank you for including this function. Sorry for not having read it before I asked for help.

Happy to help!

No reason to be sorry. There is a lot of stuff to read and I don’t blame you for not seeing it. I think I might not have covered it in the tutorials either, since it was added in a recent update where I focused on other stuff in the videos. Sorry for not replying to your last question. You seem to have submitted it while I was writing my last post, so I did not see it. Glad you figured it out anyway, though!

, I got the damage stuff up and running (thanks again for your help on that) however I am struggling with getting the player model to face the direction of the last tile clicked on the end of the units turn. I am really just uncertain which BP to hook it up in and where to integrate it into the respective BP sequence. I’ve tried hooking up the following into a number of places in the player controller BP but am not getting any kind of results. :

Hi ,

I’ve been having an issue with AI Units and their movement cost sometimes set to 0 despite having moved one or more spaces. I have a skill that causes double damage when the movement cost is 0 (or the unit hasn’t moved) and it sometimes works as intended and sometimes does not. Any idea on what could be causing this issue?

@SpineRazor: When you use the SetActorRotation node with target set to self you are attempting to rotate the actor whose event graph you have placed it in. If you use it as you have pictured in the player controller you will attempt to rotate the player controller, which does not really make sense. You must either get a reference to the unit you are trying to rotate and plug it into where it now says “self” or you must use the node within the unit blueprint itself. For example inside of the End Movement and Update Arrays comment box in the Event Graph of Unit.

@Mewbits: I’m not exactly sure what you mean when you say that movement cost is set to 0. Do you mean the move variable of unit, perhaps? Move cost should always be higher than 0 if your unit is moving at all. Do you mean when the unit is attacking an adjacent unit?

What I mean is, I’m printing the movement cost and usually it tells me the correct cost, but sometimes is prints 0 when the unit has moved. When the unit is ranged it will do double damage when attacking without moving. This causes the unit to sometimes get double damage despite having moved which should not happen.

8f85fa373ca7d44c50bb50f51da2e922e583dbe9.jpeg

Ok, I see. It might be because the CanMoveToArray has been cleared between moving and checking, in which case it would always return 0. Not exactly sure where that would be in this case, though. If all you want to do is having double damage when you have not moved wouldn’t it be simpler to check whether current move >= max move and deal double damage if it is?

Hey ,

You mentioned needing some ladder climbing animations - unfortunately my expertise is more in modeling/texturing/concept art, basically the static stuff. I have animation experience but it’s definitely not my specialty. I scoured the marketplace and the best I could find is this https://www.unrealengine.com/marketplace/-ledge-climbing-system-basic

It looks like it has some ladder climbing animations and some ladder systems set up. Unfortunately it’s quite pricey! I was actually really surprised at the lack of resources for animations, you’d think a climbing animation would be something many people would request!

And speaking of the new update, I think it’s fantastic that you are reviewing your blueprints and refactoring/cleaning everything up, and I just wanted to say please take your time! The multicell units and definitely the multiplayer setup I’m sure is a large and involved process. Quality over speed! Anyways good luck with it, and I hope you are able to see it through to the end! Also, if it becomes quite a large amount of work, I would even suggest upping the price on the ATBTT, I think even 59.99 is plenty reasonable, if that would help you be able to continue to work on it.

Thanks for searching, but the problem is not really finding a climbing animation in and of itself. To be able to include the animation in the toolkit the animation must have a very permissive license that allows for resale. This is the case for the third part assets I use in the toolkit, which are all licensed under creative commons zero. It is a bit annoying not being able to add this feature because of lacking skills in animating, because I’m confident I could code the underlying logic fairly quickly. I’m considering paying someone to make such an animation in the future, but I’ll prioritize making features that I can do on my own first.

Not to worry, I’m a bit of a perfectionist when it comes to this sort of thing, so I’m not going to rush it. I’m working on the toolkit almost daily, but since I’m going through every bit of code I’ve made and making improvements wherever I see the possibility this will certainly take some time. It is a great opportunity to do this since adding networked multiplayer requires modifying many parts of the toolkit anyway. I’m actually having quite a bit of fun reorganizing and cleaning up. If only I could have the same enthusiasm for organization and cleaning irl :stuck_out_tongue:

Regarding increasing the price, it is something I’m considering doing. The toolkit is certainly significantly better and has tons of features compared to when it was first released. However, there is no guarantee that increasing price will increase revenue, as it might scare off people who would otherwise have bought the toolkit. If everyone considering purchasing could fully understand how much time it takes to make something like this, and by extension how much developing time they can cut down by using it, upping the price a bit should not cause a large drop in sales. This is something that is difficult to convey by screenshots and description alone, however, especially for novice game developers. It is also difficult to know what proportion of purchasers are developers who are serious about developing a commercial games (who would be willing to pay a lot. Just multiply hours saved by hourly wage and you would get a very large sum) and people toying around in Unreal Engine for hobby projects or buying the toolkit to learn about blueprints (who would be willing to pay a lot less, understandably).

Yeah, that would totally work as well. Unfortunately, the cost is being cleared before it even sets the current move… and I can’t seem to find where or when.

And it only seems to be happening with AI units. Might possibly have to do with the fact that we didn’t switch the AI over to 1.7 because it made our game unplayable for some unknown reason. So the AI units are using 1.6 logic and the player units are using 1.7 logic… And if that’s the problem, I might as well wait for the next update to fix this glitch (work on other things), because the game will pretty much need to be rewritten anyways, or adapted rather. For instance, some of 1.7 couldn’t seamlessly cross over because Unit_Parent was changed to simply Unit, etc. and I chose to stick with the previous naming conventions, but I may switch over in the next update.

Hmm, ok. It is a bit hard for me to know the reason for it resetting when you are using a toolkit that is a mix between several versions. But with my suggestion you should not even have to worry about movement cost. As long as the AI units actually reduce their move points when moving, that is. Then you can just check if the move score is at its max value; if not that means the unit has moved. If this is not working because the AI’s move value is not being reduced for some reason, make sure to add this in the AI controller before the unit is instructed to start moving.

As for waiting for the next update, toy are aware that this will take a while, so you would need to be pretty patient in that case. I am also changing the names of a lot more variables and blueprints this time around. I’m confident you can solve the problems you are having. Worst case you can add a new boolean variable that you set to false when a unit is activated and true when it moves, and then you simply check this to see if you should do extra damage.

Adding a Boolean fixed the issue. Thank you.

Hi ,** i have developed a turnbased game** in the ingame editor of panzer corps, a ww2 hex tbs. It became better then panzer corps, in every aspect:
Naturally i dont own the rights for that old engine, so** i want to recreate my game in the UE4**. (my native language is german, so sorry for my engl.)

Your toolkit looks very interesting, but can it handle air units on the same tile as ground units ? I really need that otherwise its not possible to bomb ground targets in the same hex.

Does it offer a functionality to implent “entrenchement” ? I mean every turn a unit, that is capable of entrenchement, doesnt move and holds the hex, it should get a bonus to defense, like in panzer corps. (different bonuses in wood, hills, town and for higher exp.)

How does the toolkit handle** battleexperience** for units and i want to implent my unit placing system that i invented. Its partially random but in an intelligent way, so every new try on an already known map, offers surprises.

Another point is the ai. I am generally very dissappointed of nowadays ais. (Especially Civilization VI suckz in that regard. On the one hand ai scientists talk, as if real ai will soon be created, and on the other hand ai´s in games are no challenge, if they dont cheat massively. I wonder when will we see those real ais in games like civ ?) Building a good defence is easy, but I would need an ai that is good in attacking also. Ideally with groups of units. (pincermanouvers with tanks for example) Another imp. point: The artillery should never go too close to the enemy for example.

Future Plans: As a big fan of Master of Orion 2 i want to create a REAL sequel, with tbs fights. Same to Jagged alliance 2. Would you say, that your toolkit is up for the challenge ?
Finally: Sorry if my questions might sound naive, but i am new with game devel. - just modded games and worked with ps, html, vba and sql. (years ago exc. ps and html) But i make progress in UE4, every day and i have lots of time.

Great! >Though it is a bit of a workaround, but for your purposes I think it is a pretty good solution. By creating a dedicated variable you ensure that you have full control of its value.

Hi there! I took a look at the forum page about your mod. Looks like a very ambitious project! Have you completed the mod already and now want to remake it, or are you at the planning stages?

Not by default, no. ATBTT uses an array to determine what units are positioned at what tile, which only holds one unit per array index. However you have full access to the source code and can add this yourself. I do not know the mechanics of Panzer Corp, but if there can only ever be a maximum of two units on one tile (one flying and one on the ground), then making another array for flying units would probably be the easiest. If you want the possibility of stacking an arbitrary number of units on one tile, then a nested array with each array index containing an array of units would be the way to go. Note that making this change would require you to modify many other parts of the toolkit, such as scripting which unit is selected when clicking a tile with multiple units etc.

Again not something that is included by default (I try to design the toolkit as a blank slate where you can add your own features rather than having lots of game specific features cluttering up the blueprints), but not something that would be difficult to add. At the end of a unit’s turn you could check how many unused movement points it has, and if it does you could increase its defense. Defense is a new attribute you would also need to add and implement yourself.

If by battle experience you mean units improving their stats and abilities over the course of the game, this is again not something that I have added to the toolkit; again it is too game specific for my goals. There are lots of examples of people creating systems for experience/leveling up if you search the UE4 forums, though, and many of these could work for ATBTT. The general idea is just to increase some experience variable when a condition is met (killing an enemy) and increasing various stats when the experience variable has reached a certain threshold (which could be determined by a formula or a data table). For random unit placing you can use the ATBTT’s Spawn Unit function along with some semi-random formula for picking a tile to spawn (there are many ways to do this).

There is good reason AI is often a weak point of TBS games, and that is because it is actually very difficult to do well. I have included a game example in ATBTT that includes fairly complex AI blueprints for determining the best course of action, and it is some of the most challenging work I’ve done. I’m pretty happy with it and it works well, but it is still not “true” AI, but rather a complex state machine. How difficult something is to script depends on a lot of factors. Moment to moment decisions where a unit only needs to use information of the game’s present state is the easiest (and the only sort of AI I have made so far). Your artillery example is an example of this. It is easy enough to add a check when the artillery unit decides its move so that it does not move to tiles adjacent to units. Pincer movements are a lot more difficult to implement, since you need to have each unit determine not just the possible actions it can do, but also all allies. Planning complex strategies involving multiple units over multiple turns again makes this exponentially more difficult. Don’t get me wrong, this sort of stuff can be done, and can also be a lot of fun to program, but it requires a ton of work to do well. I’m sure you’ll be more sympathetic of TBS developers once you’ve tried your hand at it.
There is hope that machine learning will be used for game AI in the future (my research group has just used this for determining the age of research participants from their MR-images at my day job), but if you want to go that route it is a whole new, complex field to learn.

I’m embarrassed to say that I have not played either game, though I know they are considered to be classics. You would have to be more specific about what features you suspect might be difficult to implement in ATBTT.

Best of luck learning UE4! You should try to become very confident with UE4 before attempting to recreate your mod with ATBTT. I would recommend working gradually towards your goal by making several small, simple games first that teach you various aspects of the engine before trying to convert your mod.

, I have been messing with this off and on since I posted and cannot get the correct result. Either the player always rotates to face the same direction at the end of the turn or the camera rotates to a different view at the start of the turn. All I really want to happen is at the end of the player units turn, if there are no enemies within range, I would like the player model to rotate to face the red tile that you click on that completes your turn. :-/