Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

  • replied
    Originally posted by Monokkel View Post

    Hi, glad to hear that you're enjoying the toolkit The things you mention are indeed built with some assumptions, but they are easy to swap out. I designed the turn manager and abilities to be easy to replace and overwrite for precisely these sorts of reasons.

    For your first question on initiative I would use the strategy turn manager (BP_TurnManager_Strategy) and make the following change:

    Note that this will not make too much sense for the AI, which will always use the first unit in initative. If you are using AI and want it to intelligently choose the optimal unit to use it will require some more work. Let me know if this is what you're going for, but first see if the above suggestion fits what you are after. To choose to use the strategy turn manager set the game mode to BP_ATBTT_Strategy (or simply change the turn manager class variable in whatever BP_ATBTT based game mode you are using)

    For your second question, this makes sense to set up in an ability. Patterns can be generated in many ways, but you need to figure out the appropriate algorithm. The GetTilesInRange function in BP_GridManager is a pattern function that finds a square or diamond shaped pattern. You can follow its example to create patterns of your own.

    A quicker but somewhat less performant option is to use the output of GetIndexesInRange and filter it to the shape of your pattern. You could for instance create a cross by taking the array output by GetIndexesInRange and only keeping indexes that are an equal distance away from the center grid index in the X and Y axes.

    Note that if you use GetIndexesInRange, it does not do any checks on the output grid indexes to ensure they are real tiles on the grid, so before using them for gameplay loop through them and check a grid sized array like GridLocations to only keep the valid ones. FindTilesInRange is set up to do this already.

    Thanks! Is there somewhere I can learn about the different Game Modes and Turn Manager classes?

    Leave a comment:


  • replied
    Originally posted by drakunis View Post
    I appreciate the response! We wanted more like Wasteland, where you have a top down movement style (just like the tile based movement the toolkit creates) but to have completely free movement outside of combat. I didn't see anything (and I might not have looked hard enough) that disabled that turn based order when you put the grid manager on the map except in the hybrid map, which is the exact playstyle we are looking to create, minus the third person WASD movement. If that makes sense.
    Yep, makes perfect sense. It should be simpler to set up than the current hybrid map. You can scrap all the code for switching between cameras, use the Grid Camera's follow functionaility for following your character during real time movement, and transition to and from combat in the same way otherwise.

    Leave a comment:


  • replied
    I appreciate the response! We wanted more like Wasteland, where you have a top down movement style (just like the tile based movement the toolkit creates) but to have completely free movement outside of combat. I didn't see anything (and I might not have looked hard enough) that disabled that turn based order when you put the grid manager on the map except in the hybrid map, which is the exact playstyle we are looking to create, minus the third person WASD movement. If that makes sense.

    Leave a comment:


  • replied
    Originally posted by drakunis View Post
    Hello, I am relatively new to Unreal Engine, but stumbled on your toolkit, and it really answered basically every need for our combat system. One thing I have been trying to figure out is how to have the turnbased system deactivate and allow free movement, then when combat is initiated to activate the turn based toolkit. I see the Hybrid map and can get an idea of how the trigger zone starts the combat manager, but the nature of 3rd person then top down for the camera wasn't really what we were looking for, so I didn't want to just iterate on that map alone (plus it is listed as experimental, so I wasn't sure if that meant that the camera perspective change was experimental, or if the changing between having the manager run and having it not was the experimental piece).
    Hi, glad to hear that my toolkit is useful for your project. The experimental folder is where I put systems that I am experimenting with and that can serve as a starting point for devs wanting to implement those types of features. In the experimental folder I do not try to integrate each feature with every other feature in the toolkit and rather try a more local and less generic solution. The folder still contains blueprints that should be well optimized and decently organized, though not commented and cleaned to the same degree as the rest of the toolkit.

    For the hybrid map I am working on an updated and improved version for the next toolkit update. What about the current implementation is not a good fit for your game? Let me know precisely what you are after and I might be able to help you.

    Leave a comment:


  • replied
    Hello, I am relatively new to Unreal Engine, but stumbled on your toolkit, and it really answered basically every need for our combat system. One thing I have been trying to figure out is how to have the turnbased system deactivate and allow free movement, then when combat is initiated to activate the turn based toolkit. I see the Hybrid map and can get an idea of how the trigger zone starts the combat manager, but the nature of 3rd person then top down for the camera wasn't really what we were looking for, so I didn't want to just iterate on that map alone (plus it is listed as experimental, so I wasn't sure if that meant that the camera perspective change was experimental, or if the changing between having the manager run and having it not was the experimental piece).

    Leave a comment:


  • replied
    Originally posted by admlsnackbar View Post
    Hello!

    Longtime designer, just bought the toolkit, watched all the tutorial videos (some more than once), and am loving it!

    I have a few projects in mind and want to start with the simplest one, which has some rules like classic Chess:
    • Each player can only move one unit per turn
    • Each unit's movement is defined by a pattern instead of pathfinding on a range
    I looked into the TurnManager and Move ability but there are a lot of assumptions that I'm not sure how to break.

    Any help greatly appreciated!

    Cheers
    Hi, glad to hear that you're enjoying the toolkit The things you mention are indeed built with some assumptions, but they are easy to swap out. I designed the turn manager and abilities to be easy to replace and overwrite for precisely these sorts of reasons.

    For your first question on initiative I would use the strategy turn manager (BP_TurnManager_Strategy) and make the following change:

    Note that this will not make too much sense for the AI, which will always use the first unit in initative. If you are using AI and want it to intelligently choose the optimal unit to use it will require some more work. Let me know if this is what you're going for, but first see if the above suggestion fits what you are after. To choose to use the strategy turn manager set the game mode to BP_ATBTT_Strategy (or simply change the turn manager class variable in whatever BP_ATBTT based game mode you are using)

    For your second question, this makes sense to set up in an ability. Patterns can be generated in many ways, but you need to figure out the appropriate algorithm. The GetTilesInRange function in BP_GridManager is a pattern function that finds a square or diamond shaped pattern. You can follow its example to create patterns of your own.

    A quicker but somewhat less performant option is to use the output of GetIndexesInRange and filter it to the shape of your pattern. You could for instance create a cross by taking the array output by GetIndexesInRange and only keeping indexes that are an equal distance away from the center grid index in the X and Y axes.

    Note that if you use GetIndexesInRange, it does not do any checks on the output grid indexes to ensure they are real tiles on the grid, so before using them for gameplay loop through them and check a grid sized array like GridLocations to only keep the valid ones. FindTilesInRange is set up to do this already.

    Leave a comment:


  • replied
    Hello!

    Longtime designer, just bought the toolkit, watched all the tutorial videos (some more than once), and am loving it!

    I have a few projects in mind and want to start with the simplest one, which has some rules like classic Chess:
    • Each player can only move one unit per turn
    • Each unit's movement is defined by a pattern instead of pathfinding on a range
    I looked into the TurnManager and Move ability but there are a lot of assumptions that I'm not sure how to break.

    Any help greatly appreciated!

    Cheers

    Leave a comment:


  • replied
    Originally posted by LuxJahi View Post
    do you have a donation section?
    Nope, but thanks for the offer You having bought the toolkit is enough

    Leave a comment:


  • replied
    do you have a donation section?

    Leave a comment:


  • replied
    LuxJahi: Ok, try this on for size:



    Leave a comment:


  • replied
    Originally posted by Monokkel View Post

    Ok, so I see a few mistakes here. I will point out the obvious mistakes I am seeing, but cannot give you more specific suggestions, since I'm not sure exactly what you are trying to achieve? Do you want a timer displayed on the screen that counts down from 5, once per second, before the goblin turn starts?
    soo the 5 second rule was just for testing. didnt want to wait a long time to see if it workied. yes i do want a timer for when the goblins turn starts. not each goblin, just the faction

    Originally posted by Monokkel View Post
    The PlayerInputCountdown function looks a bit weird to me. You are aware that delays don't work within functions? The DelayAllActions isn't really a delay, but rather a command to have the action system delay continuing the action queue. From how I read it I think this function would print 12345 immediately during the same tick and then you would have a five second delay in the action queue based on five one-second delay actions back to back. I think this is probably not what you're after?
    ok soo it seems like im looking in the wrong section basically im trying to give time for the players to input what they want to do.
    for example:

    players watch game > delay + countdown begin > players type in chat > outside program handles chat > outside program translates chat > outside program saves chat input into files > ue4 reads files > timer finishes > ue4 reads new information > ue4 saves new info as variables, arrays, etc... > ue4 follows normal ai process while overriding final decisions with the new variables > enemy ai procceeds as normal > rinse and repeat.

    i have found many tutorials for explaining various methods of how to update the game at runtime but before i can get there i need to find a way to delay the combat so i can give players a chance to enter their commands


    Originally posted by Monokkel View Post
    From the last two screenshots it seems you have misunderstood how casts work. The game mode is not of type turn manager, and casting it won't make it so. Similarly the Owning player is not a turn manager. Casting is a way to check if a reference is of a specific class, and if so you are able to access its variables. So, for instance, you can have a reference to a unit in a blueprint. The reference is of the type BP_Unit. However, the unit stored in this reference right now is actually of the class BP_Unit_Anim. You want to have access to the variables and functions that are specific to BP_Unit_Anim, but UnrealEngine does not know that your variable is of this class (since the reference variable is of type BP_Unit). This is when you cast it to access the child class. I recommend checking out the documentation on casting here: https://docs.unrealengine.com/en-US/...des/index.html
    i probably have misunderstood how they work. i have only been successful once with it.

    honestly and probably really shameful, i keep the ue documentation open on my second screen the entire time im working. on this. i try to look at as many tutorials as possible so i dont bug you. as a result i end up here anyways cause its something i havent seen anyone else do before although, i dont feel like its anything new.

    Leave a comment:


  • replied
    Originally posted by codeyhanson View Post
    Here are the steps to reproduce the issue basically the hybrid map move the grid from 0,0,0 the character and the camera will teleport to 0,0,0 applied your fix and it kind of works but if you try to move the camera the camera teleports back to 0,0,0 here is a video for a step by step

    https://youtu.be/UU7PIz1lTiU


    Sorry to be so much trouble but you really are the best.
    No problem at all. Questions like these help me sort out issues with the toolkit. Seems like this is not specific for the Hybrid map, but rather a bug in the code for constraining the camera to the grid, which was added in the last update. I will work on a fix for this, but for now set bConstrainCameraToGrid to false in BP_GridCamera_Hybrid.

    Edit: Ok, fixed it. If you want to keep ConstrainToGrid active, here is how you fix it (changes are the conversions back and forth from grid space):

    Last edited by Monokkel; 09-10-2020, 10:16 AM.

    Leave a comment:


  • replied
    Here are the steps to reproduce the issue basically the hybrid map move the grid from 0,0,0 the character and the camera will teleport to 0,0,0 applied your fix and it kind of works but if you try to move the camera the camera teleports back to 0,0,0 here is a video for a step by step

    https://youtu.be/UU7PIz1lTiU


    Sorry to be so much trouble but you really are the best.

    I assume the fix is to be found in BP_GridCamera_Hybrid
    Last edited by codeyhanson; 09-10-2020, 09:28 AM.

    Leave a comment:


  • replied
    Sorry for the late reply, people. The last couple of days were very busy. I'll get to your questions now:

    Originally posted by SpamBotWinner View Post
    Hello, I'm just curious, what is the idea behind Action System? I just want to know its pros and cons, especially as part of the multiplayer system.
    Hi SpamBotWinner, there are several benefits to the action system, both in regards to multiplayer and otherwise. Firstly it is a tried and true way to design turn based games. Games like Hearthstone, XCOM and Gears Tactics work like this under the hood (hints to this is how the EndTurn button in Hearthstone is immediately disabled if you initialize some RNG based spell which eventually results in a player death, or how you get an achievement in XCOM for killing a new type of enemy right at the start of the AI's turn instead of after you hit it with an overwatch shot seconds later).

    One benefit can be seen in considering how you would have to structure your code without an action system. Say you have an AI unit who wants to move to a tile and attack a unit. Without an action system you would need a function or event dispatcher to make a call to the attack system after movement has ended. Then the attack system would have to make a call to a damage dealing system etc. You can quickly end up with spaghetti code where all sorts of objects point and execute events in other objects, which becomes confusing and requires manual setup for every single thing you want to be able to call in sequence. The action system provides a standardized way to call events in sequence, which can call an arbitrary sequence of actions.

    The action system is also effectively a sectioning off of gameplay logic and what is visually transmitted to the player. A benefit of this is that all the gameplay logic would work the same if you changed everything on the visual layer, which makes it easier to do extensive modifications of the toolkit.

    The fact that all the game logic for a turn (or indeed several turns) can be carried out over a single tick (instead of waiting for animations to finish) opens for many advanced possibilities. You could in theory have an AI test out several different options before deciding on the best one, and only then queueing the resulting actions. You could even do this for multiple AI units to enable coordination (Gears Tactics does this). Knowing before the turn starts animating all the things that will happen during the turn opens up for many possibilities, such as guiding the camera in a way that will best capture the action etc.

    So for these reasons, even if it did not improve multiplayer, I would still want to have an action system. However, another benefit is that the action system essentially takes care of replication for you. You generally want all game logic to happen on the server, while still showing to the players what they need to see. This distinction is built into the action system, and any variable passed through an action is automatically replicated, meaning you don't have to mess around with manually replicating variables and calling RPCs. Each client is also responsible for their own action queue, which results in lagless animation within each action. In a real time game you will have to continously update the location of a moving actor to all clients (and often build in prediction algorithms for when transmission is slow). For actions the client gets a single command once and then it takes care of the entire animation itself, meaning that you will never see a unit lagging during movement.

    I hope that made things clear. Note that I am making some major changes to the action system in the coming update. Although the current system is functional, it feels a bit hacky, and it is easy to make coding mistakes in forgetting to end an action or ending an action twice, which causes many strange issues. The current setup also creates quite a bit of circular dependencies and runs into many of the problems related to OOP (you have to inherit from an actor in order to access its action). I'm moving to a system of encapsulating actions within actors, which makes everything a lot cleaner.

    Originally posted by codeyhanson View Post
    I was not able to solve it I really Tried I assume there is a fix to be found in the bp manger or the grid camera hybrid but I was unable to find one
    No worries, I'll see if I can solve it. I'm not exactly sure what the problem is, though. Could you give me the exact steps to reproduce the issue you are seeing?

    Originally posted by LuxJahi View Post
    ok sooo im back with kind of a dumb issue, and seeking some advice. before you ask, yes i have been looking at tutorials. now on to the issue in question.

    first is the goal
    Goal: make a delay based on faction and display a count down timer to match it.

    so far i created a working delay. its not pretty but it works.
     
    Spoiler


    the function works like this

     
    Spoiler


    the issue i am having tho is with trying to make a ui widget to call for the seconds left in the delay
     
    Spoiler


    it gives me this error

     
    Spoiler


    i have also tried this to make it work buuuut, it dosent display anything
     
    Spoiler


    lastly: i looked into world settings and tried to make sure i was calling correct sections. i have tried with your hud and with a hud i made. clearly im doing something wrong

     
    Spoiler
    Ok, so I see a few mistakes here. I will point out the obvious mistakes I am seeing, but cannot give you more specific suggestions, since I'm not sure exactly what you are trying to achieve? Do you want a timer displayed on the screen that counts down from 5, once per second, before the goblin turn starts?

    The PlayerInputCountdown function looks a bit weird to me. You are aware that delays don't work within functions? The DelayAllActions isn't really a delay, but rather a command to have the action system delay continuing the action queue. From how I read it I think this function would print 12345 immediately during the same tick and then you would have a five second delay in the action queue based on five one-second delay actions back to back. I think this is probably not what you're after?

    From the last two screenshots it seems you have misunderstood how casts work. The game mode is not of type turn manager, and casting it won't make it so. Similarly the Owning player is not a turn manager. Casting is a way to check if a reference is of a specific class, and if so you are able to access its variables. So, for instance, you can have a reference to a unit in a blueprint. The reference is of the type BP_Unit. However, the unit stored in this reference right now is actually of the class BP_Unit_Anim. You want to have access to the variables and functions that are specific to BP_Unit_Anim, but UnrealEngine does not know that your variable is of this class (since the reference variable is of type BP_Unit). This is when you cast it to access the child class. I recommend checking out the documentation on casting here: https://docs.unrealengine.com/en-US/...des/index.html

    Leave a comment:


  • replied
    ok sooo im back with kind of a dumb issue, and seeking some advice. before you ask, yes i have been looking at tutorials. now on to the issue in question.

    first is the goal
    Goal: make a delay based on faction and display a count down timer to match it.

    so far i created a working delay. its not pretty but it works.
     
    Spoiler


    the function works like this

     
    Spoiler


    the issue i am having tho is with trying to make a ui widget to call for the seconds left in the delay
     
    Spoiler


    it gives me this error

     
    Spoiler


    i have also tried this to make it work buuuut, it dosent display anything
     
    Spoiler




    lastly: i looked into world settings and tried to make sure i was calling correct sections. i have tried with your hud and with a hud i made. clearly im doing something wrong

     
    Spoiler

    Leave a comment:

Working...
X