Download

[SUPPORT] Advanced Turn Based Tile Toolkit

Hmm, I’m uncertain about how implementing the camera changes I gave you could have led to these issues. Are you sure it is related or are you getting the same errors when you use regular cameras? How are you spawning the new units? It seems like they are not being properly replicated.

I figured out why the camera control was not working, as the assigned actor was not being controlled by a player it was causing a bug. Once I fixed that issue the control was reestablished. Now for why it’s spawning at 000 is another issue I need to resolve, thank you for being so vigilant about helping people in this thread.

Good to hear you figured it out :slight_smile:

As for your spawning event I’m a bit unsure how the level blueprint works with networking. I assume it might always be owner by the server. How are you accessing the PlayerStart for the client here? It might be an idea to time the spawning of the units so that it happens after the TurnManager has acknowledged that all the players have joined the map. Depending on how you’ve set up your code in the level blueprint it it might trigger before the needed clients have joined, returning false locations being interpreted as 0,0,0. Mostly guessing here.

Hi, hope all is well

I’ve been playing around with the Add New Ability feature you created, thanks for that. it’s working fine for the majority of what i need it for. However there is one instance in which I want to Add an ability for a single turn, and i’m having trouble destroying that ability on the next turn after it has been added.

I was thinking, maybe this would be good to implement as a status effect? I’m actually venturing into a part of my project where I’ll be creating and using my own status effects quite a bit, so would also be really helpful to get a sense of whats the best way to think about how those work, for example I’m going to have an ability which exhausts a unit for a single turn, and I’m not quite sure where to get started on that, even though I understand the exhaust function.

Thanks!

Sure, something like that could be done with a status effect.The basic function of status effects is relatively straightforward. They are added using the AddStatusEffect function in BP_AbilitySystem (of the unit you are adding the status effect to). When a status effect is added this way, the Activate event on the status effect is immediately called. This is a good place to queue any visual indicator of the status effect or any other immediate effect (expanding on the AnimateActivation event which is queued here by default is a simple way to put the visual part of the activation).

Two central events are RunOnTurnStart and RunOnTurnEnd. These are blank in the BP_StatusEffect parent blueprint which you can override in your custom child blueprints. These are the events you probably want to use for ongoing effects such as applying poison damage every turn etc.

The last event is Disable, which by default calls the Destroy action on the status effect (which by default turns it invisible. You can expand on this as needed) and sets a queued timer to destroy the actor itself.

For your use case you probably want a status effect which holds a reference to your ability. You set this reference when you add the status effect and destroy it on RunOnTurnEnd. You should not straight up destroy it instantly, though, as the destroy command could happen before any actions using a reference to the status effect have animated, so use the QueueDestroy macro so that it is first actually destroyed when it is no longer used. To make it appear destroyed before then, remove the ability from the abilities and abilityrefs arrays in BP_AbilitySystem. Come to think of it, you would want to do this even in the event of destroying the actor, as you would be left with empty array elements. Use RemoveIndex, not RemoveItem to prevent this.

RunOnTurnStart/End are called on slightly different times depending on what turn manager you are using. For BP_TurnManager_Initiative it is called on the start and end of the specific unit’s turn. For the other two turn managers it is called on the start and end of the current faction’s turn for every unit of that faction.

One thing I’m still struggling with is the RangeTrace and Pathfinding around the corner objects.

I tried to get it working in the most basic example I could think of, here’s two units using the Grenade function which uses the Find Tiles in Range and has Check Visibility set to true. Here are also the collision settings for this simple box which is offset X = 100 Y = 100 to be on the corner. Should it be blocking the Range Trace for this ability?

Basically what I’m trying to do in my game is very similar to this toy example, however I will also want to have some objects which block both Range Trace and Pathfinding for one faction but don’t block these for the other faction, which I anticipate could get complicated. But if I just get this toy example working with the Grenade and the two units it should take me pretty far. Thanks!

Screen-Shot-20191115-at-3.23.05-PM.jpg

Hmm, interesting questions. For visibility I think you could do this relatively easily. You could have your corner actors (that block RangeTrace) each have a faction variable. On a new faction’s turn you would loop through all of these actors and enable/disable collision based on the faction of the corner blockers relative to the active unit’s faction.

Pathfinding is more difficult. I have one idea which should work, though there might be a more elegant solution I’m not seeing. You could create a new TMap for BP_GridManager to hold your special corner blockers. You would add them to a grid index in this TMap once spawned and remove them when they are destroyed. They are at a corner, but you would store them in one of the surrounding tiles in a consistent manner (say, always the tile to the north west of the block’s location). Then you could create a new custom pathfinding type. You could use FindAndAddTilesNoDiagonals as a starting point. On the CheckIfStraightAdjacent branch in this function, false means a diagonal connection. Here you could check if the connection is passing a blocked corner by checking your custom TMap and, if the index is occupied, check the faction of the corner box against the faction of the active unit, continuing pathfinding if they are the same.

That explanation might have been a bit confusing. Let me know if this is not enough to go on and I will provide a more detailed explanation.

Thanks! Appreciate the advice as always. Will definitely work with those the best I can.

The more important issue for now is just simply figuring out how corner objects like this can block range trace and therefore the find tiles in range function.

in the example above, the grenade ability is finding an enemy target through the corner object even though it’s blocking range trace, so I was hoping you could guide me through the process of having a corner object block Find Tiles in Range in this very simple 2 player grenade only tile setup so that I could work on it in my game.

After getting that working ill be I’ll be able to move on to the more complex functionality you addressed above. Looking forward to getting your thoughts, thanks.

Ah, I see. From your example it might simply be that the collision of your mesh is not tall enough to block the trace (provided the mesh has a properly set up collision volume). Traces happen at VisibilityTraceHeight, defined in BP_GridManager. For debugging you might want to go to the CheckIfTileIsVisibleFromOtherTile function and enable DrawDebugLine in the LineTraceByChannel function call therein.

Thanks! That did the trick

Could you show me some examples of these?

Thanks, EagleEyeGamma

Hello, i just bought your project and Im trying different stuff. It´s very greatly crafted.
So I want to do a simple design where Player characters have two moves - one long and one short. How can I achieve that?
Can you suggest me a tutorial videos you’re from your tutorial list?

Another thing I’m wandering how to do finishers or other moves like this?

Hi Monokkel,

Version of ATBTT is 1.7, maybe. Version that I used, is not with multiplayer, certainly. For this, I created the project with Unreal Engine 4.17, and I switched version of Unreal Engine to 4.23. About why I did like that, I’will tell you later. anyway,

With ATBTT ver 1.7, If I set like below, grid manager seems could not make data of edges. And character can not move.

Condition is:

  • Hex grid: ON.
  • Pregenerate: ON.
  • Heightmap: One Level or MultiLevel.
  • Default mash is SM_Tile_Hex.

I recorded steps to reproduce, and uploaded to youtube.

https://youtube.com/watch?v=klKMUadRiNk

When I do those in latest version of ATBTT, There is no problem. But I want to keep working with 1.7.
I started debugging harder about this, but there is no clue yet. Do you have any good idea about this?

It was short asking, Here goes a little longer story.

Three weeks ago, I got a very good chance to suggest to my boss, in my work, about game I want to make. But I didn’t have a time. Time I got was about 2 month. Yes. Untill this year. And I need a playable prototype to suggest.

I want to make a turn based strategy game. And fortunately, I saw ATBTT!

I’m game designer. I have little experience for unreal engine 4. But about programming, I’m not good. I’m just newbie. But I know how easy to learn blueprint, and potential of unreal engine. Further more, when I see the reviews of ATBTT, I got confidence. I can feel the solidirty. And many people said about good tutorial videos.

People nearby me told me about unity engine. But 2~3 days later, I choose and purchased this.

I saw the tutorial video first. I can feel - something is different. The structure of folder in tutorial video, was not same as what I downloaded. But, I tried to track the difference between tutorial video and what I downloaded. There was not big problem, at least, untill second video, as my thought.

I found that difference was not small, from third video. At that time, I could see the exist of old version of ATBTT, difference between old version and latest version. I got confusing for getting the concept of action system, ability system, and turn manager. But more confused thing was this: In playlist of tutorial video of ATBTT, there are both video about very long video about old version (about three hour XD), and many videos about latest version. (not short and not small.)

So I decided to try old version of ATBTT. And… What the! The old version of ATBTT was much more easy to understand! That was more clear and linear. There is no jumps between modules which looks abstract and confusing! It was a heaven to me. And, working with old version was fun and exciting for me at that time. How sweet it was! Thanks to you, Monokkel!!!

In my plan, multiplayer is not needed. I want to make like this - whole unit is overwatching at enemy’s turn, and they can attack when enemy unit enters their sight. Player has to choose to fire, or don’t do that (and wait until enemy comes closer), at all of each found. In this situation, for multiplayer, all of players must wait for other players too much long. So I choose to abandon about multiplayer, at early time.

Because of this, if I use the latest version of ATBTT, There will be unnecessary cost for making the game what I want, as my thought. For making the prototype for suggestion to my boss, it was more like that.

In this reason, I tried to find which version of ATBTT is more later, but does not have multiplay functionality. over many versions of unreal engine.

att1.jpg
It was hard time for me.

It takes long time, but I think that was needed, at least at that time for me. And I found - If I create a project with unreal engine version 4.17, I can get the latest version “without” multiplayer. After that, I switched that project to unreal enigne 4.23.

At now, through many debugging, working, and compareing old version and latest version of ATBTT, latest version of ATBTT looks better for me. On performance, and its design of code. But still, If I switch to version with multiplayer functionality, I have to pay much time to learning and understanding, even re-work for all I did until last three weeks. I don’t have much time. This makes me hurt now. If I have just few weeks more, I want to use ATBTT with multiplayer, but I don’t.

And that problem. I need heightmap. The height is important for game that I want to make. I will use 1~2 days to debugging for that. But if there is not some result, I have to give up something, but I don’t want that.

I hope to get good news from you soon. Really.
And,Thank you. Those time was very happy for me. Maybe In whole my life time, it will be hard to find more better time.

In my thought, It would be better - If there was two different version of toolkit. One is with multiplayer functionality, and the other one is without multiplayer functionality. I feel that those are very different things. Specially, if beginners for unreal engine 4 like me.

Here are some stuff I worked in last three weeks. At beginning this, I was newbie for unreal engine. (still now.)

https://youtube.com/watch?v=_pI_R4AjS_k

https://youtube.com/watch?v=tTyLy6Pt_a0

Added: It was much more difficult to me to understand because there was not subtitles in some tutorial video, specially this: UE4 - ATBTT - The Action System - 2/3.

Happy to help :slight_smile:

I did not version control the old projects I made to demonstrate these features earlier, so if possible I’d prefer not to rebuild them. I’ll go into more detail, though.

For elemental damage: In my earlier post where I showed how to add elemental weakness to units/abilities I did so partly in the ExecuteAbility function in a copy I made of BP_Ability_Attack. You would basically do the same thing, but with a duplicate of BP_Ability_MoveAttack instead. The part of ExecuteAbility in this ability is basically identical for the top part where dealing damage is handled (top right after the final branch). Try doing the same thing here as I suggested for BP_Ability_Attack and come back to me/show me screenshots of your setups if something goes wrong, so I have a better idea what specifically you need help with.

Second question: At the end of the ExecuteAbility function before returning you would create a branch that checks the same conditions that results in the different types of damage handled by TakeDamage right before. Whether or not these conditions resulted in a super effective attack can be used as an input to the branch. If true get the owning unit and set its currentAP to min(MaxAP, CurrentAp+1).

Test it out yourself first and give me your specific results if something goes wrong, and I’ll try to guide you the right way.

Thanks! The Ability System tutorialis your best current starting point. Though I am overdue to create a more practical tutorial for ability creation, as the current tutorial is more descriptive than hands-on.

For your first question I’m not 100% sure what you mean. Are you thinking of something similar to the BP_Ability_Sprint ability in Maps/JungleRaid? This ability has two move ranges, displayed in different colors, for using 1 or 2 Action points. Are you after something different than this?

For your second question I’d also prefer if you could be a bit more specific. What is a finisher? Is it an attack that does a special animation if it ends up killing its target? An ability that can only be used if the target has a certain amount of health remaining? Something else?

Hey HyalineV, I’ll have to try to remember how the toolkit was a few years ago, but I’ll do my best.

Hmm, not sure what exactly is happening. Is this an issue that only happens when Pregenerate is on, though? I don’t recommend using pregenerate for anything other than some forms of debugging. I originally made it as a way to improve performance (by not having to generate the grid again at runtime). However, I later learned that this only works in the editor, and in a packaged project there will be no performance improvement. I only kept it in the toolkit so you can visualize grid indexes and edges in the editor when debugging your game. If you enable pregenerate the grid manager will keep the edges and indexes it had when it was last modified or compiled, and with the way you switch it on and off and switch between different kinds of heightmap settings it is hard to know what exactly is happening here. If this only happens when pregenerate is on I suggest you just leave it off.

2 months is not a lot of time, especially when you’re learning the tools as you go, so make sure to keep a very tight focus and throw out any ideas that are not essential to your prototype. I’ll do my best to help you along, though.

Too bad to hear that you find the old version that much simpler. I can understand it, though. The current toolkit is a lot more modular and powerful than the older versions, and a lot less stuff is hard coded to enable simpler modification. This did come at the cost of making it less immediately straightforward. This is exacerbated by the fact that my oldest videos became outdated. My later videos have been an attempt to start building up a new tutorial series that combines theory and practical examples, but I still have a lot more to make there before it covers all of the toolkit’s features.

I understand your pain. With two months you had to prioritize and chose the version that was simpler to grasp. It is too bad you were not given more time, so you could have spent a few more days learning the new features of the toolkit. They are more difficult to understand immediately, but once you have learned them they make many things easier.

Heightmaps should work in the version you are using, but maybe there is some old bug in that version that I have forgotten. I need a bit more information. If Pregenerate is off and heightmap is enabled do you still have problems? What are those problems specifically?

I’m glad you enjoyed working on it! Programming games is a lot of fun. I’m more or less addicted to game programming, so welcome to the club :slight_smile:

I have considered making a simplified version, for the reason you describe, but it would be too much work to maintain two different versions. The action system also does a lot more than simply enable simple replication for multiplayer. That is mostly a side benefit. The best thing about the action system is that it allows you to put a lot of stuff in an action queue in the same tick and then have it play out asynchronously.

The alternative to this is to have a spaghetti code chain of abilities calling functions and event dispatchers back and forth between various blueprints in a way it is easy to lose track of and cumbersome to code. I know it might look simpler to not use it, but with the old system the code in your final game would likely look a lot more complicated. I’ve decided that the toolkit I make is the one I would personally want to use to make my own games.

I try to keep it is beginner friendly as possible within these constraints, but I try to never compromise when it comes to the toolkit’s flexibility, performance and iteration speed for experienced developers.

Looks very cool :slight_smile: Thanks for sharing your videos.

Yeah, that is a problem. No idea why subtitles are not enabled there. They are automatically generated by YouTube, but I don’t know why they are not for that video. There is a maximum video length for subtitle generation, but that should be much higher. I’ll investigate and see if there is anything I can do.

Here is some screenshots of the Ability_MoveAttackElement the only thing that has me stuck is trying to make the character have full movement before attacking.

Thanks, EagleEyeGamma.

Another question i have as well is there something that can end an effect like a buff in a turn?

Thanks, EagleEyeGamma.

Ah… I thought pregenerate is needed to me, but it was wrong. After I hear your said, specially “this only works in the editor”, I decide to turn off pregenerate. That problem is happened just when I turn on pregenerate. At now, there is no problem. Thank you!

I had to tell you more clearer. I’m really sorry. It’s my bad.

But if you have more information, there will be better, as my thought. I heard that - there is always potential possibility about hidden bug, So information about bug always has own value. I heard like this, from programmers nearby me. In this reason, I will tell you about this. If you don’t need, just forget it.

  1. Install unreal engine 4.17
  2. Create a project with ATBTT.
  3. And open the project.
  4. You can see Map_Grid_Example.
  5. Select grid manager, and set these option at same time, in grid manager.
  • Pregenerate Gameplay Grids

  • Heightmap (to one level or multilevel)

  1. And Play. Then, these symptom will be happened.
  • Character can not move anywhere.

  • Markers had to be appeared where character can go to. But There is no marker.

  • When I move mouse cursor on grids, spline had to be displayed. But it is not displayed.

If just one option in my describe below is set to turn off or set differently, at least, then character can move, and grid manager will work correctly. For reproducing symptom, these combination is needed in grid manager, in old version.

  • Hex grid (Already on in Map_Grid_Example.)
  • Set SM_Tile_Hex as default mash. (Already this is set in Map_Grid_Example, too.)
  • Pregenerate Gameplay Grids
  • Heightmap (to one level or multilevel )

Really really thank you so much for your words, and your understanding. You won’t know how much your words are helpful for me. In fact, last night, I tryed again to understand latest version of toolkit, with some courage. I feel - maybe I can do what I did more faster than my thought, with toolkit with multiplayer functionality. It might be possible for me, to make fog of war, with updating with character’s each move for one grid to grid, as same as my work, with ability system in latest ATBTT, in my thought. I decided to try it.

Added by edit: I’m looking at BP_StealthSystem now. For fog of war, here looks better start point than ability system.

I described at upper more details, but at now, I decide to not use pregenerate function. Do more work would be not necessary, as my thought.

Last three weeks was magical time for me. Rollercoaster of emotions, lots of things learned, happiness when I see what I did works well… how addicted!

I can totally understand your said. Maintaining two different version will be nightmare for you. And someday, or more sooner, maybe that performance will be need for me, too. I agree you totally. And from your point of view, making your own game, must be most important thing.

Thank you very much! Your words make me more confidence!

There is something like sound of cooling fan in your tutorial video. In my thought, change of noise looks like to disturb making subtitles. It’s just my guess. If I am you, I will make that video again, with the same content, and with keeping mic away from PC. Just consider it please.

Still, I don’t know whether… it might be good for me if I try to latest ATBTT with multiplayer functionality. Or keeping work with old version might be better for me. This is big worry for me. But, I have more understanding about blueprint, and unreal engine now, unlike when I started this. I have liitle bit deeper understanding for ATBTT, too now. As like as starting this whole works was tough, but as like it was good challenging and good experience for me, It might be good experience for me, too. Or it would be not? This makes me headache, painful, but anyway I had to make descision… I will try to make same thing with latest version of ATBTT.

There is another reason why I want to try latest version of ATBTT with multiplay functionality. I want to make all player unit move first at same phase, and then enemy moves happen next. But this is already made in latest version of toolkit, as “BP_TurnManager_Strategy”. And, when I make that fog of war, the performance issue make me difficult. In old version, by using your slow loop, I solved this. And I had a thought to modify old version like latest version in just only grid manager. As my thought, latest version looks got more performance than older version. If I success to understand and to use latest version, I don’t need to optimization work in old version. In this reason, trying to latest version looks better… If my thought looks wrong to you, please tell me.

Thank you for all of these. If I have something to ask, I will post again. Thank you!

Added: I solved this problem below. In ability blueprint (BP_Ability_MoveAttack) check grid manager based on name of blue print, but If I duplicated grid manager, then name of blueprint is changed. and result of check is changed, then problem happens. I had to change that name of blueprint in check node.


This.

It was very tough rollercoaster. wheeew. At now, no problem!!! I will keep going to make fog of war based on latest version of ATBTT!

Added again:

I was scared very much by this problem. So I spent some time looking for a solution to a similar problem. And… I got these XD!!!

Hi Monokkel, New problem with latest version!

If I duplicate example level and BP_GridManager_Hex, and use them, then the move hover marker apeared as square, not hex.

  1. I duplicated Example Level. Name of new level is “DuplicateTestMap”
  2. I duplicated BP_GridManager_Hex. Name of new BP is “BP_GridManager_HexDuplicated”
  3. I opened the level “DuplicateTestMap”
  4. I deleted old grid manager “BP_GridManager_Hex”
  5. I added duplicated grid manager, “BP_GridManager_HexDuplicated” into level.
  6. Select All of units, tiles, and walls, and unset and set “Auto Grid Placeent”, So they can reference new grid manager, and they can get new grid index from grid manager. (sometimes, I just move them little on gird for this.)
  7. play
  8. then, move marker apeared is blue square, as you see that screenshot. This looks “SM_Marker_Move”, not “SM_Marker_Move_Hex”.
    But, value of “Default move marker” of grid manager, is set as “SM_Marker_Move_Hex”, as you can see in that screenshot.

This is latest version of ATBTT, with Unreal Engine 4.23. So, You can reproduce this very easy.

Is there Something I forgot or missed? I’m looking BP_Ability_MoveAttack now, but there is something confusing. If this is more clearer, I will post here agian.

I suspect this, too. I experience something like this link said:
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/114654-my-variables-constantly-being-reset-to-default
But, I made that grid manager with “duplicate”, not with “making child”.

I suspected - some kind of problem by SVN version control system. Because, sometimes SVN prohibit writing, so unpredicted problem happens.
But, I tested this by creating new project without version control system. In this case, problem was happened again. so, SVN is not cause.

Added:

  • If I use grid manager made through duplicating, in new level, same thing happens.
  • If I make a child from BP_GridManager_Hex, same thing happens.
  • When I change the value of “Default Move Marker Mesh” of grid manager, If that grid manager is child of BP_GridManager_Hex, or duplicated from BP_GridManager_Hex, then changed value is not applied. But, when I use just BP_GridManager_Hex, changed value of “Default Move Marker Mesh” is applied well.
  • This problem seems some kind of bug of unreal engine, like that link that I said above. I want to cry. should I try another version of unreal engine?

Added

  • I tryed with unreal engine verson 4.20. when I duplicate the BP_GridManager, It failed to compile, with ModifyBigUnitArrayByUnit function. but when I delete and remake node of ModifyBigUnitArrayByUnit, then it compiled well. but, after it, unit snapping on grid does not work. Shouldn’t I use the duplication and making child of blueprint?

@HyalineV: Glad to see that you figured it out yourself. I’m sorry, but I tried to reply to you earlier, but Epic did not allow me to log in until now. Gave me an error message because I loggen on too frequently.

Do you have any remaining questions that you have not fixed yourself?

Edit: By the way, the code for setting up the marker meshes in the abilities is mostly there for ease of setup when you’re experimenting and switching between grid types. If you use your own marker meshes or make your own abilities you can also just set the static mesh of the markers directly in the component list: