Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Originally posted by Monokkel View Post
    If you choose to convert to the newest version and run into any problems I can help with, let me know
    Thank you, that's very kind of you to help!
    A quick question: in the new version, do we still have camera bounds to restrict the panning and edge scrolling?

    Comment


      Originally posted by Monokkel View Post

      Hey Kon, sorry about skipping your question earlier. For someone's first post Epic usually take a while to approve it, to prevent spam, so it did not show up for me until now.

      Interesting question, though. In your case you basically have two different grids, where one is overlaying the other. One way to do this would be to make a separate GridEdges TMap for large units, which connects 1/4 of tiles to each other. That is probably the most efficient and clean way of doing things, but it would require running an additional, modified version of the GenerateGridEdges function at startup. In this function you would loop through the GridLocations keys, but skip any tile that is not in the "upper left" of your 2*2 tile sets. You could create this rule by checking the GridIndex and only adding edges for tiles where both GetX and GetY for that GridIndex is an even number.

      Now for each of these filtered out tiles you would connect them to all surrounding 2*2 tiles. This would mean using AddEdgeBothWays to [CurrentTile - 1998], [CurrentTile - 2000] [... -2002, +2, +2002, +2000, +1998, -2]. The trickiest part would be making a modified function for removing edges that are blocked by terrain. This might involve something like using the regular TraceForWalls implementation, but changing from a line trace for walls to a box or sphere trace (maybe the size of a tile), where the start and end locations of each trace is shifted by [+100,+100,0] to trace between the centers of your 2*2 tile clusters.

      Lastly you would have to make a modified custom pathfinding function. You could modify the SearchAndAddAdjacentTilesBig function so that it uses your new custom GridEdges TMap instead of the regular one.

      Off the top of my head this is what I think I would do in your situation. There might be a solution that is simpler to implement where you can hack the SearchAndAddAdjacentTiles function to search for all tiles as usual, but only return the relevant ones, but I'm not able to think of a way right now. It would in any case be less performant.
      Dear Knut,
      Good day! Do not worry about the missed message, everything is fine!

      Thank you so much! I did it, it works!
      This is incredible, without your clues, I would spend much more time.
      The more I dive into the toolkit, the more I understand how much work has been done. This is amazing. Thanks again, and when the time comes, I hope we can surprise you with our game!


      Best wishes, Kon.

      Comment


        Is there a way to give specific tiles different attributes? Like if I wanted to set a tile on fire to make it do damage if walked through and give the unit a status effect of "on fire"?

        Comment


          Originally posted by FuTou View Post

          Thank you, that's very kind of you to help!
          A quick question: in the new version, do we still have camera bounds to restrict the panning and edge scrolling?
          That is not included in the latest version. I have not added it back since I did the major refactoring. I will put it on my list. Adding it is pretty simple, though. You can check the location of BP_GridCamera relative to some bounds defined by variables, or if it is no longer overlapping a defined boundry. Add a branch in the camera movement code that prevents it from executing if the resulting new location does not confirm to these bounds.

          Originally posted by Konruseyd View Post

          Dear Knut,
          Good day! Do not worry about the missed message, everything is fine!

          Thank you so much! I did it, it works!
          This is incredible, without your clues, I would spend much more time.
          The more I dive into the toolkit, the more I understand how much work has been done. This is amazing. Thanks again, and when the time comes, I hope we can surprise you with our game!


          Best wishes, Kon.
          Great! I was unsure if my reply was detailed enough, but I'm glad it worked! This toolkit has been in continuous development for almost five years at this point, so I'm happy it shows that I've put work into it

          Originally posted by Zennisin View Post
          Is there a way to give specific tiles different attributes? Like if I wanted to set a tile on fire to make it do damage if walked through and give the unit a status effect of "on fire"?
          Sure, that is certainly possible. The way I would do it is to leverage the object system. You can see this in use in the 2D game example for picking up items, opening doors and activation switches. You could modify the SimulateMove function in a Unit child blueprint so that it calls the InteractWithObjects function in BP_GridManager every time it takes a step. You would have stored the object in question (your burning tiles) at the appropriate tile in the GridObjects TMap using the AddObjectToGrid function in the GridManager.

          In your burning floor actor you would add the BPI_Interact interface and add an EventInteract interface event (again, check the items in the 2D map for examples). In this code you would then add the status effect to the unit passing through it. The trickiest part is getting the action system to display the burning effect at the appropriate time. You could perhaps do this by checking for collision with the flame object during animated movement.
          The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

          Comment


            Okay so I think this problem is more of a me being a newbie on UE/coding in general, so this might be a wrong place to ask this but here goes:

            I'm trying to make a some form of battle forecast window. I have the necessary stats set up on my units, (And alternatively on my ability) but I have no idea how to get the stats to my widget. What are the first steps to achieve this? Like I said I'm aware that this might be more of a UE4 thingy than ATBTT, so I'll do some research tomorrow and update if I manage to do that on my own.

            Comment


              Monokkel Is there any information when next update will be published?

              Comment


                Originally posted by Veijari View Post
                Okay so I think this problem is more of a me being a newbie on UE/coding in general, so this might be a wrong place to ask this but here goes:

                I'm trying to make a some form of battle forecast window. I have the necessary stats set up on my units, (And alternatively on my ability) but I have no idea how to get the stats to my widget. What are the first steps to achieve this? Like I said I'm aware that this might be more of a UE4 thingy than ATBTT, so I'll do some research tomorrow and update if I manage to do that on my own.
                You're right that this is more of a general Unreal Engine question. I recommend looking up documentation and tutorials on blueprint communication. What you want here is to access unit blueprint references through your UI. One way to do this is to get the initiative order array from the TurnManager through the singleton interface added to the game state. So basically, get a reference to the game state in the UI, get the TurnManager from it and then get the initiative order array to access the units and get their stats.

                Originally posted by histiz View Post
                Monokkel Is there any information when next update will be published?
                I did a lot of experimentation last week on an overwatch ability and got something that worked okay. However, while doing so I found a better and more general solution for playing actions within other actions, that worked for overwatch as well as other features. However I struggled to get it working with networked multiplayer. I want to fix that before uploading the next update. However, as I'm defending my PhD thesis on the 8th next months I don't have much time to develop before then. Therefore I have decided to simply upload the converted 4.21 project to Epic as the 4.22 update and add the new feature update as soon as it is done, which will hopefully be one or two weeks after my defense. Sorry about the delay, but life got in the way, and I don't want to release a half-finished feature to the developers here which is likely to change drastically just a few weeks later.
                The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                Comment


                  Originally posted by Monokkel View Post
                  I did a lot of experimentation last week on an overwatch ability and got something that worked okay. However, while doing so I found a better and more general solution for playing actions within other actions, that worked for overwatch as well as other features. However I struggled to get it working with networked multiplayer. I want to fix that before uploading the next update. However, as I'm defending my PhD thesis on the 8th next months I don't have much time to develop before then. Therefore I have decided to simply upload the converted 4.21 project to Epic as the 4.22 update and add the new feature update as soon as it is done, which will hopefully be one or two weeks after my defense. Sorry about the delay, but life got in the way, and I don't want to release a half-finished feature to the developers here which is likely to change drastically just a few weeks later.
                  Sounds good! Hopefully everything goes well with defending your PhD thesis.

                  Comment


                    Originally posted by Monokkel View Post
                    You're right that this is more of a general Unreal Engine question. I recommend looking up documentation and tutorials on blueprint communication. What you want here is to access unit blueprint references through your UI. One way to do this is to get the initiative order array from the TurnManager through the singleton interface added to the game state. So basically, get a reference to the game state in the UI, get the TurnManager from it and then get the initiative order array to access the units and get their stats.
                    Thanks that worked!
                    I think I may have found another bug, this time with that character switch: Switching units on the same faction back and forth works as a player 1, but when player 2 (faction doesn't matter here, it's always the faction that goes second) does it, it gets a stuck after one switch. Is this intended?

                    EDIT: While I'm at it here is another bug:
                    PassThroughFriendly movetype messes something up in pathfinding. If you have some way of moving twice in a single turn like the sprint command => pass through an ally with the first part of the move, your unit is able to move into the same tile as the ally unit. Sometimes the ally gets another move after "merging" with an ally too. [GIF]
                    Last edited by Veijari; 04-16-2019, 06:57 PM.

                    Comment


                      Originally posted by Monokkel View Post
                      Sure, that is certainly possible. The way I would do it is to leverage the object system. You can see this in use in the 2D game example for picking up items, opening doors and activation switches. You could modify the SimulateMove function in a Unit child blueprint so that it calls the InteractWithObjects function in BP_GridManager every time it takes a step. You would have stored the object in question (your burning tiles) at the appropriate tile in the GridObjects TMap using the AddObjectToGrid function in the GridManager.

                      In your burning floor actor you would add the BPI_Interact interface and add an EventInteract interface event (again, check the items in the 2D map for examples). In this code you would then add the status effect to the unit passing through it. The trickiest part is getting the action system to display the burning effect at the appropriate time. You could perhaps do this by checking for collision with the flame object during animated movement.
                      Thank you very much for this! I got it working so when I step on this specific tile the unit loses health!

                      I have another question for you, do you have somewhere I can attach to in order to trigger this tile at the start of every turn? So for each unit the user has, if it is still standing on the tile at the start of the their turn, each of them that are standing on one will take damage?

                      Comment


                        [QUOTE="Monokkel;n1597462"]




                        Ok, sorry if I was not as clear as I could be. See how far you get from my description and if you get stuck again I'll try to go more in depth.


                        Monokkel, Thanks for your proposal, I am stuck. Sorry, but I have not enought skill to do that by my self. But I ask for this solution (to add a button), because on mobile (android), touch input is not working well, I saw on trello that you mentionned there is a bug, and need to disconect event tick to allow touch input to work. But no result on my side. I am surprised not to see more comments on issue with mobile, am i the only one ?

                        Thanks for your help.

                        Comment


                          Hey Knut! First off, I'd like to say I'm loving this toolkit so far. You did a great job with it.

                          I've been trying to create an ability that allows a unit to spawn new AI units during a game and found a bug in the BP_Unit ConstructionScript. The link is missing from Sequence 1 to the Branch. It resulted in new units not being properly added to the grid and initiative order. Was there a reason this link is not there? I'm guessing it was deleted by accident.

                          Click image for larger version

Name:	BP_Unit-ConstructionScript.png
Views:	8
Size:	81.5 KB
ID:	1609173
                          Attached Files

                          Comment


                            Hey guys, sorry for the late reply. I've been busy. I've decided to upload the latest version after all, just without the incomplete overwatch stuff. Will hopefully be sent to Epic today.

                            Originally posted by histiz View Post

                            Sounds good! Hopefully everything goes well with defending your PhD thesis.
                            Fingers crossed!

                            Originally posted by Veijari View Post

                            Thanks that worked!
                            I think I may have found another bug, this time with that character switch: Switching units on the same faction back and forth works as a player 1, but when player 2 (faction doesn't matter here, it's always the faction that goes second) does it, it gets a stuck after one switch. Is this intended?

                            EDIT: While I'm at it here is another bug:
                            PassThroughFriendly movetype messes something up in pathfinding. If you have some way of moving twice in a single turn like the sprint command => pass through an ally with the first part of the move, your unit is able to move into the same tile as the ally unit. Sometimes the ally gets another move after "merging" with an ally too. [GIF]
                            Thanks for letting me know about these issues. I was not able to replicate any of these bugs on my current build. Hopefully this means that I have fixed the problems as part of my more general changes. If you are able to replicate the problems after I've uploaded the new update, let me know, and I'll get it fixed along with the next "overwatch" update.

                            Monokkel, Thanks for your proposal, I am stuck. Sorry, but I have not enought skill to do that by my self. But I ask for this solution (to add a button), because on mobile (android), touch input is not working well, I saw on trello that you mentionned there is a bug, and need to disconect event tick to allow touch input to work. But no result on my side. I am surprised not to see more comments on issue with mobile, am i the only one ?

                            Thanks for your help.
                            [/QUOTE]

                            It should not be necessary to do anything more than disconnect the EventTick in the player controller. In what way is touch input not working well for you?

                            Originally posted by eradicator156 View Post
                            Hey Knut! First off, I'd like to say I'm loving this toolkit so far. You did a great job with it.

                            I've been trying to create an ability that allows a unit to spawn new AI units during a game and found a bug in the BP_Unit ConstructionScript. The link is missing from Sequence 1 to the Branch. It resulted in new units not being properly added to the grid and initiative order. Was there a reason this link is not there? I'm guessing it was deleted by accident.

                            Click image for larger version

Name:	BP_Unit-ConstructionScript.png
Views:	8
Size:	81.5 KB
ID:	1609173
                            Oops, seems like I forgot to reconnect that after I did some testing. Again, this is fixed in my current build which should be live in a few days.
                            The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                            Comment


                              Monokkel I have disconnected event tick, the path is not workink now, and input touch is randomly working. I try on different mobile (all android). I am a bit upset, because my game is nearly ready, but not palyable on mobile. have you any idea what is going wrong. I just make the test with your project, changing nothing. kind regards.

                              Click image for larger version

Name:	Annotation-20190419-204557.png
Views:	12
Size:	120.0 KB
ID:	1609898

                              Comment


                                Originally posted by E-tales View Post
                                Monokkel I have disconnected event tick, the path is not workink now, and input touch is randomly working. I try on different mobile (all android). I am a bit upset, because my game is nearly ready, but not palyable on mobile. have you any idea what is going wrong. I just make the test with your project, changing nothing. kind regards.

                                Click image for larger version

Name:	Annotation-20190419-204557.png
Views:	12
Size:	120.0 KB
ID:	1609898
                                Ok, I'm sorry that you're experiencing these issues. Last time I checked touch controls they worked fine, but I might have changed something that had an impact I did not expect. Testing touch controls is a bit more cumbersome than testing other features, but I will try to make the time for testing this out tomorrow and report back my results. Sorry for the inconvenience.
                                The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                                Comment

                                Working...
                                X