Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Just noticed that the number of marketplace ratings for the toolkit just reached 100! Thanks to everyone who rated and to everyone making great stuff with ATBTT

    t is now almost exactly three years since I released the toolkit and I love working on it as much as ever. Still lots of features to add, and I'm looking looking forward to UE4.19 when I'll release my next, big update!
    Last edited by Monokkel; 02-26-2018, 05:15 PM.
    The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

    Comment


      Originally posted by Monokkel View Post

      Hi Gameran, you're thinking along the right lines. I've thrown together a quick and dirty solution which should be enough to get you started. I first duplicated TileCloseThinWall_E, called it Tile_Door_East and colored it green + scaled it a bit (for visuals). I then changed the collision settings of its mesh to block everything but PathTrace (so it registers click events, but ignores the trace in the Player controller that uses PathTrace).

      Then I added the following to the door's event graph:


      Here I'm using UE4's built-in OnClicked event to register the player clicking on the door.

      I then use the AddEdgeBothWays function in BP_GridManager to connect the tiles on either side of the door. Since this door is a copy of the east wall actor, which during setup removes its eastern edge I want to re-add this edge. In the toolkit east is +1, west -1, north - GridSizeX and south + GridSizeX. You would likely want to set up a less hard-coded implementation in your game, but this works fine for a demonstration.

      Then I move the mesh out of the way with a timeline. This does not pathfinding, but is just for looks. You would want a more proper animation, of course.

      Lastly I reactivate the current unit. Since the current unit was originally activated before we altered the edge array, the pathfinding it ran was using the old edges. We want it to take the altered edges (and change in visibility now that the wall has moved, for that matter) into account.

      Hope this helps you implement doors how you intended. Like I said, this was a very quick and dirty solution, but if you understand the steps you should be able to build on it and make something better. The first step would probably be to move this to being part of the click event in the player controller, so you can have more control over when it activates. Best of luck, and let me know if you need any more help.

      Click image for larger version

Name:	Door.gif
Views:	7
Size:	497.3 KB
ID:	1432239
      Thanks for the quick response and sorry for my late one. What you suggested worked perfectly. I'm currently working on making that coding a bit more dynamic by reading the edge the door is on then updating it accordingly.

      Comment


        Originally posted by Monokkel View Post
        drpsyko : Depends a bit on exactly what you want to achieve. There ar quick and hacky ways to achieve some of this stuff, but depending on what you want you may need to make larger changes. I plan to add the option to have multiple grid managers in the future, but until then there are some other things you can do.

        So if I understand your question correctly, you're not asking how to preserve say the heatlh and other attributes of units across maps, but rather having something like a basement in a level where combat can go on simultaneously while it is also happening on the floor above, with unit turns hopping back and forth between the levels as they are activated. Is this a correct interpretation?

        If so, here is a quick hack you can try. Set Heightmap to multilevel in the Grid Manager. Set Max Grid Height to something really high (say 10000). Then create your various levels on top of one another, making sure that the distance between them is higher than the maximum zoom distance set up in your grid camera.

        Already all of these layers should function as separate grids, though you can always add edges to allow movement between them. Now what you need to do is make sure layers below cannot be seen when on levels above. You can do this simply by having a landscape/plane mesh between them or you can use cull distance volumes, object hierarchies with visibility set through blueprints or whatever.

        Last thing you need to do is prevent the camera from moving smoothly when switching between units on different layers and instead jump instantly. Look in the event graph of grid camera in the comment box "Follow the current active unit unless the player is currently panning the camera". Here you can see I use lerps for smooth movements. Promote the lerp alpha to a variable and set it to 1 whenever you switch between units on different levels (you can do this by comparing the height of the previous and the next unit in the ChooseNextPawn event in ATBTT_GameMode).



        Seems to work pretty well for Divinity-style instant switching between multiple grids. A bit hacky, sure, but looks good in game.
        Yes, that is exactly what I meant! I was thinking that maybe I could make the bp_manager ref unique to each stream level. But really need to unload most of the stuff from ATTBTT gamemode to level, and add arrays for each pawn per map. Haven't tried it yet though, as I'm guessing it would break a lot of pawn turns :P

        For now I'll use both method - load/save state and multi-level to compensate big map. Thanks, and really looking forward for the multi-grid manager!

        Comment


          Hello again Monokkel, I need a bit of help with a couple of things. These are both probably very simple things that I don't know how to do so please excuse my ignorance. I tried to see if these had been answered before with a brief search but didnt find much. How is the camera restriction controlled? Is it based on the size of the grid? Just curious how to control that for different styles of level. Also how do I set it up so that the player can press an assigned key for selecting a particular character instead of having to click them? It would be a little bit more convenient for the number of units I intend on using.
          Last edited by OperatorCrux; 02-28-2018, 03:53 PM.

          Comment


            The wait for 4.19 is getting tough!

            Comment


              Originally posted by Gameran13 View Post

              Thanks for the quick response and sorry for my late one. What you suggested worked perfectly. I'm currently working on making that coding a bit more dynamic by reading the edge the door is on then updating it accordingly.
              Ok, great! That is how you definately should do things. Best of luck and let me know if you need any additional assistance.

              Originally posted by drpsyko View Post

              Yes, that is exactly what I meant! I was thinking that maybe I could make the bp_manager ref unique to each stream level. But really need to unload most of the stuff from ATTBTT gamemode to level, and add arrays for each pawn per map. Haven't tried it yet though, as I'm guessing it would break a lot of pawn turns :P

              For now I'll use both method - load/save state and multi-level to compensate big map. Thanks, and really looking forward for the multi-grid manager!
              Great, sounds pretty reasonable. I would generally avoid using level blueprints for functionality that will be used by most levels, though, if that is what you are suggesting. You'll have to experiment, and I'll be interested in hearing what solution ends up working for you.

              Originally posted by OperatorCrux View Post
              Hello again Monokkel, I need a bit of help with a couple of things. These are both probably very simple things that I don't know how to do so please excuse my ignorance. I tried to see if these had been answered before with a brief search but didnt find much. How is the camera restriction controlled? Is it based on the size of the grid? Just curious how to control that for different styles of level. Also how do I set it up so that the player can press an assigned key for selecting a particular character instead of having to click them? It would be a little bit more convenient for the number of units I intend on using.
              No worries, there is a lot of stuff to look throuigh!

              If you look at the event graph of BP_GridCamera you will see in the Zoom comment box that zoom distance is capped by the ZoomRoof and ZooFloor variables, while panning is controlled by the CheckOuterBounds function. This function is informed by the size of the grid.

              For your second question take a look in ATBTT_PlayerController. In the comment box "If CanPlayerSwitchPawns is true and a pawn that has not acted is click, switch to this pawn" you'll see how to set up switching to a friendly unit. You can duplicate this code and replace the reference to the unit on the clicked tile to any other unit. You could for instance get the unit from Index 1 (next unit) of the InitiativeOrderArray in the game mode, check that the faction is the same as the current unit and if so, switch to that unit.

              Originally posted by elec2ron View Post
              The wait for 4.19 is getting tough!
              Don't worry, it's close
              The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

              Comment


                Thank you so much for supporting this toolkit so heavily. Noobs like myself greatly appreciate it!

                Taking what I've learned so far I've started a new project and intend on using the Jungle Raid blueprints/pawns as they already have the weapons and skill setup, and incorporate that into other levels as I make them with my own meshes and skeletons. I would like to keep this project as organized as possible within the folders so I'm curious how I would go about replicating those things into another folder without losing any targeting for code, meshes, etc. For example, what I would like to do is make a duplicate of the Medic class and later replace the skeleton and mesh. What all would I need to copy / edit into the new folder to make this duplicate work properly?

                Edit : If this is unnecessary and there is a better workflow for what I'm trying to do I'm completely open to it. Learning as I go.

                Edit 2 : I messed around with the files for a while and realized that there isnt any problem caused as long as I do all of the file moving within Unreal and not in the folders themselves. Basically I just tucked ATBTT away into a parent folder called "engine" with my other engine based things and everything is still working fine.

                Problem solved, disregard this message.
                Last edited by OperatorCrux; 03-02-2018, 12:49 AM.

                Comment


                  OperatorCrux : Sorry for taking so long to reply, but I'm glad you figured it out. After moving stuff around I recommend right clicking the affected folders and selecting clean up redirects (or something similar. cannot check right now) to make sure you do not run into any errors from moving stuff around.
                  The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                  Comment


                    Monokkel No worries, but i did manage to run into another problem. I followed your tutorial video for retargetting animations and setting up the event graph for a new character and most of it works. The problem I'm encountering is that the blendspace animations don't seem to be working. At least not the movement portion of them. Attack and hit animations seem to be working fine after setting up the AttackEnd notify. Here's a gif showing the problems with the animation, and a screenshot of the error log after running a test of the game. No errors are triggered while compiling the event list though they do pop up after playing a level. The object it's referring to are all the unit itself.



                    Edit : Added Gif - https://media.giphy.com/media/1fnn9yhyAkshlEOwwJ/source.mp4

                    Also I forgot to mention that the blendspaces seem to work fine when I open them and move the dot around myself, they just dont work when playing.
                    Last edited by OperatorCrux; 03-03-2018, 10:44 AM.

                    Comment


                      OperatorCrux : Hmm, might be caused by several issues. Could you click the search text in the error log and find which nodes are causing the error and post them here?
                      The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                      Comment


                        Monokkel

                        The errors seem to be triggering on "Set Break" and "Move Animation" and seem to only be related to those two, it's just showing the error a dozen or so times in the log.

                        Comment


                          OperatorCrux : Ok, I think I see what is wrong here. If you look at your graph you will see that if Idle is false, MoveAnimation will be called even though the cast has not been called. Since the cast has not been calles it has no valid input. Plug the exit execution pin from Break into the input execution pin of the cast and see if it works.
                          The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                          Comment


                            Thanks for the quick reply. That fixed the running animation, but it's still triggering one single error in the log after playing. Not sure if this is actually affecting anything but figured I should try to solve it now instead of later. The final error is still coming from Break.

                            Comment


                              Yeah, same issue here. If you are using an output value from a blueprint node that is not pure (meaning it has execution pins), you need to make sure that any nodes that use the output value happen after this node in the execution chain. For the break node you are trying to get the result of a cast that has not been cast yet. Sorry, I should have seen it when I gave you the colution. You could set it up so that the cast happens before break is set, but in this case I think it is simpler and just as performant to convert the cast to a pure cast (meaning it will be re-run any time a node requests its output without the need of executing it first). Right click the cast node, select "convert to pure cast" and that should fix it.
                              The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                              Comment


                                That completely solved the problem, thank you so much. I really appreciate you breaking down why these errors are occurring. I'm new to blueprints so honestly you breaking it down like that really helps me understand how to avoid problems like this in the future.

                                Comment

                                Working...
                                X