Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Hey Monokkel I recently bought your toolkit, money well spent. And I can see the great support your giving on this thread and through videos. Btw, do you have a donation link somewhere?

    Now for the question.

    I'm needing "synchronous resolution turns" like nateight in a previous post. But before I hit that brick wall I wanted to see if you have a suggestion for the player to select their path similar to "Can split up move", but they select all the points before they move. So the player could map out a u-turn if they wanted to avoid a square.

    Comment


      Hi Redsett, glad to have you on board I don't have a donation link, no. People have paid for the toolkit, and should not feel any obligation to give me more than what I have priced it at.

      If you have read through the thread you are aware that I regard synchronous resolution to be pretty tough to implement, so do not attempt to tackle this until you are comfortable with the toolkit. Setting up waypoints so that you can split up move before moving the actual unit is a significantly easier challenge, but will still take quite a bit of work.

      The way generation of a path currently works is to look at the target tile, find the parent of this tile in CanMoveToArray, find the parent of this tile and so on until you reach the start tile. While searching through the array from parent to parent each tile index is added to the Path Array (possible Path Index Array. I cannot check at the moment). Then a Path Spline is generated by finding the vectors corresponding to these indexes in the Vector Field Array. For splitting up movement you would want to run something similar to what is run in ATBTT_PlayerController when clicking an empty tile that can be moved to, but instead of initializing movement on the Current Unit you would append the Path Array to another array (say Long Path Array or Split Path Array) and then run pathfinding from the endpoint of your first path with move set to the move of the current unit minus the move cost to the first waypoint. This could then be repeated a number of times depending on input from the player. The spline path would be generated based on the Long Path Array instead of the Path Array in this case, and the unit would move along it as normal.

      I hope this is enough to get you started. Testing this out myself would take quite a bit of time, and I'm rather busy fully implementing features for version 1.6 at the moment.
      Advanced Turn Based Tile Toolkit (Marketplace - Support)

      Dungeon Crawler Toolkit (Marketplace - Support)

      Discord

      Comment


        Thanks for the overview Monokkel. I'll give it a go and post my results!

        Comment


          I LOVE THIS PLUGIN.

          shut up and take my money @@!

          Comment


            After a couple days of tinkering in my off time I've made a little progress but not sure if I'm headed in the right direction and would appreciate some advice when you get the time Monokkel.

            At the moment I'm just trying to get multiple clicks into one spline.
            Right now I'm just adjusting the "Start Index" when calling the "Pathfinding" function in the controller. After clicking, the start index will be where I clicked then I'll call the pathfinding function again to refresh the "CanMoveToArray". This seems to be ok at this point. Then in the grid manager bp and within the function "Find path within pathfinding array"; I added an array "SavedPathIndexArray" to append the path when I click.

            I get something that resembles what I'm looking for but it's still a bit broken.
            Click image for larger version

Name:	2016-02-24 23_55_05-OneNote.png
Views:	1
Size:	457.1 KB
ID:	1101199
            Last edited by Redsett; 02-25-2016, 04:16 AM.

            Comment


              @Retrotation: Hehe, I'm happy to hear that If you have bought it I have already taken your money, so I guess I should shut up.

              @Redsett: Looks promising! Your method seems like a good starting point. Is the only way it is "broken" simply cosmetic, with the extra arrows that appear when displaying the path or are you having other problems as well. It seems like the unwanted arrows are pointing to the starting point of the previous path.
              Advanced Turn Based Tile Toolkit (Marketplace - Support)

              Dungeon Crawler Toolkit (Marketplace - Support)

              Discord

              Comment


                The double arrows are breaking it I believe. And somehow the beginning of the spline connects to the end as well.

                Comment


                  Ok, I gave it a whirl. It turned out to be a lot more work than I anticipated, but I've figured it out. It still requires some more work, but the basics are mostly working.

                  For input I made a couple of additions to ATBTT_PlayerController so that you can place waypoints by holding left control:

                  Click image for larger version

Name:	eWVEazn.png
Views:	1
Size:	30.7 KB
ID:	1101249

                  Then add all of this near the end of "Initiate movement towards and/or attacking target", right after Find Path Within Pathfinding Array:

                  Click image for larger version

Name:	V67NKWS.png
Views:	1
Size:	642.5 KB
ID:	1101251

                  You are going to need my custom reverse for each loop for this, so here is the macro library.

                  Then make these additions to the Find Path Within Pathfinding Array function in BP_Grid_Manager:

                  Click image for larger version

Name:	ZPLR1hh.png
Views:	1
Size:	180.8 KB
ID:	1101252

                  That should be enough to get it mostly working. Hope that helps!
                  Advanced Turn Based Tile Toolkit (Marketplace - Support)

                  Dungeon Crawler Toolkit (Marketplace - Support)

                  Discord

                  Comment


                    Thanks a million Monokkel.

                    I did exactly as you have, then changed the index in "Create Spline Path" function to the current pawn index. Works great.(at least doesn't seem to break anything)
                    Click image for larger version

Name:	2016-02-25 23_40_34-AdvancedTurnBasedTileTool - Unreal Editor.png
Views:	1
Size:	126.5 KB
ID:	1101267
                    Click image for larger version

Name:	2016-02-25 23_41_13-AdvancedTurnBasedTileTool - Unreal Editor.png
Views:	1
Size:	607.5 KB
ID:	1101268
                    Last edited by Redsett; 02-26-2016, 04:09 AM.

                    Comment


                      Ah yes, I added that myself, but forgot to include it in my post. Good thing you figured it out!
                      Advanced Turn Based Tile Toolkit (Marketplace - Support)

                      Dungeon Crawler Toolkit (Marketplace - Support)

                      Discord

                      Comment


                        Hi there I recently purchased the ATBTT for a university project and it's been really helpful.
                        I just had a quick question after going through the blueprints, how would I go about removing the AI? and having it so two human players can alternate goes locally?
                        thanks in advance for your help.

                        Comment


                          so its probably sloppy but it works... I'm having a matinee play before each level starts but don't want the game functions to mess with anything. So I created a new bp I put in each lvl that lets me set the delay that is sent to the game mode. I just set it to however long the matinee is and poof.

                          anyone have thoughts to simplify it?

                          Click image for larger version

Name:	matinee_timer.jpg
Views:	1
Size:	440.5 KB
ID:	1101511

                          Comment


                            @markps: Hi there! In the update I'm currently working on it will be possible to add any number of factions and set them up as either allies or enemies. It will also be possible to specify whether a unit is player or AI controlled on an individual basis, making things like summoned units or mind control easy to implement. This is probably overkill for what you need, though, and having two player controlled warring factions (and no AI factions) is easy to add in the version currently on the marketplace. The general idea of how to implement this is to remove any branch of switch that checks if the current unit is AI controlled (since this should never happen) and to change any switch that checks the faction of a target unit so that it compares the faction to the faction of the current unit instead of naïvely assuming that the current unit is of the Player faction. Here are the specific modifications to make:

                            1) In ATBTT_GameMode simply skip the "Find Faction of Pawn" part of the event graph and set the default value of Player Turn to true:
                            Click image for larger version

Name:	eFUvn7J.png
Views:	1
Size:	163.3 KB
ID:	1101536

                            2) Similarly skip the branch that checks whether Player Turn is true at the end of the event graph:
                            Click image for larger version

Name:	vvTF4Ta.png
Views:	1
Size:	209.8 KB
ID:	1101537

                            3) In ATBTT_PlayerController change both switches that check the faction of the target so that it is compared to the faction of the current unit:
                            Click image for larger version

Name:	tH8HmMe.png
Views:	1
Size:	210.5 KB
ID:	1101538

                            Click image for larger version

Name:	I3BrCsv.png
Views:	1
Size:	251.8 KB
ID:	1101539

                            4) In Unit_Parent at the end of the event graph, skip the switch that checks the faction of the unit:
                            Click image for larger version

Name:	WSJHr5A.png
Views:	1
Size:	209.8 KB
ID:	1101541

                            That should hopefully do the trick. It seems to work well based on my limited testing.

                            @Jopel: They say that if it is sloppy but works, it still works. I personally have a hard time living by that creed, though, as I often spend hours obsessing over making something as elegant, flexible and efficient as possible, while the same time could probably be spent developing new, cool features :P I don't think you are far off the mark with your solution in any case. The only problem I can see is that it's a bit awkward to manually specify the duration of your matinée every time you change it. I have not worked with matinée at all, actually, but I assume it should be possible to have the matinée automatically run an event when it is finished instead of using a delay. I do not know for sure, but I would be surprised if this was not the case.
                            Advanced Turn Based Tile Toolkit (Marketplace - Support)

                            Dungeon Crawler Toolkit (Marketplace - Support)

                            Discord

                            Comment


                              yeah.. I'm sure my programmers at work would cringe but for a vertical slice build it might be a hackathon and then do cleanup and polish once I can get a programmer on it full-time. So yes.. the matinee plays fine but the issue is the controls take over and if someone starts clicking or you place the matinee camera where the first pawn is at the game is technically active. I wanted to delay the start of the game without using a seperate level for cinematics so the timer thing was the easiest thing I could come up with. I'm totally sure there is a better way to do it. I may even change it to using something like a UMG widget or whatnot since what I"m going for is like a advance wars/final fantasy tactics text /w avatar cutscenes.

                              Comment


                                Again, as long as it works and you do not foresee any major issues you will run into because of your solution I do not see anything wrong with it. I am in a bit of a different situation myself, since everything I make will be scrutinized by users of the toolkit and put to use in ways I cannot predict. Because of this I have gotten into the habit of trying to find the optimal solution for anything I add. This has some benefits, of course, but it is also very time consuming. I frequently hack together stuff quickly when I'm prototyping, however, and that is frequently the most fun part of development
                                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                                Dungeon Crawler Toolkit (Marketplace - Support)

                                Discord

                                Comment

                                Working...
                                X