Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hi Knut, thanks for your answer around my multiplayer questions. As I mentioned I focused on pass and play for my project.

    In order to play test with friends, I’ve been trying to leverage Remote Desktop softwares, or screen sharing with control with programs like Zoom. That way the game is running on my computer and players are controlling the actions remotely, so it sort of simulates online play. However, there are some issues like the connection being laggy, and the fact that it requires me to host locally on my computer.

    I’m wondering if you have any experience or ideas around this or other similar approaches. In other words, what is the best way you can think of for allowing people to access the game online without actually needing to make an online compatible game, since we discussed the challenges there. Also thought it may be a useful idea to mention here in case people hadn’t considered it.

    Comment


      wath is need to set ?

      Comment


        Originally posted by Reinhart_x View Post
        Hey Monokkel, first time posting in the thread but I'm another one of those long time lurkers and owners of the toolkit, I believe since 2015 Thanks for doing a great job with all of the updates over the years as I've checked back in periodically to see how things are going and I'm always impressed with the improvements!

        I've recently been inspired and have begun working on my own project, but I wanted to see if you had at least part of a solution to what I'm trying to accomplish. So what I'm looking at doing is having an amount of points that each player is allowed to spend on various unit types that each have their own cost. This should be simple enough by adding a "cost" stat to the units and referring to it when building your team, but the tricky part is I'd like to have it where some types of units are actually groups of individual units - not just a stack of units HoMM style - and these groups would be called Troops. For example, let's say we take the generic ranged unit from the default map and pretend he's part of a Troop called Gun Guys that costs 50 of your allotted points: it would be a group of 3 of that same exact ranged unit, all have the same stats, abilities, etc.

        The first goal here is to be able to purchase Troops in multiples; if I were to spend 150 points on Gun Guys I'd get 9 ranged units total. This may not be as difficult as I'm making it out to be, I just may have not figured it out because I'm not sure how to group the units, which leads me to the next goal.

        The second goal, which is what I was looking to get help with the most, is to be able to have these Troops play in a certain manner compared to regular solo units. So in the game a player takes a turn with a unit and then the next player may take a turn with a unit and so on. What I'd like from the Troops is when it's their turn you are allowed to take a turn with up to their base amount of units: using the example from before, I have 9 Gun Guys units on the map, and since Gun Guys is a Troop made up of 3 units, I may take a turn with up to any 3 Gun Guys units I own no matter where they are located before the turn passes to the next player.

        Hopefully I explained that all well enough and didn't drone on for too long, I just wanted to get things out as clearly as I could. I'd appreciate any help you could give me and I realize the whole points thing doesn't necessarily align with the toolkit from it's base features, but if anything I was most curious if the multiple unit group turn was able to be done and figured the points explanation might give some insight into my overall direction of having a scaling group of individual units. Thanks again!
        ​​​

        2015 is when the toolkit was released, so that is about as long as would be possible Glad you have the time to work on a project with ATBTT now. I'm afraid that despite your through explanation I'm still a bit confused about what you want to achieve. I don't really understand how the troops are different from HoMM troops? Is it just related to how many actions you are allowed to use with them and how much they cost? Are you struggling with creating a UI for buying specified numbers of troops or is that not the case? Getting the cost of three units of a type is of course as simple as taking the cost variable and multiplying it by the amount of troops, so I'm guessing you're asking something different.

        The final question is a bit more clear. You have a set number of actions before your turn ends, and units with more troops in them take more actions to use their abilities. Is that correct? If so you could keep a PlayerActionPoints integer variable in the Game State, and when you would normally subtract unit CurrentAP in an ability you would instead subtract it from this value (multiplied by a NuberOfTroops variable or the like, which you can add to your "troop holder" unit). Then you would check the value of this PlayerActionPoints, and if it is 0 you would call EndActiveFactionTurn from the TurnManager. I'm probably not answering your question precisely here, as I am a bit confused, so please give me some more info now that you have heard my interpretation of it.

        Originally posted by behappyandsm1le View Post
        Hi Knut, thanks for your answer around my multiplayer questions. As I mentioned I focused on pass and play for my project.

        In order to play test with friends, I’ve been trying to leverage Remote Desktop softwares, or screen sharing with control with programs like Zoom. That way the game is running on my computer and players are controlling the actions remotely, so it sort of simulates online play. However, there are some issues like the connection being laggy, and the fact that it requires me to host locally on my computer.

        I’m wondering if you have any experience or ideas around this or other similar approaches. In other words, what is the best way you can think of for allowing people to access the game online without actually needing to make an online compatible game, since we discussed the challenges there. Also thought it may be a useful idea to mention here in case people hadn’t considered it.
        Hmm, I know that Steam has Steam Remote Play, which is essentially simulating couch co-op over Steam. It works out of the box for anything that supports couch co-op on steam, but I am unsure if you are able to use it through the regular Steam API that UE4 uses. Worth checking out, though.

        Originally posted by ser.man94 View Post
        wath is need to set ?
        If you want the tile markers to appear correctly on a landscape, set Heightmap in BP_GridManager to OneLevel and set UseDecals (also in BP_GridManager) to true

        UOTE=GENESIS EMMANUEL;n1762345]
        GENESIS EMMANUEL

        Hi Monokkel,

        Great day! I intend to make a plan phase and execute phase in every turn encapsulating both individual unit of each team. For example, in a game where there are 2 opposing teams with 1 unit per team, the turn 1’s plan phase is when team A plans the unit’s movement and action then store it in a variable then team B does the same. Then the plan phase is done and the execute phase starts by implementing the stored variables for both team A and B at the same time. Then that ends the execute phase then turn 2 starts by going back to another plan phase. I would like to ask for your help on how to go about it please. [/QUOTE]

        Hi Emmanuel, that question is a bit more difficult than the one I thought you were asking on the store page. The first part of storing target locations for abilities and then executing them automatically at a later point is a bit of a challenge, but very much doable. The second part of having all of those actions play out simultaneously is a much larger challenge. It goes against an assumption built into the toolkit, which is that actions resolve serially. That is not to say it is impossible to work around it, but you will need to be creative and put in a lot of work.

        Let me give you something to get started if you still want to give it a try, though.

        First I've created a duplicate of BP_Unit_Anim that I've called BP_Unit_Simultaneous. It is identical, except that it also has a variable called MoveTargetIndex, that it uses to store a grid index it has previously chosen to move to. I set the default to '-1', which I will later use as an indicator of the value being "empty".

        Then I create a duplicate of BP_Ability_Move, which I've called BP_Ability_SimuMove. I make a few changes to it.

        In EventServerInteract, after checking that a clicked tile is valid, I check if the owning unit has a value other than '-1' stored in its MoveTargetIndex variable. If not I set this value to the clicked tile and end the unit's turn (setting CurrentAP to 0 and calling SignalAbilityExecuted). If it does have a stored value, I set ClickedIndex to this value, and continue the execution chain as if this tile had just been clicked.



        Make sure to remove the SignalAbilityExecuted at the far right of the Click comment box so it is not called twice.

        Now at PlayActivate, after RunPathfinding is called I check if there is a MoveTargetIndex stored from last turn. If not, then I activate the ability as normal. If there is one, however, I call ServerInteract with the stored variable as input, essentially simulating a click on the stored tile immediately after the ability is activated at the start of the unit's turn:



        So far so good. We now have a setup where each unit chooses their move target first, and then we play both of them automatically, in sequence:




        To get them moving simultaneously we need to get a bit hacky. Ideally you would want to make some major modifications to the ActionManager to keep it clean. Here is a starting point, at least.

        In the Move comment box in Event Graph of BP_Unit i set the InstantDeactivate input in both QueueAction macros to true. This means that the action manager will immediately skip to the next action as soon as this movement has started. I also Remove the EndAction call that is called at the end of the MoveTimeline, since EndAction is called automatically if InstantDeactivate is true.

        What we have now looks like this:



        Almost there, but there is an issue. Since we just skip over all actions, the toolkit has no way of knowing that is should wait to start the next turn, so the next turn is starting immediately, with a new pathfinding being generated from where one of the units ends up after it has moved. Normally the TurnManager would wait for all queued actions to end before doing, so but since we're calling EndAction immediately this does not happen.

        To get around this I add a new variable to BP_Unit that is set to true while it is animating and then false when it is done. When the turn manager wants to start a new turn it continously checks if all units have animating set to false before starting the next turn. I set bAnimating to true at the start of MoveToIndex in BP_Unit and set it to false where I would normally call EndAction after a move (Bottom right in the Move Timeline comment box).

        Then I add the following function to BP_TurnManager that checks if there are currently any animating units:



        and I do a delayed loop on BeginNewTurn that does not start a new turn until no more units are animating:



        And finally we have simultaneous movement that looks decent:



        Ok, so that is something, at least. You would of course need to modify all other abilities in a similar fashion, designing around issues such as two players selecting the same tile etc. This is to show that while simultaneous turns are not inherently impossible, I would not recommend going that way unless you feel extremely confident in both your blueprinting abilities and your knowledge of the inner workings of this toolkit.

        I'm sorry that I didn't completely understand your question when you asked it in the store page. I hope you did not buy the toolkit under the assumption that implementing simultaneous turns would be easy, based on my reply. If so, feel free to ask Epic for a refund request on the toolkit. It is, in its present state at least, tricky to work with if you plan to make a game that is not fully turn based.
        Advanced Turn Based Tile Toolkit (Marketplace - Support)

        Dungeon Crawler Toolkit (Marketplace - Support)

        Discord

        Comment


          Originally posted by Monokkel View Post

          Hi, I'm not able to replicate this issue. Could you give me the repro steps?



          Here is a starting point:

          Create a duplicate of BP_Unity_Anim. Remove the HealthBar component and the functions referring to it (ModifyHealthBar and SetupHealthBar). Add a text render component to display the unit amount (a bit basic, but works for demo purposes). Enable tick and rotate the text render to face the camera on tick:



          Add a function to update the amount text:



          In this setup I'm calculating the number of units through CurrentHealth. So for instance if current health is three times max health there are three units. Add these functions to find the current amount of units and to get the amount of units based on an input health value:




          Create an instance editable StartingAmount integer value to be able to set the amount in the editor or on spawn. Also update the amount text in the construction script:


          So far so good. Now we want to create an ability that modifies damage based on the number of units. We also want it to pass the amount of remaining units after an attack to the action system, so we can modify the number at the appropriate time.

          For this example I've duplicated BP_Ability_MoveAttack. In ExecuteAbility I calculate damage using the unit amount and store it in a local variable. Then I feed this into The Attack queued action and TakeDamage event. Note that in the attack action I'm feeding the remaining amount of units after damage instead of the damage value I use in BP_Ability_MoveAttack:



          In AnimateAction I feed it into the Attack event (which I've changed to take an integer parameter):



          and then within said action I pass it on to the action to be executed on the target unit:



          We follow the action to where it is animated, where we update the amount text and decide if the unit is to go through its death animation code based on the remaining number of units that we passed:



          And finally there you have it:







          Hi RTE, the best way to do this is not to use multiple grid managers, but rather to extend the existing grid manager. I will show you a simple setup that will give you a starting point for what you're describing.

          First I've created a 3*3 tile blueprint. It has nothing except some square tile meshes and there is no code in it. The root is under the central tile.



          Then in BP_GridManager I've created a simple setup that gets the location of the tile under the cursor when you press space bar and spawns one of these 3*3 tile actors there. The code I use to get the appropriate location outside the original grid should probably be a utility function in itself. I'll include something like it in the next update.

          After spawning it I use the new UpdateTilesInRange function to add the tiles in the area around the new actor to GridLocations and GridEdges. The next time a RunPathfinding function is run, these will now be included in the search if in range.



          You would proably want to do something like this through something else, depending on your needs. An ability is what I would have gone for.

          For testing I've added a map with a 3*3 BP_GridManager as well as a large Plane mesh for blocking the mouse trace events in GetHitTileLocationAndIndex:



          And there you go:



          Note that you cannot add tiles that have negative relative X and Y coordinates to BP_GridManager. Just make sure to build your map within the constrainst of where the grid manager would expand to if you were to increase GridSizeX and GridSizeY.
          Hi Monokkel,

          Using the newest version of the toolkit we got the tiles to spawn how we want them using our own meshes, but instead of using the UpdateTilesInRange function we are using a box trigger and spawn the tiles where we want them to.
          Click image for larger version  Name:	test_tile_board.PNG Views:	0 Size:	110.0 KB ID:	1762824
          Do you see any potential issues doing it this way?

          https://imgur.com/a/ZlTS1Vl

          Also, why do we get an infinite loop error if we try to make the grid bigger than 100x100? How would you suggest we prevent tiles from spawning outside the bounding box? We do have a finite amount of tiles to spawn in mind (36 in total) but it appears it COULD go outside the bounding box because we will have corner tiles that allow the players to extend left or right.
          Last edited by RTE1984; 05-17-2020, 05:50 PM.

          Comment


            Originally posted by RTE1984 View Post

            Hi Monokkel,

            Using the newest version of the toolkit we got the tiles to spawn how we want them using our own meshes, but instead of using the UpdateTilesInRange function we are using a box trigger and spawn the tiles where we want them to.
            Click image for larger version Name:	test_tile_board.PNG Views:	0 Size:	110.0 KB ID:	1762824
            Do you see any potential issues doing it this way?

            https://imgur.com/a/ZlTS1Vl

            Also, why do we get an infinite loop error if we try to make the grid bigger than 100x100? How would you suggest we prevent tiles from spawning outside the bounding box? We do have a finite amount of tiles to spawn in mind (36 in total) but it appears it COULD go outside the bounding box because we will have corner tiles that allow the players to extend left or right.
            I might have explained it a bit poorly. UpdateTilesInRange is necessary for the setup that I'm suggesting. You see, the Grid Manager is always of size 999*999 tiles. GridSizeX and GridSizeY simply defines the area that the Grid Manager adds to the GridLocations and GridEdges arrays at startup. So you do not need to have a super high grid size, since you are doing this manually as needed (using UpdateTilesInRange).

            As for placing stuff outside the bounding box, I recommend simply adding your starting tiles at the center of the grid (999 tiles divided by two, times the default tile size of 200 UU ~= X: 10 000, Y: 10 000). Then you can add tiles in any direction without crossing the boundary.
            Advanced Turn Based Tile Toolkit (Marketplace - Support)

            Dungeon Crawler Toolkit (Marketplace - Support)

            Discord

            Comment


              Hi Monokkel,

              I was wondering how did you make the health bars for two reasons. 1. I want to make my own health bar art and 2. I want to place in these Icons that can be swap and change during the gameplay to tell the player what element type the unit is.

              Secondly, how do I add animations to the pre existing animation blueprints and lastly, how to switch gamemodes so when the player is in the main menu its not ATTB but when they open and level it is ATTB.

              Thanks, EagleEyeGamma.
              Last edited by EagleEyeGamma; 05-18-2020, 01:04 PM.

              Comment


                Good day i can"t found this blue print BP_Unity_Anim can you just add a scene to the nex update with multiple creature on hexagons and add plea a return attack one time at turn the mele respond to melee and range to range. thankyou vary much.

                Comment


                  Originally posted by Monokkel View Post

                  I might have explained it a bit poorly. UpdateTilesInRange is necessary for the setup that I'm suggesting. You see, the Grid Manager is always of size 999*999 tiles. GridSizeX and GridSizeY simply defines the area that the Grid Manager adds to the GridLocations and GridEdges arrays at startup. So you do not need to have a super high grid size, since you are doing this manually as needed (using UpdateTilesInRange).

                  As for placing stuff outside the bounding box, I recommend simply adding your starting tiles at the center of the grid (999 tiles divided by two, times the default tile size of 200 UU ~= X: 10 000, Y: 10 000). Then you can add tiles in any direction without crossing the boundary.
                  Hi Monokkel,

                  I'm still confused, so should we be using the UpdateTilesInRange function with how we're spawning them? Will that prevent the issue of ever going out of bounds?

                  Comment


                    Originally posted by EagleEyeGamma View Post
                    Hi Monokkel,

                    I was wondering how did you make the health bars for two reasons. 1. I want to make my own health bar art and 2. I want to place in these Icons that can be swap and change during the gameplay to tell the player what element type the unit is.

                    Secondly, how do I add animations to the pre existing animation blueprints and lastly, how to switch gamemodes so when the player is in the main menu its not ATTB but when they open and level it is ATTB.

                    Thanks, EagleEyeGamma.
                    The health bars are very basic. They are a material billboard with a material parameter that fills to a specified point (Check out the M_HealthBar material). I used a material billboard as a way to limit the amount of ticking actors, as a billboard will always face the camera without the need of a ticking event.

                    However, if you want to make something more fancy, setting everything up in a material becomes quite awkward, and I recommend using a widget blueprint which you rotate to face the camera on tick. Check out the EventTick of BP_Unit_Anim_VR for how to get the camera location and rotate the health bar. For this actor, a mesh is used, but a widget is probably better for your purposes.

                    For the animation blueprint question I'll assume that you know how you would normally add animations to an animation blueprint in UE4 more generally. It works much the same in ATBTT, but there are some quirks because of the action system. The way BP_Unit is set up, any action that is passed to AnimateAction in BP_Unit that does not have an implementation (not found in the name switch after AnimateAction) is passed to the AnimateUnit function. In BP_Unit_Anim this function is overridden so that it further passes along the action to the animation blueprint. Then within the animation blueprint you can decide how the unit animates based on the incoming action.

                    To take it step by step, if you call QueueAction with ExecutingActor = a BP_Unit reference and ActionName = "Jump", this is passed to the action manager. The action manager then goes through all queued actions until it reached this action, at which point it calls AnimateAction on the referenced BP_Unit, passing in the stored FAction struct. BP_Unit then looks at the name of the action, and as there is no "Jump" defined in the name switch it goes to its default value, calling the AnimateUnit function. In BP_Unit_Anim this causes the unit to call AnimateAbility in ABP_Unit. Another name switch checks the name of the action. Since it finds no "jump" in the switch, it goes for the default, which is an attack animation. To implement your jump animation you would add the name to the switch in ABP_Unit and then call whatever code you want to animate the unit.

                    Originally posted by ser.man94 View Post
                    Good day i can"t found this blue print BP_Unity_Anim can you just add a scene to the nex update with multiple creature on hexagons and add plea a return attack one time at turn the mele respond to melee and range to range. thankyou vary much.
                    Hi ser.man, I don't think those are generic enough features that I'd want to include them in the base toolkit. I might do something like that in an example map at some point, but I have many other things on my list before I get to something like that. I can help you to implement it in your game, though. When you're saying multiple creatures on hexagons, what exactly do you mean? Something like in Civilization, where they are really a single unit, but has multiple skeletal meshes? Or something else?

                    Also, could you elaborate on what you mean with responding? Are you talking about something like a counterattack? That triggers whenever the unit is attacked?

                    Originally posted by RTE1984 View Post

                    Hi Monokkel,

                    I'm still confused, so should we be using the UpdateTilesInRange function with how we're spawning them? Will that prevent the issue of ever going out of bounds?
                    Yes, if you do not update the underlying arrays (GridLocations and GridEdges) the GridManager does not know that the new tiles exist. Adding a mesh somewhere does nothing in itself. UpdateTilesInRange looks at the collision of meshes etc. in a defined tile area and adds them to the grid arrays as appropriate.

                    The bounds mean that you can never go lower than 0 on the X or Y axes relative to the in-game location of the grid manager. That is not really a problem, though, as you can just place the tiles your units start on to the very center of the grid (which always has a size of 999*999 tiles). You can use UpdateTilesInRange for this as well, but subgrids are simple for predefining areas of the grid that you want to be added to the grid at startup.

                    So we GridSizeX and GridSizeY to 1 (maybe I should allow a size of 0 in the future), since we don't want to add any tiles in the far northwest corner of the grid. Then we add a BP_Subgrid at X=100000 and Y = 100000 (the center of the grid). We place a unit on this subgrid. Now we can add new tiles during runtime in any direction:


                    Advanced Turn Based Tile Toolkit (Marketplace - Support)

                    Dungeon Crawler Toolkit (Marketplace - Support)

                    Discord

                    Comment


                      Originally posted by Monokkel View Post

                      The health bars are very basic. They are a material billboard with a material parameter that fills to a specified point (Check out the M_HealthBar material). I used a material billboard as a way to limit the amount of ticking actors, as a billboard will always face the camera without the need of a ticking event.

                      However, if you want to make something more fancy, setting everything up in a material becomes quite awkward, and I recommend using a widget blueprint which you rotate to face the camera on tick. Check out the EventTick of BP_Unit_Anim_VR for how to get the camera location and rotate the health bar. For this actor, a mesh is used, but a widget is probably better for your purposes.

                      For the animation blueprint question I'll assume that you know how you would normally add animations to an animation blueprint in UE4 more generally. It works much the same in ATBTT, but there are some quirks because of the action system. The way BP_Unit is set up, any action that is passed to AnimateAction in BP_Unit that does not have an implementation (not found in the name switch after AnimateAction) is passed to the AnimateUnit function. In BP_Unit_Anim this function is overridden so that it further passes along the action to the animation blueprint. Then within the animation blueprint you can decide how the unit animates based on the incoming action.

                      To take it step by step, if you call QueueAction with ExecutingActor = a BP_Unit reference and ActionName = "Jump", this is passed to the action manager. The action manager then goes through all queued actions until it reached this action, at which point it calls AnimateAction on the referenced BP_Unit, passing in the stored FAction struct. BP_Unit then looks at the name of the action, and as there is no "Jump" defined in the name switch it goes to its default value, calling the AnimateUnit function. In BP_Unit_Anim this causes the unit to call AnimateAbility in ABP_Unit. Another name switch checks the name of the action. Since it finds no "jump" in the switch, it goes for the default, which is an attack animation. To implement your jump animation you would add the name to the switch in ABP_Unit and then call whatever code you want to animate the unit.



                      Hi ser.man, I don't think those are generic enough features that I'd want to include them in the base toolkit. I might do something like that in an example map at some point, but I have many other things on my list before I get to something like that. I can help you to implement it in your game, though. When you're saying multiple creatures on hexagons, what exactly do you mean? Something like in Civilization, where they are really a single unit, but has multiple skeletal meshes? Or something else?

                      Also, could you elaborate on what you mean with responding? Are you talking about something like a counterattack? That triggers whenever the unit is attacked?



                      Yes, if you do not update the underlying arrays (GridLocations and GridEdges) the GridManager does not know that the new tiles exist. Adding a mesh somewhere does nothing in itself. UpdateTilesInRange looks at the collision of meshes etc. in a defined tile area and adds them to the grid arrays as appropriate.

                      The bounds mean that you can never go lower than 0 on the X or Y axes relative to the in-game location of the grid manager. That is not really a problem, though, as you can just place the tiles your units start on to the very center of the grid (which always has a size of 999*999 tiles). You can use UpdateTilesInRange for this as well, but subgrids are simple for predefining areas of the grid that you want to be added to the grid at startup.

                      So we GridSizeX and GridSizeY to 1 (maybe I should allow a size of 0 in the future), since we don't want to add any tiles in the far northwest corner of the grid. Then we add a BP_Subgrid at X=100000 and Y = 100000 (the center of the grid). We place a unit on this subgrid. Now we can add new tiles during runtime in any direction:

                      Hi Monokkel,

                      So, how would I add the UpdateTilesInRange function to the blueprint code below? This is in the mesh blueprint with the trigger box, so a tile always spawns in front. The clicking on a spot method doesn't work with the way the game is designed.

                      Would the UpdateTilesInRange function prevent the player from being able to click outside the mesh because there are still invisible tile spaces to click on? Would need it so they can not click outside the existing mesh that is spawned. I suppose I could use invisible walls.

                      Also, it seems like the obstacles will block the spaces just fine as long as the meshes are always lined up exactly with the gird below.Click image for larger version  Name:	obstacleTest.jpg Views:	0 Size:	88.8 KB ID:	1763891
                      Click image for larger version  Name:	image_192353.png Views:	0 Size:	110.0 KB ID:	1763890
                      Last edited by RTE1984; 05-19-2020, 07:22 PM.

                      Comment


                        Hi Knut, Alex from Youtube here.

                        I had a question about the tile movement costs. I had asked about the 0.5AP tile movement cost, but what I had meant to ask was - How can I make movement reduce AP per tile? I'd like to be able to move one tile at a time without ending the movement ability but I can't find where to accomplish this. I also would like to be able to move after using certain abilities, but moving once costs my AP, and ends that part of my turn. Is this easily adjusted somewhere?

                        Comment


                          Originally posted by Monokkel View Post
                          ​​​

                          2015 is when the toolkit was released, so that is about as long as would be possible Glad you have the time to work on a project with ATBTT now. I'm afraid that despite your through explanation I'm still a bit confused about what you want to achieve. I don't really understand how the troops are different from HoMM troops? Is it just related to how many actions you are allowed to use with them and how much they cost? Are you struggling with creating a UI for buying specified numbers of troops or is that not the case? Getting the cost of three units of a type is of course as simple as taking the cost variable and multiplying it by the amount of troops, so I'm guessing you're asking something different.

                          The final question is a bit more clear. You have a set number of actions before your turn ends, and units with more troops in them take more actions to use their abilities. Is that correct? If so you could keep a PlayerActionPoints integer variable in the Game State, and when you would normally subtract unit CurrentAP in an ability you would instead subtract it from this value (multiplied by a NuberOfTroops variable or the like, which you can add to your "troop holder" unit). Then you would check the value of this PlayerActionPoints, and if it is 0 you would call EndActiveFactionTurn from the TurnManager. I'm probably not answering your question precisely here, as I am a bit confused, so please give me some more info now that you have heard my interpretation of it.
                          No worries! I know my explanation was not the clearest but I think I've figured out how to describe it after your response.

                          So what I meant by not having them be like HoMM units is that I'm not looking for them to stack in a troop holder unit, but rather have them be in a grouping of individual units that all take their turn before the next player would go. I think an image may help me to explain further:

                          Click image for larger version

Name:	rsz_exampleoftroops.png
Views:	185
Size:	505.5 KB
ID:	1764000

                          In this image I have the default project opened, but I've added 4 units to my team which are the gray aliens on the right. These 4 aliens are part of a set grouping, a package deal if you will. So if you spend the points to buy "alien squadron" in the team building portion, you get 4 individual alien units.

                          Let's say we pressed play to test things out: what I'd like to happen is to have these 4 independent units be part of a single turn. In my game I would like players to take turns back and forth, so I take the first turn with one of the green debug units, then the enemy takes a turn with a unit they chose, and when the turn comes back to me I decided to take a turn with "alien squadron." So during the "alien squadron" turn all of the aliens would get to move and attack individually before the enemy gets their next turn.

                          I hope that helped clear up things a bit. It seems like it may be a bit of a challenge to get this to work, but it seems like it could be possible. Maybe using some way of assigning certain initiative values to each unit? The one thing I left out is I want rounds of play to happen where at the beginning of each round each player picks like 3 units to use for that round and they also then choose the order they want to use them in. Perhaps there's a way to assign initiative at that time to not only have the turns go back and forth in the proper order but also allow for what I'm trying to do.

                          Thanks for all your help and if I need to explain any better I'm always happy to do so!

                          Comment


                            Hey do you know if 2.6 is live yet?
                            Id love to see how you get the camera bounds done.

                            Comment


                              Originally posted by RTE1984 View Post

                              Hi Monokkel,

                              So, how would I add the UpdateTilesInRange function to the blueprint code below? This is in the mesh blueprint with the trigger box, so a tile always spawns in front. The clicking on a spot method doesn't work with the way the game is designed.

                              Would the UpdateTilesInRange function prevent the player from being able to click outside the mesh because there are still invisible tile spaces to click on? Would need it so they can not click outside the existing mesh that is spawned. I suppose I could use invisible walls.

                              Also, it seems like the obstacles will block the spaces just fine as long as the meshes are always lined up exactly with the gird below.Click image for larger version Name:	obstacleTest.jpg Views:	0 Size:	88.8 KB ID:	1763891
                              Click image for larger version Name:	image_192353.png Views:	0 Size:	110.0 KB ID:	1763890
                              No need for clicking. That was just a quick way to debug it. UpdateTilesInRange can take either a location or GridIndex as input. So get the center of your multi-tile actor as location input. and add a range that will encompass it.

                              Originally posted by [B
                              Luna2442[/B];n1763889]Hi Knut, Alex from Youtube here.

                              I had a question about the tile movement costs. I had asked about the 0.5AP tile movement cost, but what I had meant to ask was - How can I make movement reduce AP per tile? I'd like to be able to move one tile at a time without ending the movement ability but I can't find where to accomplish this. I also would like to be able to move after using certain abilities, but moving once costs my AP, and ends that part of my turn. Is this easily adjusted somewhere?
                              Hi Alex! Your message is not approved by Epic yet (takes a bit for your first post). Thankfully I can see it, since this is my thread.

                              So a movement cost of 0.5 is not possible with the current setup. However you can always double it, so that edges that would cost 0.5 cost 1, while those that would cost 1 cost 2. Default tile costs are set in the various "AddTileEdges" functions (there are one for each heightmap option). This is what you would modify if you want something that affects the movement of all units. I don't know exactly what your end result is, so I cannot give you more suggestions than that without some more info.

                              For your second question of reducing AP per tile, that is a setting in the different included movement ability blueprints. It is the "MoveCostType" variable, which is in BP_Ability. Choose "FromPathfindingCost" is probably what you want. You would want to increase unit AP so they can move more than 2 tiles, and increase the cost of attack abilities as appropriate (or set bUseEndsTurn to true for these, if that is what you're going for).

                              If you tell me more I can help you more. How would a unit turn from start to end look in your game? What edges should have a cost of 0.5 and which should have a different cost? What is the intention behind the cost differences here?
                              Originally posted by Reinhart_x View Post
                              No worries! I know my explanation was not the clearest but I think I've figured out how to describe it after your response.

                              So what I meant by not having them be like HoMM units is that I'm not looking for them to stack in a troop holder unit, but rather have them be in a grouping of individual units that all take their turn before the next player would go. I think an image may help me to explain further:

                              Click image for larger version

Name:	rsz_exampleoftroops.png
Views:	185
Size:	505.5 KB
ID:	1764000

                              In this image I have the default project opened, but I've added 4 units to my team which are the gray aliens on the right. These 4 aliens are part of a set grouping, a package deal if you will. So if you spend the points to buy "alien squadron" in the team building portion, you get 4 individual alien units.

                              Let's say we pressed play to test things out: what I'd like to happen is to have these 4 independent units be part of a single turn. In my game I would like players to take turns back and forth, so I take the first turn with one of the green debug units, then the enemy takes a turn with a unit they chose, and when the turn comes back to me I decided to take a turn with "alien squadron." So during the "alien squadron" turn all of the aliens would get to move and attack individually before the enemy gets their next turn.

                              I hope that helped clear up things a bit. It seems like it may be a bit of a challenge to get this to work, but it seems like it could be possible. Maybe using some way of assigning certain initiative values to each unit? The one thing I left out is I want rounds of play to happen where at the beginning of each round each player picks like 3 units to use for that round and they also then choose the order they want to use them in. Perhaps there's a way to assign initiative at that time to not only have the turns go back and forth in the proper order but also allow for what I'm trying to do.

                              Thanks for all your help and if I need to explain any better I'm always happy to do so!
                              Thanks, I think I mostly get it now. This mostly comes down to array manipulation of the InitiativeOrder array. The devil is in the details, of course. Before I jump into this (will take some work) let me try to describe what you are saying back to you, so I'm sure I've got it.

                              Players will have different units. Some of these will be individual units not part of a troop (like the green units above), while others belong to a troop (the aliens). At the start of a player turn you choose what unit to move. After the unit has done its action, if the unit is an individual unit the turn will pass to the next player. If it is part of a group the turn will pass to the next unit in the group, controlled by the same player, until the last unit in the troop has completed its action, at which point the turn is passed to the next player. Is this the right interpretation?

                              A follow-up to that: should a player be able to choose the same unit or troop again and again, or do they have to exhaust all units and troops before they are allowed to choose freely on their next turn?

                              Also, love the paint job on the debug wall tiles

                              Originally posted by LDodds View Post
                              Hey do you know if 2.6 is live yet?
                              Id love to see how you get the camera bounds done.
                              2.6 is out! Generally I sync ATBTT updates to UE4 updates, so the version you get from the launcher if you create a new project with ATBTT and select UE4.25 is 2.6. I see now that it says 2.52 in the description and comments, though... I decided last minute to change the version number to a full update, since it was more to the update than simple bug fixing, but seems like I forgot to give the project description the memo... That is just a number, though. Everything from the update is there.
                              Advanced Turn Based Tile Toolkit (Marketplace - Support)

                              Dungeon Crawler Toolkit (Marketplace - Support)

                              Discord

                              Comment


                                no
                                1 you show but not ful description i not found the files from descriptin. i atach te image.
                                and the second is to enemy make a return atack i one turn.
                                i ad the video with fight on hmm3. https://www.youtube.com/watch?v=KB9Q7RV9oAs

                                Attached Files

                                Comment

                                Working...
                                X