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
    It should be something that is easy to integrate. It is a combination of several functions I now use to determine what units are reachable by the AI. These should be easy enough to replace with the old ones, but it will take some time to post all the nodes related to these new functions in this thread. Therefore I hope you can wait until the update is done. If you feel after the update is out that you will not want to use the new nodes for whatever reason I'll think up a custom solution for you.
    As long as it's simple enough to integrate then it shouldn't be a problem. That begs the question though, how long until you release the update?

    Originally posted by Monokkel View Post
    This can be done much more efficiently in the AI and Player controllers where it is possible to narrow down the amount of units you want to check. I would still prefer the Reachable Pawns Array to only contain the units which are actually reachable, though, so I will give this some more thought.
    The issue for me is that I would prefer the visible tiles to be rendered accurately.

    Unfortunately, the pathfinding and visibility functions are one of the things I'm not really familiar with at this point, but it's my understanding that visibility is calculated after pathfinding, using the reachable tiles as a base to calculate what's visible using the unit's range value. Would it be possible to simply remove occupied tiles from that list for calculating visibility, and then add them back in afterwards?

    Comment


      Originally posted by Selentic View Post
      As long as it's simple enough to integrate then it shouldn't be a problem. That begs the question though, how long until you release the update?
      My aim is to release it along with UE4.15. They seem to be making quick progress, though, so maybe I'm a bit optimistic :P

      Originally posted by Selentic View Post
      The issue for me is that I would prefer the visible tiles to be rendered accurately.

      Unfortunately, the pathfinding and visibility functions are one of the things I'm not really familiar with at this point, but it's my understanding that visibility is calculated after pathfinding, using the reachable tiles as a base to calculate what's visible using the unit's range value. Would it be possible to simply remove occupied tiles from that list for calculating visibility, and then add them back in afterwards?
      You are absolutely right. I realized this shortly after my last post. I went to bed (it is pretty late in Norway), but kept thinking about it and then I came up with a solution. Couldn't sleep without implementing it first, so here is my solution. I'll show the nodes without explaining too much as I need to get up for work early tomorrow. I'll explain then if you have any questions. There might also still be problems with this solution I have not seen yet, as I've only had time for limited testing:

      In Pathfinding (yes, that is a new function. I'll get to that next):
      Click image for larger version

Name:	H96R038.png
Views:	1
Size:	300.1 KB
ID:	1122462

      New function (left side):
      Click image for larger version

Name:	dXXG8OT.png
Views:	1
Size:	318.8 KB
ID:	1122463

      New function (right side):
      Click image for larger version

Name:	NQj9zuH.png
Views:	1
Size:	215.1 KB
ID:	1122464

      In Player Controller (in Event Graph. Under Display Path On Hover. Bottom pretty par right):
      Click image for larger version

Name:	6GtLFO3.png
Views:	1
Size:	278.8 KB
ID:	1122465

      Also in Player Controller (by the Initialize Movement - Step 1 custom event)
      Click image for larger version

Name:	3uGgQi9.png
Views:	1
Size:	253.9 KB
ID:	1122466

      AI should work with this solution without modification, even in the old version. Let me know if it solves your problems. I won't respond for at least another six hours, though :P

      Edit: the function above can possibly be made slightly more efficient for this specific purpose by limiting the tiles checked to the ones surrounding the potential targets. Getting these indexes requires using one of the visibility functions, though, so it would probably only be better for large movement ranges. This function also has other uses as a more efficient way to get all possible targets within range compared to the old version for the AI which is what I originally made it for)
      Last edited by Monokkel; 02-02-2017, 09:35 PM.
      Advanced Turn Based Tile Toolkit (Marketplace - Support)

      Dungeon Crawler Toolkit (Marketplace - Support)

      Discord

      Comment


        Originally posted by Monokkel View Post
        You are absolutely right. I realized this shortly after my last post. I went to bed (it is pretty late in Norway), but kept thinking about it and then I came up with a solution. Couldn't sleep without implementing it first, so here is my solution. I'll show the nodes without explaining too much as I need to get up for work early tomorrow. I'll explain then if you have any questions.
        Thanks for the help!

        Originally posted by Monokkel View Post
        There might also still be problems with this solution I have not seen yet, as I've only had time for limited testing
        This appears to have fixed the issue. My AI is not behaving like it should in some instances right now but I'm not sure yet if it's related to this fix, I'll figure out tomorrow whether it's a result of this or not.

        Unrelated to this and not game breaking, pass through friendlies pathfinding currently overlooks ideal tiles in some instances. For example:



        The circled unit just moved, and stopped on the space it's currently sitting on. While you can't see it in this image, offscreen to the left a couple spaces is a player unit that it was attempting to path towards. The path line is where I'm guessing the pathfinding tried to direct it, but since the end space was occupied, it stopped where it did. However, it could have easily gone to the empty space marked by the arrow instead, and ended its turn closer to its target.
        Last edited by Envieous; 02-03-2017, 09:26 AM.

        Comment


          Ok, glad to hear it worked for the most part. I'm a bit confused about your example, though. Why would the unit want to follow the path indicated by the long, bent arrow if the target is a couple of tiles off screen to the left?
          Advanced Turn Based Tile Toolkit (Marketplace - Support)

          Dungeon Crawler Toolkit (Marketplace - Support)

          Discord

          Comment


            Originally posted by Monokkel View Post
            Ok, glad to hear it worked for the most part. I'm a bit confused about your example, though. Why would the unit want to follow the path indicated by the long, bent arrow if the target is a couple of tiles off screen to the left?
            I wouldn't. That's where I'm guessing it tried to move. It should pick the empty space marked by the left arrow instead.

            Comment


              Alright I've got a bit more into this. After this change, the first pawn to move on the AI's turn will break and go to index 0 in the event that the unit is blocked. If the unit is not blocked, it will move correctly and attack it. Following pawns will simply remain still and do nothing if the path becomes blocked after the first pawn.

              I still don't know whether the cause is this change or not, I'll check back when I know more.

              E:

              Disconnecting the find units in sight from move array function fixes the issue of units not moving towards the target when theyre not close enough to attack it. So looks like there's something in there causing that issue.

              I have no idea what's going on here lol.
              Last edited by Envieous; 02-03-2017, 03:51 PM.

              Comment


                Originally posted by Monokkel View Post
                Okay, I figured out the problem. You need to also modify the nodes in Display Path on Hover as well. Add the following:

                [ATTACH=CONFIG]127610[/ATTACH]
                That worked! Thank you.

                Comment


                  [MENTION=16997]Selentic[/MENTION]: Yeah, sounds a bit confusing. The solution I gave you was a bit of a patch job using one of the new functions for something I did not originally intend it to be used for. I did not get the time to test it properly either and now I'm away for the weekend and cannot test it out myself. I have not seen any such problems in the new update. I will take a closer look when I get back home and figure out if I can find a way to do this that also works for the old AI.

                  [MENTION=49487]Mewbits[/MENTION]: Glad it worked! I think ideally what happens when you click a tile should not have to be dependent on what is displayed to the player, so I will put this on the list of minor things to be fixed.
                  Advanced Turn Based Tile Toolkit (Marketplace - Support)

                  Dungeon Crawler Toolkit (Marketplace - Support)

                  Discord

                  Comment


                    Originally posted by Monokkel View Post
                    [MENTION=16997]Selentic[/MENTION]: Yeah, sounds a bit confusing. The solution I gave you was a bit of a patch job using one of the new functions for something I did not originally intend it to be used for. I did not get the time to test it properly either and now I'm away for the weekend and cannot test it out myself. I have not seen any such problems in the new update. I will take a closer look when I get back home and figure out if I can find a way to do this that also works for the old AI.
                    At the very least it fixes visible tile rendering, for now I can just fall back on standard pathfinding. I'll keep at it for now and see if I can find a solution.

                    Comment


                      So, I have found another glitch with the toolkit... I have not modified the Find Tiles in Range event in any way. However, the minimum range doesn't seem to be working. I wanted to find every index within a 15 tile radius, but not within a 5 tile radius. I then spawned a special tile on those spots, However, the tiles filled the entire 15 tile radius, instead of from 5 to 15.

                      Here's an example picture, from a new toolkit. It is called within the level blueprint.

                      Click image for larger version

Name:	TilesInRange.jpg
Views:	1
Size:	400.2 KB
ID:	1122512

                      On this version, it is minimum range of 3 and a range of 10. So the three inner rings should be empty, but if you look carefully, the tile cost 2 spawned there as well.
                      Last edited by Mewbits; 02-03-2017, 08:41 PM.

                      Comment


                        I don't know if this has already been asked (Theres alot of comments on this post, too many to read through all the way!) but with the upcoming XCOM style gameplay update I was wondering if there are any plans to also add the feature of 'selecting units from a list' before the start of each map. Even a really bare bones basic system would be pretty awesome. The gameplay is a priority for sure, rightly so, but something small like that really would be a great time saver in testing.
                        Also just a suggestion for a few small features if thats okay;
                        1- Make an option to Start a map without units automatically selected each turn, and instead you must manually select a unit to control them. This obviously would only affect human players not AI and as an option it wouldn't effect those who wouldn't like that as they can have is disabled.
                        2- To add to the last suggestion, have a button to end a players turn early, even if they haven't moved all their pawns.
                        3- Last suggestion, before completing a turn for a pawn (movement or attack) have a UI or something to show a Proceed/Cancel option rather then just doing it. Again as an boolean option, so those who would prefer the instant-Click method rather then the planning method wouldn't be affected.

                        Even if none of these suggestions are taken into consideration, thank you again for the awesome kit. Its amazing how much blueprints can accomplish without a single line of C++, even more amazing that some people, like yourself, can already understand it so masterfully. It's not crazy to think that in 10 years time there might be multiple visual coding languages that are just as powerful and flexible as classic coding languages, making game design accessible to everyone with interest.

                        Comment


                          Originally posted by Selentic View Post
                          At the very least it fixes visible tile rendering, for now I can just fall back on standard pathfinding. I'll keep at it for now and see if I can find a solution.
                          Ok, let me know if you figure something out. As mentioned I want to look at this as soon as possible and make sure it is not a bug that is carried over into the new update, but I am away visiting the in-laws this weekend. I'll get working on it when I return.

                          Originally posted by Mewbits View Post
                          So, I have found another glitch with the toolkit... I have not modified the Find Tiles in Range event in any way. However, the minimum range doesn't seem to be working. I wanted to find every index within a 15 tile radius, but not within a 5 tile radius. I then spawned a special tile on those spots, However, the tiles filled the entire 15 tile radius, instead of from 5 to 15.

                          On this version, it is minimum range of 3 and a range of 10. So the three inner rings should be empty, but if you look carefully, the tile cost 2 spawned there as well.
                          That is odd. From your screenshot it seems that there is a second problem as well, where tiles are not spawned at the first index of even rows. Does this happen in a fresh project? It looks like a bug I've seen before, but one that I fixed a long time ago.

                          Originally posted by Malibu Lizard View Post
                          I don't know if this has already been asked (Theres alot of comments on this post, too many to read through all the way!) but with the upcoming XCOM style gameplay update I was wondering if there are any plans to also add the feature of 'selecting units from a list' before the start of each map. Even a really bare bones basic system would be pretty awesome. The gameplay is a priority for sure, rightly so, but something small like that really would be a great time saver in testing.
                          Thanks for the suggestion, Malibu Lizard. This is something that several other people have requested and I did consider adding something like this to the game example in the coming update. However, I've had to stop myself from constantly adding new features so that I can get this update done. What was originally planned to be just a few small additions quickly ballooned into a big list of complex new features so that I'm way past the date I planned to release the update. I will be sure to put this on the list of things to add in the following update, though.

                          Originally posted by Malibu Lizard View Post
                          1- Make an option to Start a map without units automatically selected each turn, and instead you must manually select a unit to control them. This obviously would only affect human players not AI and as an option it wouldn't effect those who wouldn't like that as they can have is disabled.
                          2- To add to the last suggestion, have a button to end a players turn early, even if they haven't moved all their pawns.
                          3- Last suggestion, before completing a turn for a pawn (movement or attack) have a UI or something to show a Proceed/Cancel option rather then just doing it. Again as an boolean option, so those who would prefer the instant-Click method rather then the planning method wouldn't be affected.
                          All these are good suggestions and are all related to giving the user more control over turn order. This is a part of the toolkit I've long wanted to make more easy to adapt and modify, so this is all on my to-do list. Though again not for the coming update, but the one after.

                          Originally posted by Malibu Lizard View Post
                          Even if none of these suggestions are taken into consideration, thank you again for the awesome kit. Its amazing how much blueprints can accomplish without a single line of C++, even more amazing that some people, like yourself, can already understand it so masterfully. It's not crazy to think that in 10 years time there might be multiple visual coding languages that are just as powerful and flexible as classic coding languages, making game design accessible to everyone with interest.
                          Thanks and you're welcome I first started making grid based pathfinding in UE4 mostly to test out the capabilities of blueprints and determine whether they could realistically be used to make a full game (early on there was a ton of scepticism regarding blueprints and people were saying that you should never use it for anything serious). My experiment got the attention of people on this forum who had thought about making TBS games and slowly grew into this toolkit. Blueprints are a fantastic tool for scripting and the way you create a visual layout of nodes seems to mesh well with my way of thinking and creative process. With blueprint nativization that was added a couple of UE4 versions ago the speed of blueprints has increased substantially, making it even easier to justify using blueprints for just about everything. I've become very good at certain kinds of blueprint scripting; mainly the parts involved with manipulating arrays, but I still have many areas that I know very little. Making this toolkit has made me very specialized, and I still have only novice to intermediate knowledge about animation blueprints, UI and material nodes, for instance. But as I'm beginning to become satisfied with how the underlying mechanics of the toolkit work I'll be looking into adding features that require other such skillsets. Making a good UI for selecting units, ending turns etc. is one such feature.
                          Advanced Turn Based Tile Toolkit (Marketplace - Support)

                          Dungeon Crawler Toolkit (Marketplace - Support)

                          Discord

                          Comment


                            Originally posted by Monokkel View Post
                            That is odd. From your screenshot it seems that there is a second problem as well, where tiles are not spawned at the first index of even rows. Does this happen in a fresh project? It looks like a bug I've seen before, but one that I fixed a long time ago.
                            Yes, before I made this example project, I deleted my local content and downloaded a fresh new version of the toolkit, to make sure it was the most recent version. Then I made the changes within it. It's the same project I sent you over email.

                            Comment


                              Originally posted by Monokkel View Post
                              [MENTION=16997]Selentic[/MENTION]: Yeah, sounds a bit confusing. The solution I gave you was a bit of a patch job using one of the new functions for something I did not originally intend it to be used for.
                              Alright I've had a bit more time to go at it, and I've fixed a few errors I made in my ai controller that may have been affecting this issue. After a quick run through which is by no means conclusive, this appears to be working correctly again. I'll get some more proper testing in tomorrow figure out one way or another whether it's working.

                              Comment


                                Originally posted by Mewbits View Post
                                Yes, before I made this example project, I deleted my local content and downloaded a fresh new version of the toolkit, to make sure it was the most recent version. Then I made the changes within it. It's the same project I sent you over email.
                                Ok, thanks for taking the extra steps in testing it out and sending me a project. I will take a look at it when I'm back on Monday.

                                Originally posted by Selentic View Post
                                Alright I've had a bit more time to go at it, and I've fixed a few errors I made in my ai controller that may have been affecting this issue. After a quick run through which is by no means conclusive, this appears to be working correctly again. I'll get some more proper testing in tomorrow figure out one way or another whether it's working.
                                Ok, good to hear. I'll do some testing myself in any case. I want to eliminate all serious known bugs before sending Epic the update.
                                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                                Dungeon Crawler Toolkit (Marketplace - Support)

                                Discord

                                Comment

                                Working...
                                X