[SUPPORT] Advanced Turn Based Tile Toolkit

Hi all, terribly sorry for the late answers. It seems like I’ve stopped receiving post notifications after Epic switched to the new forum style. I should probably have guessed this would happen, but it did not cross my mind. I’ll get to your questions now.

Yeah, this is why I don’t like to give estimates… As with anything in game development things always take a lot longer than what you suspect. The update is feature complete at this point, but since I’ve done a complete revamp of many of the core systems I have a lot of testing, commenting and cleanup to do. Especially features that are highly dependent on other subsystems, such as the skill system, has taken a lot longer to get done than I originally estimated. I’m working on the toolkit whenever I have the time and I’m making constant progress, but it is hard to give an exact time for when it’s done, as my previous guess proves…

Hmm, you could have this controlled by a HUD widget. Use a timer that is called after Activate Unit. Have a float track in the timer that goes from 1-30 and output it to a text box in the widget. When the timer Is finished, call the End Turn event in the player controller. You could do something similar with the longer timer for all the units of a faction. When it ran out you would have to code it so that all units of the current faction are set to the end of the Initiative Order array in the game mode before starting the turn of the unit then at index 0 (the first unit of the next faction)

  1. Sorry, no. Only one grid is supported at a time. I am looking into how I can change the toolkit to make it work, but It will at least not be in the next update. Depending on what you want you can fake it, though. By having a large grid that is split in two by a gap it will look like two grids. You can do similarly using multi-level grids to have something that function and look like two separate grids, even though they are created by the same grid manager.
    

Hi there! LoS in ATBTT is handled by the RangeTrace trace channel, meaning that any mesh or collision box that blocks RangeTrace in its collision properties will block LoS. For movement, this is handled by the PathTrace and WallTrace channels. Objects blocking PathTrace can be stepped on, unless they have a height difference higher than what is determined in the HeightImpassableCutoff variable in BP_GridManager. Blocking WallTrace does nothing unless you check TraceForWalls in the public variables of BP_GridManager.

If enabled, traces will fire in all grid direction for each tile, and any traces blocked by WallTrace will cause the EdgeArray to remove an edge between the tiles on either side (making it impossible to pass between the two). Try setting your destructioble meshes to block WallTrace and enable TraceForWalls. After destroying the destructible meshes make sure to run the MakeTilePassable function in BP_GridManager for the appropriate tile index to make it possible to pass through after destruction.

If you do not wish to use the WallTrace option you can also make your destructible meshes child actors of the BP_Tile blueprint, which includes public variables for setting the cost of the edges surrounding the tile (0 makes it impassable from the selected direction)

Thank you for the suggestion. This support thread has of course become pretty huge over the years, and it takes ages to sift through it all. Epic requires sellers to have a support thread, though, and I like to have all support in one place. I hope to make some FAQ’s and similar in the future, to make it less necessary to search for ages for common questions. Right now I’m focused on getting my update out, however.

As for what features are needed in all games, and what are more game specific, this is a choice I made a while ago. I wanted to have a core toolkit which includes features that are used by most TBS games. Then I create game examples on top of this that have more game specific features. The 2D game example and the SciFi tactical map are such examples. These allow me to show users how to implement much requested features without bloating the basic toolkit. This is why shooting lasers is not a feature of the default toolkit, but is included in the SciFi example.

I agree that a simple move to command is missing from the toolkit, and as such this is one of the things I’ve added to the WIP update. I will give you a rundown of this tomorrow (sorry, it was late at night when I saw all the new forum posts)

Thanks again for the suggestions. Keeping things generic is something I always try to do, and there is of course some room for improvement in this area. An AfterEnterTile event is also something I have added to the coming update.

Thanks, adding such a check for the camera spawning is a good idea. I’ll have to look into the second issue. Thanks for letting me know.

Thanks. You have an eye for finding bugs :slight_smile: Is this in the default toolkit or the SciFi examples. I know there are some rare initiative issues in the SciFi example which I’ve fixed in my WIP project.

As mentioned I’ll give you a rundown of how to achieve this result tomorrow. Kudos for figuring out most of it already. I’ll give an explanation for how this works in the toolkit when I give you my solution. Don’t worry about asking too many questions. You gave valuable input and pointed out some bugs I need to address, so thanks for that :slight_smile:

And again, sorry to all for the long wait. I’ll enable notifications in the new forum and hope it works. And I’ll try to remember to check by frequently even if I don’t get notifications.

These examples are excellent starting points for new projects. Thats why its good to have them bug free also. I am happy that plugin gets upgraded for basic functions like move to tile and I can’t wait to get it :slight_smile:
Also please consider adding Before enter tile event because it allows to have some suprices for player like hidden enemy units etc. in game that will block tile when exposed. I will work on it probably anyway so maybe I will post if I will do it to speed up process.

That is a great idea! I’ve created a blueprint and added destructible mesh there - it is now blocking LoS and Pathfinding. After mesh’s destruction, I make the tile passable and it ceases to block anything. Works great, thank you.

However, if I add static mesh that grants cover to this blueprint and destroy it on mesh’s fracture - while the tile becomes passable, it still grants cover.
Is there any function that can delete cover from a tile in a way it makes the tile passable? I’ve tried to find it myself, but with no success.

Best way to switch between units? Already have a UI where you can select a unit from and it’ll get the ref to the correct unit pawn in your team but simple activating that unit is not doing it, it resets the movement when you move. Do you need to do something special? Will continue to look into it but figured I might as well ask directly.

Yep, I certainly see that. My intention for the game examples was to be able to add new much requested, game specific features relatively quickly, without having to worry about every new feature working with every old feature of the toolkit (such as multi-level grids, both hex and square tiles, all different movement options etc.). As I keep adding features to the base toolkit, it becomes exponentially more time consuming to add new features on top of these.
My game examples are intended as a sort of a compromise. Something that works well for some games, but need to be adapted for others, or to provide inspiration for how to modify the toolkit to your own needs.
However, after releasing the tactical sci fi game example I’ve noticed that several people have used it as the base for their games. Because of this I’ve been working hard to improve the skill and cover systems to make them easier to work with and better integrated into the base toolkit. Come next update, the skill system and cover system are contained in blueprint components that can be added to units or the grid manager at any point. This is one of several such changes I am making, so that users will not have to make a choice of what child blueprints to use in their game from the get go, but instead add and remove features as they see fit.
I’ll look into adding a before enter event. If it turns out to be quick to add I’ll include it in the next update, but if it turns out to be difficult to add I’ll wait until the next one, as I have a too long list already. If I don’t add it I’ll help you do so yourself, however :slight_smile:

No, I haven’t added such a function, as a function is not really needed. Instead simply clear the value of the cover array at the appropriate index and you’re good :slight_smile:

If you take a look in the player controller you will see I have added some nodes and functions that serve this purpose. By default you can switch to friendly units by clicking them. Look in the “If CanPlayerSwitchPawns is true and a pawn that has not acted is click, switch to this pawn” comment box in ATBTT_PlayerController. Generally what you need to do is to make sure the Initiative Order array is the way you want it after you have switched units (with the unit you are switching to at index 0) and then run the ActivatePlayerUnit event in ATBTT_PlayerController for the unit you are swapping to.

Thank you for your answer. Removing index from array did not help, seems like the grid should be refreshed after that. But I just launched “regenerate cover” function instead - and it worked.

What would be the best way to give each skill there own attack animation ? I have made about 15 skills but all have the same animation .
thanks for your help appreciate it

It makes sense that it doesn’t work. I forgot that the cover array is not coded that way. The cover values are not held in the tile providing cover, but in the tiles adjacent to this tile. This makes things a bit more tricky, but I’ve made a function for you that removes cover from the appropriate tiles. Here you go:

http://i.imgur.com/hNSGva0.png

As for running the generate cover function, sure it works. But regenerating cover for every single tile on the entire map each time you change something is overkill.

One way to this would be to have a custom event in the animation blueprints that takes a skill reference as input. Then you could make a switch from this skill reference to drive the animation you wish. If you do not want to have a unique animation for every single skill, but have some that are shared, it would make more sense to create a new enum specifying the different sorts of animations as the input pin instead.

Recently you said to check if it is possible to have more grids than one in game at once. Is there any chance to check also if it would be handy to separate hex and square maps to separate grids? I saw in code, that all the time plugin is checking which type is actually selected. I understand the need for having two at once while doing development but since this plugin is more and more ironed out, maybe its time to separate them? Also it could be nice to make another version of the grid that has simpler enter tile cost (like one value instead of 4-6) because in most cases it is enough for games and could make simpler, easier to maintain and modify and faster code.

Hi there,

I have a quick question on how this framework may work with procedurally generated worlds…

Here is an example of a similar implementation to what I’m considering… GitHub - SiggiG/ProceduralMeshes: Plugin with example procedural mesh actors and components

What I’d like to do is to have the terrain procedurally generated to the same size as a corresponding hex grid in this plug-in. Once the terrain is generated, I’d like to link the generated landscape to the underlying grid.

Is this type of thing possible with this framework? And if so is there any hints/suggestions/tutorials I may have missed?

Thanks!!

Thanks for the suggestions. I gave this quite a bit of thought when I first made the toolkit, and I still think keeping both grid types in the same blueprint makes the most sense.

If they were completely separate blueprints it would take up twice the space and require me to duplicate any change I make. If one is a child blueprint of the other, the child blueprint would be more awkward to edit for users.

Though there are many places in the grid manager with hex grid branches, I have taken great care in their own placing to make sure they have negligible impact on performance. Splitting it up into separate blueprints would be make the graphs look a bit cleaner, but there wouldn’t be many other benefits, and I think this is outweighed by the drawbacks.

As ​​​​for making a simplified version of the Grid Manager that does not have the option for multiple edge costs per tile, this is something in could be probably do quite easily and that I can see some users benefitting from. I’ll put it on my list of features to consider for the update after the next.
​​​

Having square/hex grids separate would mean less space because one can delete BPs they don’t use. Also, they both require to setup few things each time you switch between hex and square so one could have less work. but if I could choose to have separate square/hex or advanced and basic I would go with second any day. Especially that if implemented all of them to the plugin that would mean 4 variations which is too much I guess :slight_smile:
Anyway I am really happy that basic version with simplified tile cost is planned, can’t wait to have it for my next project! :slight_smile:
And btw maybe there is a chance to have access for beta testing new version? Bug testing would be faster that way. But I don’t know if it’s possible tehcnically.

Sure, there will some difference in regards to space, but I think you are overestimating the impact. If someone is making a tiny mobile game where every kilobyte counts it would take very little time to search for the HexGrid variable and delete the nodes in question.

To clarify with the simplified grid, this would be a child blueprint of BP_GridManager with a few functions overridden, such as AddViewportToTerrain and Pathfinding.

The update is not in a state I would want to share yet. Though most features are done, there are still many places with unfinished or temporary code. Any beta testers at this point would mostly run into tons of known bugs, so the feedback would be of limited use. Thanks for the offer, though :slight_smile:

Hey guys, I tried searching the thread but I didn’t find an answer.

Would anybody have any idea on why my Current Pawn Marker Mesh is not moving when I select a different Unit?

As you can see in the picture, the Path marker is coming out of my currently selected unit, but the Marker is in a whole different dude.

I don’t know if I’m doing anything wrong, this literally is happening without modifying anything (just followed the Part 1 Tutorial: Setup in youtube)

Thanks!

Minor nitpick, looks like there’s a typo with the “Get Diaplay Tile Edges” variable. Should be “Display”.

Sorry, but I’m not able to replicate this issue. Are you using both the latest version of Unreal Engine and ATBTT?

@Draice: Thanks! I’ll get that sorted.

Hi , I am using the latest versions, but I think I figured out how to replicate it, turns out I did in fact modified something but I for some reason it caused this bug to appear.

Here are the steps to replicate:

1.- Create new ATBTT project from the Epic Games Launcher
2.- Open Project
3.- Open Map_Grid_Example map
4.- Go to AdvancedTurnBasedTileToolkit/Gameplay folder in the content explorer
5.- Open the Event Graph for the ATBTT_GameMode Blueprint
6.- Go to the “Event Begin Play” Node.
7.- Add a “Pring String” Node just before the first Spawn Actor Node.
8.- Run the map
9.- The Bug should now appear.

The weird part is that if I remove the Print String node and return the BP to it’s original state the bug persists. I’m not familiar enough with UE4 to determine if this is a bug with the engine or with the toolkit.

Another weird thing is that if I create a Child BP from ATBTT_GameMode, I can add the Print String node before or after the call to Parent Begin Play and it works just fine.

Edit: If it helps, it seems that restarting the Editor fixes this issue. But any further modifications to the GameMode BP makes the bug manifest again

Well, this bug is quite baffling. I’m able to replicate it following your steps and when I continue investigating it gets even stranger. The location of the Current Pawn marker is set in the Event Tick of ATBTT_PlayerController, here:


it seems that making any change to ATBTT_GameMode causes the Use Index input boolean to be set to true, causing the frame to jump to index 0. Restarting ATBTT, as you noticed, fixes this issue, and Use Index is again set to false. This is extremely weird, and I’m quite sure has to be caused by the engine code and not ATBTT.

Thankfully this bug does no longer appear in my internal build, so it will be fixed by the next update. However, since I have no idea what is causing this I cannot give you the steps to fix it in the live version. It’s good that restarting the engine fixes it, though, so it will not cause any actual issues for your game. Very strange stuff, though.

I’m just glad you were able to identify the problem :slight_smile: I’m building the Game Mode in a Child BP now, seems to cause no issues. Looking forward to the new build though!

Looking for a way to move the camera in between turns sort of like final fantasy tactics where you press a button and the camera rotates the camera 90 ° cheers