Also, Thanks so much for putting this together . Its a great resource so far. I’ve just begun learning UE and your toolkit has been a great resource, especially for how to us arrays.
Right now I would like to be able to cycle through the units in the player faction with say, arrow keys or an in-game button without ending their turn and selecting enemy units. Similar to Xcom unit selection. I have tried triggering the “ChooseNextPawn” event in gamemode with an input and it sort of works in that it changes to the next unit in initiative order, but it also ends their turn. I’m not sure how to do this without cycling through enemy units as well. So I’m wondering if a better way to do this would be to create separate initiative arrays for both player and enemy factions as the basis for 2 distinct turn cycles.
Or maybe i am over complicating this. Not sure, I’m pretty new to this.
Ok, that should absolutely be doable. If you intend to use my newest update, however, I am tempted to wait until Epic upload it. I’ve changed AI a lot, so telling you how to do this in the old system will not be as helpful. The marketplace guys told me they would have it up very soon more than a week ago, and I sent them the update before Christmas so they are quite a bit overdue. I’ll pester them some more and then I will try to help you implement the guarding functionality after it is uploaded. In short though, what you want to do is to check all tiles in move range for defendable tiles (possibly using an array to designate which tiles should be defended). If one is within range, make the unit move to this tile; then check tiles in sight range for targets to attack from its new position.
Ok, not too surprising I forgot about that Synchronous resolution is pretty tricky and not something I have thought of very good ways to solve. I might put my mind to the task at a later point, but it is too big of an undertaking to solve with a quick brainstorm. I have solved your other question, though. I thought making it possible to cycle between your units would be very easy, but it turned out to be a much bigger challenge than I anticipated. Here is my solution which uses both ATBTT_GameMode and ATBTT_PlayerController:
So what I am essentially doing is moving every player unit in the Initiative Order array one step to the right or left, moving the one that either gets to index -1 or to the index of the firs AI unit to the other side of the player’s “half” of the array, then activating the unit on index 0. Hmm, not the best explanation, but you can hopefully figure it out from the graphs. Seems to work really well, though!
@
Woah, this is above and beyond what i expected as an answer. I tried a few different options but I got pretty stuck. thanks man
Do you think you will include this in your next update? I’m sure a lot of people would like this as an option.
As far as synchronous resolution, ya it seems really difficult. In addition to distinct movement turns and storing each units individual spline prior to animating the movement, I think I would at least need to store different conditional commands at each tile in the Units path way. Im going to tinker, and I’ll keep you updated on progress.
Thanks
-Brad
**@Bradford_hinkle: **You’re welcome I might indeed include this in a future update, but I’m unsure if I will add it as a general feature or as part of a game example. Probably the latter. Looking forward to hearing your progress on the synchronous resolution.
@Bankworthy: Glad it worked! When you say it works in unison with preferred range, does that mean that your units still take their preferred range into account when searching for cover? How exactly did you end up implementing my suggestions?
In other news I’ve kept on adding new features. Heightmaps are basically complete at this point, but still require quite a bit of testing and bug fixing. I have also added the option for hot-seat multiplayer, multiple allied/enemy factions and the option of having a mix of AI and player controlled units on the same team. I have also implemented the option I’ve talked about before of having multiple variants of pathfinding to choose from. This can be used to have some units ignore difficult terrain, be able to move through friendly units, only be able to walk on water etc. In addition I’m adding some useful debug features. I have altered the construction script so that it is possible to display the tile indexes on the tiles themselves and also which tiles they are connected to (including movement cost). Here is a screenshot:
I’m actually beginning to run out of features that I feel should be included in the general toolkit and not just in game examples. After I have fully polished the features mentioned I think I have only muli-tile units and online multiplayer left, though the last one will probably take some time to implement. So not too far into the future I will probably be adding new features mostly through game examples. The first one will be an XCOM-like with weapons, cover, abilities etc.
I do indeed mean that the units still take the preferred range into account, after the part in Find Path to Tile in range function finds the Indexes with LoS, I check all these indexes, I get the victim direction from each index, and check to see if the index has appropriate cover and add the index to a new Indexes with Cover Array.
In the Choice Candidates part, I replaced the uses of Indexes with LOS array with the new Indexes with Cover Array
Much simpler than I thought it would be!
They currently have trouble with LoS and full cover, but I’ll be implementing corner peeking with the AI soon
The displaying of the movement costs on the tile looks really good, would be useful in displaying cover values of each tile in my project!
, thanks so much. You’ve got to be one of the best all around people on the market place. It looks like a lot of the features I’m looking for are scheduled to be implemented in future game examples or in the forth coming update with the rogue-like example. I’m also trying to wrap my head around blueprints in general, I come from a unity background that included a lot of c# and javascript so translating some of that into UE4 has been a bigger challenge than I expected at first. This toolkit has been a huge help in grasping the engine itself. I look forward to working with this toolkit as it continues to evolve and expand!
@Bankworthy: Ok, cool! Can’t wait to toy around with cover mechanics myself. As more layers are added to the AI’s decision code they seem to become exponentially smarter
As for using the method used in the screenshot above for displaying cover values it will require some adjustments. Showing six or eight text renders on every tile quickly slows the game down, so it is currently better as a debug feature. If you have a limited number of values to display you can use instanced static meshes instead, which would make this less of an issue. Another possibility is to only display the numbers on tiles that are currently un move range.
@MicahM: Don’t mention it! I think it is great that people can use my toolkit to learn their way around blueprints. When I started making the toolkit I had basically no knowledge of programming or scripting at all and within eight months it was released on the marketplace. Blueprints turned out to be the perfect development tool for how my mind works, and I’m still baffled that I was able to make something that so many people use to learn UE4 and create games Good luck in your UE4 endeavors!
have you thought about pickups or items yet? I was thinking of a simple pickup that alters that the dmg,health,movement etc… properties of the pawn that walks on the tile the item is on?
Hi Jopel. I have indeed thought about it, and it is actually included in the 2D game example in the update that should be up any time now. This includes healing potions, weapons and armor. It will require a bit of modification to implement in the regular toolkit, however, as the movement system for the 2D units is a bit different.
Hi ,
I’m going through your second video tutorial, where it shows how to turn off Display Path as Spline. I have Heightmap set to From Tiles and Auto Edge Costs Based on Height set to on, however the arrow markers are not visible on raised platforms. Is there a setting I am missing?
Hello Ariegos. Sorry for the late reply. I do not usually use instanced static meshes for displaying the path myself, so this seems to heave slipped past my bug testing. The fix is very quick, though. Modify the Display Path as Instanced Meshes function in BP_GridManager as follows (changes are highlighted):
I am trying to set up a teleporting tile in my game.
For one of my maps, I want there to be buildings of different heights but I dont want the player to be able to walk ontop any.
So iv set grid manager height map to tracing and impassable to 0.
I have set up some children of tile parent with collision events on them.
When a unit hits one theres a small delay and the unit teleports to the appropriate tile.
However once hes on there I cant select him or move him around.
Help?
Sorry the BP screenshot is abit messy.
It basically checks if the unit is player, if the tile is the selected unit to move to, then sets units new index, teleports, sets new pawn array elem and clears markers
It quite possibly could be the height settings in the grid manager so how would I change that to work for how I want but so the units cant normally go higher without use of the teleport?
It’s been a long time since I’ve looked at this project and it looks like you’ve made many improvements. There are a couple of things that I would really like to be able to do with this. It looks like you’re already working on the different heights. Another thing I’d be interested in is the ability to dynamically generate a tile grid for a particular map. For instance, what would be required to integrate this system into something like Dungeon Architect to create real time generated tile based dungeons?
@: You’re thinking along the right lines, but I see a few mistakes that might be causing this… Setting cutoff to 0 is a bit overkill, though, and might cause issues. Set it to 1 if you want to be sure. With the kinds of height differences you have it could of course be much higher. An immediate problem I see is that you only add the unit to the Pawn Actor Array and not the Pawn Array (I know this is a bit confusing, so I will be merging the two in a later update). Also, make sure to also remove the unit from the index it is leaving for both arrays. After you have moved it you would probably have to run Activate Unit for the unit again also.
@antsonthetree: Hi there! I’ve indeed made quite a few improvements, and I am still planning to add a lot more. The toolkit can generate a grid map on top of any arrangement of meshes. The only thing you need to make sure is that only meshes that are walkable block the PathTrace channel. If you do this with Dungeon Architect and make sure to run the dungeon generation before the Grid Manager is activated it should hopefully work just like that. You need to make sure that the grids of Dungeon Architect and ATBTT line up, though.
Hey there, thank you thats made it work perfectly
I was worried the system wouldnt allow me to do what I wanted and I would have to stay grounded or let my units run up walls
As I should be removing array items before the teleport, im assuming I should be readding after the teleport instead of the current set array elem, which in this case would now set nothing.
As usual I appreciate the work you do and would love to hear feedback from you sometime on my current build, though I understand your very busy
Glad it worked! I’d love to check out your build some time, but I am extremely busy these days, so any feedback I could provide would be very superficial. Work should slow down quite a bit by mid-March, when I am done with data collection for my PhD. After that I can hopefully begin to have most night off, meaning I’ll have more time for working on the toolkit again, including providing more in-depth assistance.
Extra enquiry to my previous issue though I fear I know the answer.
I wanted to have height advantages to combat in my game, so if you got up into a roof you could attack a unit below and it really assits your attack.
However when moving between levels the grid itself only allows you to interact with the level your on.
Would there be a way to attack a unit thats on the ground below you? Or would it be less to do with the grid and more hard valued.
e.g. Click, if enemy unit, if can attack, attack- regardless of the grid
Hi, I have a little question concerning the 2D game exemple : Will it be possible to create a fallout-like with it ? (fallout 1 & 2) With isometric sprites and tilesets in a hexagonal grid.
In any case, thank you for your work, it’s amazing !
**@: **Sorry again for the late reply. I’ve been busy doing research (playing XCOM 2 ). Height advantages should be very easy to do. Just compare the z values of the Vector Field Array for the indexes of the attacker and the target. It should already be possible for your units to attack units on tiles below them. Try placing a unit with a long range on one a higher level and send me a screenshot of its tiles in range. I don’t see a reason why it should not work out of the box.
**@SD_Tohrak: **I’ve thought about this quite a bit, though I haven’t done any serious testing. It should hopefully be as simple as setting the camera to orthographic at the appropriate angle. I have found a tutorial video for setting up an isometric camera in UE4, though I haven’t watched it yet since I’m at work. After quickly jumping though it I think it contains all you need, though:
In other news I’ve played a lot of XCOM 2 lately, which is incredibly fun and recommended to any fans of turn based strategy. XCOM: Enemy Unknown was my main inspiration when I first started working on the toolkit, and playing its predecessor is giving me a ton of ideas on how to improve the toolkit. Having become so intimate with turn based mechanics I’m looking at the game in a completely different way than other games. I can spend ages zooming in and out and moving my mouse cursor behind meshes to see how they have implemented occlusion problems, spline generation, pathfinding etc. The game does have quite a few bugs at the moment, and every now and then something pops up that is identical to problems I’ve had with ATBTT in the past, making me realize we must have implemented some features in similar ways. I’m sure those of you who have used my toolkit for a while will have similar experiences, and feel a sense of closeness to the developers. Very enlightening and most of all fun! I cannot recommend it enough.