[SUPPORT] Advanced Turn Based Tile Toolkit

Hey everyone, UE4.23 is officially out and I’m working on an update. This might take a bit longer than usual as the update seems to cause a few more issues than what I’ve become used to. Should still not take terribly long, though.

Speaking of issues, private messages on the forums do not seem to work properly. I can only see the titles of the messages people send me, and the same seems to go for the messages I send to them (I can only see the preview text in my e-mail notifications). So if you need to get in touch, and have a reason not to post it in this thread, send me an email to [EMAIL=“knuteiliv@gmail.com”]knuteiliv@gmail.com. I hope @Fireskelet and @kjmccloud see this, as I have not been able to read their messages.

Happy to hear you figured it out :slight_smile:

Change the length and rotation of the camera spring arm component. Setting the yaw rotation to 0.0 should work for your purposes. Also, adjust the ZoomFloor and ZoomRoof variables for the max and minimum zoom distance. Make sure the SpringArmLength is initially set to something that is not outside these bounds.
For your second question you can call the PanToLocation event in the grid camera. You might have to disable bUseFollowCam or at least clear ActorToFollow before doing this to prevent the camera from following an actor.

Not sure I understand. You just want a sensible point for when to switch to the turn based mesh? Are you trying to do something different from what I am doing or are you simply struggling to replicate what I have done? A good point to call your event would likely be somewhere in the BeginTurnBasedMode event in BP_TurnManager_Hybrid, but I might be misunderstanding your question.

I’ve been able to replicate this issue. Thanks a lot for letting me know. It seems to be a specific bug for OneLevel heightmaps for hexagonal grids. With Multilevel or heightmap disabled there is no issue. I’ll make looking into this a priority and will let you know as soon as I have a solution. Probably a simple fix.
For the time being I recommend setting the grid manager to location 0,0,0 and moving the rest of the landscape in relation to the grid manager. This prevents the issue from occurring. I generally recommend doing this anyway, as it makes adding your own custom functionality simpler, as you do not have to correct for the transform of the Grid Manager (which I have obviously forgotten in this case)

Edit: Found the issue. Add the following to BP_GridManager_Hex:

Thanks for the quick fix. My terrain is about 3x3km and I’ve got the grid scaled up so each hex is around 100m. I’ve got everything offset so the center of the landscape is at 0,0 to minimize any floating point in inaccuracies at the extremes (considering going larger at some point, but using this as my minimum viable size). Having this issue now is a little serendipitous, as I’ve now learnt that the functions needed to convert to and from grid and world space exist :slight_smile:

Hey , I am having trouble recreating what you have done. I want to use my MannequinCharacter for movement/crafting/interaction etc. while out of combat instead of the BP_ThirdPersonCharacter. It seems easiest to leave the BP_ThirdPersonCharacter in place for the turn-based combat. I think the trouble I am having is pinpointing all the spots that reference the BP_ThirdPersonCharacter outside of the turn-based mode that need to be switched to my MannequinCharacter. Thanks again for your help.

Good news, everyone! I managed to get the update done a lot quicker than expected. I did an intense bug fixing session and got everything done in a day. I’ve sent it to Epic, so it should hopefully be up in a few days. This version does not add any new features, but fixes several bugs, including workarounds for engine issues with UE4.24. Se [my Trello]( for details.

@Zennisin I think I finally managed to figure out the touch issue as well. At the end of the TouchInput chain of events in the player controller, set Touch to true. Also, disconnect the EventTick of the player controller. Sorry for the terribly long delay on this. I can partially blame technical issues with my phone, but I should still have gotten this done earlier. Especially when it turned out to be so minor a thing.

Ok, I see. Any reason you can’t just scale the meshes down? Are you planning to be able to zoom down extremely close to the tiles?

Hard to know what you are missing without seeing your code. Are you using a similar child actor setup? In my hybrid example the player unit has the third person character as a child actor. It uses this child actor as the visual skeletal mesh for both the turn based unit and the third person character. For looking through my code, the relevant blueprints are just the ones in the Hybrid folder. Primarily the unit, character and turn manager blueprints.

Probably not, but I like to keep things to real scale where possible. It’s habit for me coming from Unity where too much scaling makes the physics weird. Don’t know how well Unreal handles it.

Sorry. I knew my edit was confusing. I meant that I had everything connected up right(I think) It wasn’t working like I said. Then I was fooling around with stuff before I took that screenshot where that event is disconnected and that is when I took the screenshot. That gave me a compile error. Reconnecting it just leaves me back where I was of the animations not working. I just added the disclaimer so you didn’t look at it and say “ahh here is the problem.” I meant “pretend like it is connected and tell me what else is wrong.”

Now in your reply you mention 4.23 being an issue and I think I was using 4.23 so maybe that is why it is not worked ng. Thank you

Hello ,

Through some recent testing since last time, this line of code for some reason (First picture) doesn’t make sure that it makes the unit stop after attacking the same target twice if the hit was super effective. I was thinking of putting a bool into this section of the blueprint (Second picture) to make it so that if it gained a set number of AP to much it could stop the unit. Would that be possible, asking for a second opinion here and maybe another mind to figure this out.

Thank you so much, EagleEyeGamma.

Fair enough. I don’t know whether that is true of Unreal Engine as well. While you’re still early in the project it is probably a good idea to look into this stuff and choose whatever is likely to cause the least headache down the road.

Oh, terribly sorry. I completely misread your last comment. Your language was clear, so my bad. I believe the problem you’re having is also not something you’ve done. I think one of my later updates might have changed stuff so that the approach used in my tutorial video does not work anymore. I will look into it, but it might take me a bit of time. My apologies for the confusion.

Yeah, that should probably work. However, I’m afraid I’m not able to keep straight in my head exactly what you want to achieve, which makes helping you more difficult. Could you describe what you want in more detail? You want a game where you get extra attacks if you make a super effective attack, which is repeatable if you keep attacking new units? So every time you attack you gain a new attack until A) you land an attack that is not super effective or B) you attack the same target twice. Is that a correct description of what you want? How does movement factor into this?

Yes I want to make sure its only repeatable if you attack new units that are super effective, and should you attack the same unit twice it ends your turn. The movement factors into re-positioning onto panels I’ve made that change the element type of a character. However it should stop if its not effective or does normal damage to a target that isn’t super effective.

Since your abilities seem to work a bit differently to the default abilities I would recommend replacing some of the unneeded stuff instead of working around it. No need to reduce the AP of the unit and then increase it again if the attack is super effective. That makes things a bit messy. Rather, remove the default functions where you pay an AP cost. Rather, reduce AP only in the situations where you want to; namely when you make a normal attack or attack a unit that has already been attacked. That should be cleaner and should make it easier to work with.

Okay also I got this as an error when i try to build any idea why this is happening?

PackagingResults: Error: Expected an include at the top of the header: ‘#include “DamageModifiers.generated.h”’

That’s weird. You shouldn’t get any issues with a header file if you’re working in blueprints. DamageModifiers is your custom variable, right? Are you using C++ for anything or are you attempting to nativize or somethine like that?

Heya , I have been working on switching out the ThirdPersonCharacter with my own MannequinCharacter in the Hybrid folder. I have tried it several different ways and can’t get it to work. Any chance you could help me out with the steps necessary? It could be helpful to others in the future. I really appreciate your time and expertise.

Thanks,

Hey McNuggets. I’d be happy , but I need some more info. What have you tried and have you gotten any of it working or nothing at all?

hi

I haven’t been here for a few months, and I hope all is well with you.

I fire up the new build And I noticed that the hybird example is missing from the experimental folder, did you move it to another place? or did you have some issues and just delete it?

thanks in advance

glade to be back

leo

I downloaded the newest version from the launcher now and it has the hybrid example. It is in Maps/Experimental/Hybrid. Try redownloading the toolkit. You should have it.

Hi Mono,
Not sure if I am in the correct Thread.
What a beautiful written engine, well done.
Just a quick question: I am trying to find somewhere in these threads, I am sorry if it has already been discussed, being able to stack units on top of each other.
would I need to add a array for the add and also use mouse right to be able to select the tile or am I still able to use mouse left.

Thanks for the kind words, Matt! For your question it depends on what you mean. The toolkit allows for multi-level grids, so you can have multiple units on overlapping tiles. For multiple units in the same tile it can be more or less tricky depending on what you want. If you want something like Civ, where each unit has multiple skeletal meshes but still constitute one unit as far as game logic is concerned, that is not terribly difficult. If you want multiple separate units on the same tile that can be selected separately and split you will need to do some significant tinkering. You would want to replace the GridUnits TMap with a new map that contains nested arrays or sets of units and would need to rewrite major parts of all abilities, AI and tile selection nodes to recognize this appropriately. Which of these is it?

hi

i saw on trello that you made some fix for the nativization, is that mean that we can nativize the grid manager blueprint?

Good Morning , thank you for replying to my question. without drawing a detail which I can if it makes to easier to understand, unit 1 for example moves to tile index 1, end turn, unit 2 moves to tile index 1 which creates a overlap event and opens a widget for the player to add both units if need be or leave them as single units only showing one unit, if they are both added it would create a static mesh of showing a platoon style for example but as only one unit, there value would be added together, eventually I am aiming to add cinematic battle sequences for battles, but for the interim and ease battles will take place using you implemented system.
Hopefully this makes sense, I guess civilization, well the old one I use to play, you use to be able to stack units on top of each other and they use to fight as a single unit from the same tile per turn from memory, I am more chasing 2 units at the same time from the same tile to fight as a whole but without the use of single units from the one tile, but damage and hits will be taken from each unit.