[SUPPORT] Advanced Turn Based Tile Toolkit

Hey ! I fixed the Move ability! Turns out it didn’t have the Default Click ability tied together when determining if its a valid target to move to.

I also added a change to the Default Click Ability, as I don’t want my player to be able to switch to the opposing faction’s unit. :slight_smile:

Hey , another update! I fixed the onClick for Initiative Icon. It references the local variable Unit, but its never set. It currently has 2 places where Get Unit is called, and I just replaced it with Get Actor > Cast to BP_Unit, and it fixed it. :slight_smile:

Hey , this might be a lot, but I’ll go ahead and see if you have an answer :slight_smile:

I am looking to create an online mutliplayer game, where units can be dragged onto the grid via a card system. Do you think this is possible with the toolkit? If so, do you have any instructions on how to setup online multiplayer testing? And possibly a way to drag units onto the grid and assign them to the current player?

Any information you have about these 2 things would be FANTASTIC.

Thanks :slight_smile:

@Zennisin: Good to see you figured it out. I really should have guessed the reason, sorry. Basically all interaction from the player to the game is done through abilities (whatever ability is active at the time). So there is not layer on top of this for unit selection, for instance. This will have to be specified within the abilities. As you found out BP_Ability_Move does not have this implemented, as it is intended as a very basic straightforward ability. Unit selection is gated through whether or not the active player owns the current unit. The same player might potentially own multiple units from different factions with the current setup. For a hot seat multiplayer sort of game, adding the sort of check you have done makes sense.

:

This is certainly possible. The toolkit is fully networked, so making a networked multiplayer game is supported. You assign a unit to a player by setting that unit’s owner to a specific player’s player controller. You can test out multiplayer games in engine through the number of players setting when you play in editor. Getting proper networked play set up is a bit more work, since you need to set things up to work with the specific network solution you are using. The Steam one is quite simple, and is the one I have used for testing. Check out Epic’s documentation on the Steam subsystem here.

As for the card interaction, the basics steps aren’t that difficult. You can spawn a new unit on the grid just by using SpawnActor, and BP_Unit’s construction script should take care of adding the unit to the grid, adding it to initiative etc. So for your card you could have some event fire when you let go of a dragged card over the game board, get the hit location under the mouse at that point and spawn a unit actor there.

Hello,

I have two main things that I want to achieve with the grid manager but I need some insight:

1/ I want the units to be able to walk through friendly units (which is already implemented) BUT when a unit is targeting an enemy and moving towards it and there is a friendly unit right next to the enemy unit it shouldn’t stop on the same tile as that unit, so basically we can’t have 2 units idle on the same tile.

2/ I want to change how the path finding spline works, right now each time you enter a new tile it clears the previous path and recreate a new one with the shortest path possible, I want it to continue moving from last hovered tile, for example I hovered a tile1 it creates the path then I moved to tile10 it continues from the existing path to tile1 and create a path from that path already created to the tile10. Is there an option to activate that result or do I need to implement it, if it’s the 2nd choice then can you give me an insight on how and where to achieve this.

Thanks.

That sounds like a bug. I’m not able to replicate it, though. Could you give me the steps to reproduce the bug?

You should be able to do all of this by modifying an ability. If you take BP_Ability_Move as a base, you could store the current displayed path when you press a key (storing the current PathIndexes array). You would also store the grid index of the marked tile and the movement cost of moving to this tile. From then on, in the hover event, you would run pathfinding from the stored grid index, with a move range equaling the move range of the unit minus the stored cost. You would then append the stored path indexes of the indexes generated in the hover event when displaying the movement spline. When choosing to move you would get the entire current path and feed this into a the MoveCustomPath event of BP_Unit. This is the general approach I would use. I know it is a bit to follow, but try it out, and if you run into difficulties let me know and I will try my hand at making it.

Hey , did you ever have time take a look into the mobile issue of not being able to move the units I mentioned above? Any info you have would be greatly appreciated :slight_smile:

Hey , thank you for your answer. I’ll try out your suggestion about the path and let you know how it goes.

About the units bug, I’m not sure, I’m using the “Pass Through Friendlies” option so I thought that 2 units being idle on the same tile is part of the option. To reproduce the issue, you have move a friendly unit to stand next to an enemy unit then with another unit move it through the same path so that it stands in the same tile as the first friendly unit, in my case, they both stand on the same tile (overlapping).

Not yet, sorry. Need to reinstall and setup the Android SDK as I’m on a new computer. I will try to get it done this week.

I’m not able to get two units to move to the same tile with any of the included movement abilities. Could you give me the precise steps to replicate the issue? What abilities are you using? What tiles are you clicking with what units in what order?

Hey , I’m having a problem with the hybrid example map I’ve replaced all the references to the third person character blueprint with mine in the same way but the grid doesn’t show up at all and i cant move, I’m trying to have a real time movement top down character outside of combat, i’ve been going over this for a couple of days now and can’t find a problem with it, i can screenshot any part of the blueprints you want.

Thanks

https://i.imgur.com/MXQfXfw.jpg

Hi Telapicus, it is a bit difficult for me to know precisely what is happening here. Here are the steps I recommend for figuring out the issue: In the hybrid example map, turn based combat is initiated when the third person character enters a trigger volume which is roughly where your white cylinder is in the image above. To get an understanding of what this does you can add a blueprint breakpoint to the overlap event in the trigger box actor. Then play the unmodified hybrid map and trigger the box. The game will pause and you can step through the blueprint nodes being activated one by one. Now do the same with your modified map and you should be able to see at which point it breaks down. Knowing this will help you (and me) figure out what is happening here.

Hey , i added print nodes to the end of various end points but it seems everything is executing right, the image i posted is after the pawn entered the trigger box and switched to the grid camera correctly it’s supposed to be in combat mode there with the grid. For example i put prints to check if my pawn was getting put onto the grid and it definitely was and it was put into the initiative order system, the camera moves over to my pawn when combat starts and a new round starts, everything except for the grid works correctly. i have an unmodified version downloaded separately for going back and forth between but I’ve changed very little.

Ok, a bit hard for me to guess based on what you’ve given me so far, I’m afraid. Are the same nodes activated in the Turn Manager? Are there any actions added to the action queue in the Action Manager that might not be triggered? Could you describe to me or show me things you have altered?

Hey , yeah gladly mate

In BP_TurnManager_Hybrid i changed parts of the custom event BeginTurnBasedMode the first “get all actors of class” i changed from BP_Unit_Hybrid to my Child of BP_Unit, the for each loop i changed the cast to my top down character, after the loop completes i changed the cast from the third person character to my character, i replaced the lerp from third person with a cut down one that only moves the camera to my character, after that the “get all actors of class” node i changed to my character

I’ve included all the changes as pictures in this gallery along with the BP_Unit child i created

Hi ,

I wanted to create a elemental weakness/resistance system into my game using your plugin. So far, the damage system is working fine, but I’d like to know where specifically I can modify the damage, so I can apply this feature. Can you point to me where to look, and what’s the best way to implement the elemental feature?

Thanks, EagleEyeGamma.

Hey , about that card system question I had earlier, specifically I wanted to try to use another toolkit on the marketplace, CCG Toolkit. It comes with a MainMenu level, that you can select what level you want to load, and with the decks selected, etc. The problem I am running into is that both toolkits were created as standalone projects, and require the game instance to be set to their instance… for your toolkit you need BP_Instance_ATBTT and for the card game one you need CardGameInstance. Do you think it could be possible to merge the 2? I’m not sure how to go about this.

From what I see, BP_Instance_ATBTT doesn’t seem to do much, so I seem to be missing something? Because some things break if its not set to that game instance, like the grenade ability for example.

Hi ,

The issue of 2 units stepping on the same tile was actually in my code, I’ve managed to fix it. Thank you

Hello ,

I’m currently working towards a 5 v 1 multiplayer game. But im having issues Spawning and possessing a pawn as “PlayerStart” doesn’t seem to function in your toolkit. I think a solution that would work best is to have a player ID spawn item BP (1-5) placed in the world and create an array of players that adds new players as they join, then assign those players to a unique spawn BP in place of a “PlayerStart”.

just wondering if I missed something in your toolkit, or if you have a better option for spawning in a multiplayer.

Lots of questions today! I’m a bit pressed for time at the moment, but I’ll do my best.

Hmm, cannot immediately see what is wrong here. You have added multiple different changes, though. Could you try introducing the changes one by one and see at what point it breaks down?

You could add an enum holding your different elements. You could add a map of enum keys and float damage modification percentages to your unit blueprints. Add a damage type enum to your ability. Then in your ability (probably in ExecuteAbility), modify the damage you input to TakeDamage and the action queue you use to display the damage (remember that these values need to be identical). You can modify this by finding the target unit (If you look in ExecuteAbility in BP_AbilityAttack you can see how I get a reference through the GridUnits TMap), finding the damage modifier value in its enum/damage modifier TMap using the element of the ability as the key and multiplying the abilities base damage by this amount.

This is one of many ways to do this, but this was my immediate thought.

The game instance in ATBTT does extremely little at the moment. It is only used in the networked multiplayer menu. Changing this should not affect anything besides this. Definitely not the grenade ability. What exactly are you seeing there? Maybe it is the card game instance modifying and breaking something? I don’t see any reason why merging should not be possible, other than doing some work by copying over stuff from the projects’ respective game modes, game states etc.

Great to hear! Explains why I was not able to replicate the issue.

Player Starts should work. However, it is overridden by at BeginPlay. Remove the SetActorLocation in BeginPlay and using Player Starts should work, I believe. If bUseFollowCam is enabled in BP_GridManager the camera will then pan over immediately to the active unit.

“Player Starts should work. However, it is overridden by at BeginPlay. Remove the SetActorLocation in BeginPlay and using Player Starts should work, I believe. If bUseFollowCam is enabled in BP_GridManager the camera will then pan over immediately to the active unit.”

Thank you for the quick and concise response. Now I just need to rework the camera to fixate on that pawn, and still retain the"freelook" functionality. Thank you again.