[SUPPORT] Advanced Turn Based Tile Toolkit

Hey , Thanks for your awesome work!

I want to make moving platforms (grids) for my prototype. The grids should be able to move and everything on them should move with them.
I discovered that when I am moving the first GridManager in the level it happens automatically, but it doesn’t happen with every other grid/tile I am using in the same level.
Is there a way to use multiply “main”GridManagers in a scene so it will happen automatically with all of them? Or is there any other “easy” way to make it?

Thanks so much
Guy

I have not really made a flowchart for this, but the general setup order is the following: Game mode starts up. Signals game state to setup reference to core blueprints (turn manager, action manager and grid manager) and initializes each of these in that order. Meanwhile the the game mode delays for two ticks while all of this is setting up. When that time has passet it sets the TurnState in the game state to TurnBasedCombat, signaling that the game is ready to start.

Whenever a new player logs in it first checks to see if the grid manager is done initalizing (last step of the above setup process). If it is it initializes the player controller for that player. If it isn’t it delays until it is. The HUD is initialized as part of initializing the player controller as well as the grid camera.

This means that the grid camera’s setup will be the last thing to run for any player logging in, so at the end of the grid camera’s setup it signals to the turn manager that a new player has joined and is possessing a grid camera. The turn manager keeps track of such signals from players joining to know if enough players have joined to begin the game and activate the first unit in initiative.

If you want to see more specifically what happens, add a break point right after event begin play for the game mode and step through the nodes one after one in the blueprint debugger.

@anonymous_user_fdc4a810: Like said, bUseUnitAttributes is used in the parent blueprint (BP_Ability). To find all instances where a variable is used right click it and choose “find references”. That gives you all references in the current blueprint. Click the binoculars icon afterwards to find references in all blueprints.

This is a mistake on my end, though. My intention was to have damage be set based on the damage variable of the unit in the MoveAttack ability. To fix this, make the following change in BP_Ability_MoveAttack (to override a parent function in a child blueprint click the override button in the function tab of the child blueprint in question)


For an explanation of why units were seemingly damaged without displaying it using your solution, see my videos on the action system. You likely input a damage of 0 into the queued action macro (the one in your screenshot, which is only used for animation and not underlying game logic), while still using the old damage value for the server side TakeDamage function happening directly after.

hi

first of all I wanted to thank you fro the realy great toolkit that you made (I am using its concept in my project a lot). it’s an amazing work and the support and help you give is impeccable. And I’m sure that the help and learning you give to many people through your system is Very satisfying for you.

My project is a cross between a turnbased and a third person.and i now I just started to add multiplayer and came back to your toolkit and I am a bit confused And hope you can help me.

My problem is this:

In what had been so far - the ai was run throw ai controller and it was clear to me that when the boolen aicontroled is true its go to the ai turn and ai controller …
In the last update I can not figure out where I find the places where the I can find the transition to the ai (singleplayer).
In addition, I understand that now the AI is executed through the same controller

If you (or anyone else from the forum) can explain the way in which the last update workflow of the ai , so that I can convert my old project I will be very glade

thanks in advance
leo

Note: I have already answered this question over e-mail since there were some issues with the forums. Here is an edited version of my reply in case other developers might be wondering the same thing.

First my inital answer as I misunderstood his question:

Then my second answer where I address his actual question:

Hey Guy, sorry for ignoring your question. I somehow did not see it the last time. Multiple grid managers is not supported as of yet. The way references are set up makes having multiple grid managers very difficult with the current setup. However, it is usually possible to “fake” whatever result you are after using just one grid manager. I’ll have to learn a bit more about what you want to achieve, however. Could you explain your desired end result in more detail? Not really the techical undelying stuff, but what gameplay you want to enable and how you want it to look. Do you want something like two floating islands composed of multiple tiles where one island flies over to the other when you flip a switch or something? Describe it in detail and I’ll try to think of a way to make it work.

Hey ,

Yes. Your example of the floating islands is more or less what I am trying to achieve.

For my prototype, the player can spend some resources , once per turn, that will allow him to have control on some of the grids. The player can then choose a ui button for this “special power” and There should be some previsualization of the platform he chose and how it can move. Then, if and when he confirms, the platform moves with all the elements on it.

I hope this makes sense.

Thank you very much for your support.

Guy

Is there an explicit list somewhere of what the steps are to migrate this plug-in to an existing project? I see these steps:

! ) Migrate the AdvancedTurnBasedTileToolkit folder to the content folder of the other project
2) Copy over the .ini files.

Is there anything else? What part of the .ini files are important? Looking at them it’s not intuitively obvious to me what I may need. I can’t just copy them directly over and wipe out my changes to the files.

hi

i think there is a bug (or maybe i am doing something wrong), but whenever i make a grid bigger then x=70,y=70 then Problems begin (its happened only when enabled multilevel or trace for walls):

  1. character snap to diamond shape visibility and its not in standard movement anymore (snap out diagonal movement)

  2. if you place mesh above ground it will not detect as a tile (high map) as it intended in multilevel.

  3. if you dont check PregenerateGameplayGrids then it will crash when play - (something with the revers loop). if you check bPregenerateGameplayGrids then its ok.

and there are other staff but the main thing is that i dont know if something is wrong or am i not doing something right? if anyone knows about it and can help that will be great.

thanks in advance

leo

Ok, I see. That is pretty tricky to do, but not impossible. Essentially you would want the grid manager to cover the entire area that the smaller grids would inhabit. These smaller grids would not be actual grid managers, but just groups of static meshes. When moving these “islands” what you would have to do is remove the tile indexes it previously occupied from the GridLocations map and add the new locations instead. You would then have to update the GridEdges array appropriately as well. You could run the entire CreateGridLocations and GenerateGameplayGrids again (after clearing the appropriate arrays) whenever you move an island and that would do the trick, but that is highly likely to cause frame drops. Instead you would have to do something similar but for limited areas. Take a look at those functions and try to understand how they work. After that try to implement something similar on a smaller scale. null If you run into difficulties come ask me. Note that this is a pretty advanced modification of the toolkit and will be challenging.

Yep, you have the right idea. The important stuff to copy is all the AxisConfigs and ActionMappings from DefaultInput (or you will need to add new input events yourself) and the collision profiles from DefaultEngine.

If you have a very large map and use the procedural options the toolkit will do a ton of calculations at startup, which can potentially hit the built-in loop iteration limit. If you get infinite loops at the first tick of gameplay go to project settings -> Engine -> General Settings and increase Maximum Loop Iteration Count until you no longer experience the issue. Try this and see if you still have any problems.

hi

the increase maximum iteration count is maybe good for what i wrote in no-3, but its has no affect on the first two Paragraphs i wrote- when you go above 70(x,y) the system start to do some wired staff- check it

I got the following question in the comments on the asset page. I’m answering it here as it will not be possible to explain within an asset page comment and because I believe it might be of general interest. The question asked was this:

The toolkit is not setup to allow for this by default (I’m working on this, though), but it can be modified to allow for this with a quite few steps. First replace the BeginPlay event in BP_ATBTT with a custom event so that everything is activated when this event is called instead of the start of the game:

https://i.imgur.com/YfwUDHb.png

Next, in the player controller make sure a reference to the grid manager is setup in the ClientSetup event instead of BeginPlay, since the grid manager will not exist at BeginPlay:

https://i.imgur.com/nywd8zK.png

That is basically all you need to do. Now, after spawning the grid manager call ActivateATBTT at any time to start the blueprint setup cascade. After this is done you will probably want to spawn units which you can do using the built-in UE4 SpawnActor node. After you have spawned at least one unit you can call the StartMatch event in BP_TurnManager to commence turn based combat.

Note that while this seems to work fine it has not been fully tested yet so it might potentially cause issues I’m not aware of. If you run into any, let me know.

Sorry, I don’t think I completely understand your first two points. Can you give me the exact steps I need to do to reproduce the issues? I won’t be able to look at this until tomorrow night, since it is really late now, but tell me exactly what I need to do to check this and I will try to find a way to solve whatever the problem is.

Ok, I think I have found the problem, but still no solution. Everything fires off in the order that you have described, except Initialize on BP_TurnManager. I have also tested using BeginPlay from TurnManager and it never fires either (Note: Everything works fine if I used OpenLevel and override the GameMode in the world settings of my new map). I now also tested with a new dummyactor spawned directly before TurnManager and that actors BeginPlay fires as expected.
Do you have any idea on what’s keeping the TurnManager from being callable? Is there any settings I may have overlooked? I can use the Camera fine, HUD gets initialized fine… the camera hangs in the middle of the GridManager but I found out why in the Camera BP.
Anyways, very close to getting it working now I think, if I can understand whats keeping the Turn Manager from “talking” with the other BPs.
Again, thanks for all your help! Will be so worth it in the end :slight_smile:

Hapy you’ve managed to narrow it down so much. It is kind of a bizzarre issue, and I’m not sure what could be causing it. The Turn Manager is just a blueprint actor like any other, so it should in principle work just like that. Maybe you can try disabling spawning the turn manager and instead placing it manually in the map beforehand? Then in the SetupCoreBlueprints function in BP_ATBTT_State you can replace the spawn node with a GetAllActorsOfClass node and get index 0? Not a permanent solution I would like to have in the toolkit, but if it works or not we have narrowed down what might be causing it a bit further.

I actually tried excactly that but to no avail. I’m starting to think it might actually be some kind of bug (probably on my end as I’ve migrated my previous project into your toolkit) because recreating the BP_TurnManager as a new actor seems to work as expected. Anyways, if I get it working like this at least I can post here how I fixed the other stuff (ServerTravel with switching GameModes and calling HandleStartingNewPlayer instead of OnPostLogin (since that does not get called during ServerTravel)) so someone else in my shoes can get it working aswell (or if you find it interesting for the future multiplayer features of the toolkit).

Thanks again for all the feedback and help, really really appreciate it :slight_smile:

It seems like this issue goes beyond just your issues. In my current internal build the same issue is appearing when playing the game as a standalone. It is thankfully not an issue in the version currently on the marketplace, but the issue I am seeing seems like the same you are having. Test this to see if you have the same problem:

Add a mesh or any visual component to the turn manager so that it is visible. Place a turn manager actor in the game so you can see it. Use regular play in editor and confirm that it is there. Then play as standalone. If we are having the same issue the turn manager should not appear. It seems like it is deleted before the game even starts and is not allowed to be spawned. It is a very strange issue and I’m working hard on finding a cause.

Ok, I did as you asked. When using a static mesh on the BP_TurnManager and playing using PIE I can see both the manually added TurnManager aswell as the spawned one (I moved the manually played one and the spawned one spawns at 0,0,0) and everything fires as it should. When using Standalone neither of the TurnManagers are visible and the initialize is never fired (nor is any other event on the TurnManager obviously). So it seems like it’s the same issue.
HOWEVER, what I found out now when I tried this is that Server Travel now seems to work in PIE mode! This was not the case just some time ago, I’m wondering if it’s due to a new update or if my knowledge simply was lacking the last time I tried this. So at least it seems like I might be able to continue work on my project in parallell to you finding the source of the Standalone bug (if it’s your bug or Epics that is).
If you want any more input from me or want me to try something else, please let me know. We can continue discussing here or on mail as to not spam too niche a solution for the whole thread.

Cheers man!

Edit: The result for launching the game by right clicking the uproject is the same as the standalone result fyi.

I’ve looked into this some more and it seems to be an issue with the engine and not the toolkit specifically. That means that identifying the issue is more difficult and I will have to find a workaround. Good thing it does not affect the version on the marketplace, but I will try to address it as soon as I’m able. After some testing it seems the FAction struct is somehow to blame. Adding this struct as a variable to a new blueprint actor and setting this struct to anything at begin play (or connected to any other event) causes the actor not to load when playing in standalone. However, creating a new, identical struct and doing the same thing with another actor causes no issue. It seems the action struct has become corrupted in my internal build (and probably in yours as well).

Can you test the same thing and see if it happens on your end? Making a new actor with a FAction struct variable and setting that variable at begin play (using “make array” to make empty input arrays). That will help me pin down if we’re seeing the same issue.

Edit: Changing all references to FAction to a new identical struct fixed the problem. Extremely tedious work, but it got the job done. Confirms that this was caused by something specific to the FACtion struct, but not due to any properties of the struct itself. Some weird engine bug it seems.

I did as you said and I got it working! Thank god it was an engine bug, I thought I was going mad :smiley:

Ok, so now on to MUCH more fun questions :stuck_out_tongue: I’m looking to make a kind of “deployment phase” before the first turn starts. In this “Deployment Phase” I would like to have a few predetermined tiles that are ok to deploy on, where your chosen character from the lobby (this I think I know how to do already) will show on the OnHovered-tile and be placed upon a click. When all connected players have done this the first turn will begin (or maybe I will add a button saying ready to begin but that is a minor fix).

Do you have any ideas on where to start digging to get this going? I’m thinking some things must be added in the TurnManager of course, but also making some tiles deployable and most not is a big thing. Also, the hover and click actions.
Anyways, very tired so sorry if my explanation is scattered. I will clarify if you need it.

Cheers man!
Mivke

Hello, I am new to UE4 (I have looked at most of the needed tutorials and all of yours). I really like this toolkit and I plan on using it for Fire Emblem fangames, but when the time comes for me to make an original license I want to try a different gameplay style. Now that there is an action queue, how flexible would it be to develop a we-go game with simultaneous turns? What I mean by this is that you have a command phase where you plan your actions with no limitations other than that they would take longer to execute, and when you decide your plan you go onto the execution phase and can execute all actions in the order you put them in alongside the AI and other players executing their actions. The reason why I want to do something like this is because I want to make a strategy/fighting game hybrid, where time and execution time is very important as the game is balanced around frame data (Startup, active, recovery, and the move’s hit/blockstun) but played like a strategy game so that you can carefully plan every encounter and can have more interesting map design for interactions rather than a 2d plane. I know things like these are possible seeing as there are many simultaneous turn games already, but how feasible would it be to use the toolkit’s system for the command phase and then use a modified action queue that makes everything run at the same time in the execution phase?