Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

  • replied
    Originally posted by Toad N11 View Post
    Hey, so im posting in here in response to my recent comment on the ue4 marketplace about the hybrid units with the attachment issues. To describe why this would be necessary for the my game-the game functions in exploration with a third person camera but for a party of 4 user controlled players. I am setting it up so that you can switch between the four to which you are controlling and which 3 are set to follow (think similar to wasteland except the non combat camera is closer in).
    Hi Toad, this should do the trick:


    Originally posted by Toad N11 View Post
    Another question I have- i am setting it up so that movement and attacks are using the same action points resource. The idea here is that if an attack costs 2 ap and you have 4 ap then you can attack twice with that one unit in the same turn. However I'm having trouble finding where exactly it calls the units turn to end on an attack. Ie by solving this i am in hopes that I can have it so that you could potentially with enough ap have a turn with one unit that goes- Attack, Move, Attack.
    All the default abilities call the SignalAbilityExecuted event after they have been used. This in turn calls RunAfterAbilityExecute in the TurnManager, which by default ends the current unit's turn if it has 0 AP remaining. Abilities have a bool called bUseEndsTurn which causes AP to be set to 0 no matter how many remain if PayAPCost is called. You would naturally want to set this to false for your ability. Also setting MoveCostType in the ability to FromPathfindingCost will cause the AP cost when moving to be determined by the cost of moving to a tile (this can be overridden in abilities). Hope that is enough to get you started.

    Originally posted by Toad N11 View Post
    Lastly as a suggestion (idk if you take them but i think it would be really great for this kit) - the only thing that feels like a disconnect between this kit and many games that emulate it are that you can't tell when a movement will put you in range of an attack. I suggest something similar to wasteland 3 where a line draw is made between a tile that is hovered over and a unit that is in range of an attack. I will try to come up with something for that as follows (and correct me if there's a better way with this kit's setup): in the hover over tile function during movement- get the current units array of abilities. Check this array of abilities for each ones range. Take the highest value and draw a line from the tile hovered over to all units within that range. (might have to separate out abilities cast to enemies and allies and draw out green and red lines respectively)
    Thanks for the suggestion. I actually had that feature in some earlier versions, where a crosshair showed up next to the health bar of enemies that could be attacked from a tile. It got removed during a refactoring, but it is something I'll put on the list of things to add back in the future.

    Leave a comment:


  • replied
    Hey, so im posting in here in response to my recent comment on the ue4 marketplace about the hybrid units with the attachment issues. To describe why this would be necessary for the my game-the game functions in exploration with a third person camera but for a party of 4 user controlled players. I am setting it up so that you can switch between the four to which you are controlling and which 3 are set to follow (think similar to wasteland except the non combat camera is closer in).

    Another question I have- i am setting it up so that movement and attacks are using the same action points resource. The idea here is that if an attack costs 2 ap and you have 4 ap then you can attack twice with that one unit in the same turn. However I'm having trouble finding where exactly it calls the units turn to end on an attack. Ie by solving this i am in hopes that I can have it so that you could potentially with enough ap have a turn with one unit that goes- Attack, Move, Attack.

    Lastly as a suggestion (idk if you take them but i think it would be really great for this kit) - the only thing that feels like a disconnect between this kit and many games that emulate it are that you can't tell when a movement will put you in range of an attack. I suggest something similar to wasteland 3 where a line draw is made between a tile that is hovered over and a unit that is in range of an attack. I will try to come up with something for that as follows (and correct me if there's a better way with this kit's setup): in the hover over tile function during movement- get the current units array of abilities. Check this array of abilities for each ones range. Take the highest value and draw a line from the tile hovered over to all units within that range. (might have to separate out abilities cast to enemies and allies and draw out green and red lines respectively)

    Leave a comment:


  • replied
    Originally posted by behappyandsm1le View Post
    Hi,

    First of all, thanks so much for your recommendation a few months ago to try Steam Remote Play for my game. It was the perfect recommendation for what I needed and I got a beta on the Steam store
    Happy to hear that! Feel free to post a link

    Originally posted by behappyandsm1le View Post
    I'm thinking of taking on a C++ project to build an AI for the game. I know there is functionality within ATBTT for AI but I want to learn C++ and need to build something more complex. Couple questions:

    1) Is my assumption correct that I would be able to build a more powerful AI in C++? (obviously will also require much more work)
    Yes and no. The great benefit of C++ is of course speed. For a lot of stuff that much speed is unneeded and blueprints work just fine, but AI is one of those things that can get really resource heavy depending on what you want to do. So if you are designing the kind of AI that will be doing a very large number of calculations in a very short time C++ will let you do more.

    Originally posted by behappyandsm1le View Post
    2) AFAIK, for the program to be able to capture the game state, my whole project (maybe just part of my project?) would need to be represented in C++, so do you know if there is a reliable way to convert from blueprints? Or any other ideas you have here could be helpful.
    If all you want C++ for is your AI, then all you need to expose to C++ is whatever your AI will be using. You likely want access to the grid arrays such as GridLocations, GridEdges etc. as well as pathfinding, LoS etc. But you probably don't need access to how you are animating your units, for instance.

    Your C++ code will not be able to access variables you have declared in blueprints (without a lot of awkward workarounds), so you would want to create C++ versions of the classes you want to access in C++ and reparent their respective blueprint classes to these new classes. Then you would define any variables you need to access in the C++ version of the class and replace any references to the old blueprint variables with the new C++ variables.

    I have already converted many of the resource heavy blueprints such as these to C++. I can share them with you if you are interested. Be aware that implementing it will take some work, though.

    3) Alternatively, if I didn't need to convert my whole project to C++, from what I understand, I can add C++ elements to the blueprint project, and I just wanted to make sure that was also correct.

    Thanks, and hope you're well[/QUOTE]

    Indeed you can. It is absolutely possible to combine C++ and blueprints in a UE4 project. Epic does this for all their internal projects and blueprints were designed with this in mind.

    Leave a comment:


  • replied
    Hi,

    First of all, thanks so much for your recommendation a few months ago to try Steam Remote Play for my game. It was the perfect recommendation for what I needed and I got a beta on the Steam store

    I'm thinking of taking on a C++ project to build an AI for the game. I know there is functionality within ATBTT for AI but I want to learn C++ and need to build something more complex. Couple questions:

    1) Is my assumption correct that I would be able to build a more powerful AI in C++? (obviously will also require much more work)

    2) AFAIK, for the program to be able to capture the game state, my whole project (maybe just part of my project?) would need to be represented in C++, so do you know if there is a reliable way to convert from blueprints? Or any other ideas you have here could be helpful.

    3) Alternatively, if I didn't need to convert my whole project to C++, from what I understand, I can add C++ elements to the blueprint project, and I just wanted to make sure that was also correct.

    Thanks, and hope you're well

    Leave a comment:


  • replied
    Originally posted by admlsnackbar View Post

    Awesome, this worked like a charm! I was able to make Stun and Poison effects pretty easily, complete with FX.

    Next up is Traps. I've had some different ideas about how to implement them - as specialized Units, as Status Effects, or as an entirely new BP class. Do you have any thoughts on this? It seems like a new BP class is the way to go, with OnTriggered events being called from the Grid Manager when a unit enters the Trap's grid index or when a turn countdown expires, and giving the Grid Manager a new Grid Array (GridTraps).
    There is an example map with traps included in ATBTT. Check out Maps/Experimental/InterruptedMovement. They are a separate actor (based off BP_GridObject). They are a bit hacky in their current form, but I am working on improving them in the next update.

    Leave a comment:


  • replied
    Originally posted by Monokkel View Post

    Great! As for status effects I haven't made a tutorial yet, but here is the rundown:

    Status effects are actors. They have an event called Activate that takes a unit as input. When it is called the status effect is added to a status effect array in the ability system component of the unit (it fails if the unit has no ability system component. If you're adding a status effect through an ability you can use the AddStatusEffect function in BP_Ability. If you want something to happen when the status effect is activated you will extend the Activate function in the child blueprint (remember to call the parent event first. Check out the mind controll status effect for an example).

    After this status effect has two main events you want to care about, which is the RunOnTurnStart and RunOnTurnEnd events. These are called as part of the RunOnActorBeginTurn/EndTurn events in BP_Unit, which are again called form the turn manager. Different turn managers call these at different times. BP_TurnManager and BP_TurnManager_Strategy call these for all units when a faction starts/ends its turn, while BP_Turn_Manager_Initiative call them when each individual unit is activated/deactivated.
    Awesome, this worked like a charm! I was able to make Stun and Poison effects pretty easily, complete with FX.

    Next up is Traps. I've had some different ideas about how to implement them - as specialized Units, as Status Effects, or as an entirely new BP class. Do you have any thoughts on this? It seems like a new BP class is the way to go, with OnTriggered events being called from the Grid Manager when a unit enters the Trap's grid index or when a turn countdown expires, and giving the Grid Manager a new Grid Array (GridTraps).

    Leave a comment:


  • replied
    Originally posted by admlsnackbar View Post
    Nope, that is exactly what I'm going for! I reverted my changes and tried again, and this time it worked...there must have been a missing node connection somewhere

    Thanks for looking into it! I'm also starting to make some Status Effects, can you give me a quick explanation of how that system works (or point me to a tutorial somewhere?).

    Cheers!
    Great! As for status effects I haven't made a tutorial yet, but here is the rundown:

    Status effects are actors. They have an event called Activate that takes a unit as input. When it is called the status effect is added to a status effect array in the ability system component of the unit (it fails if the unit has no ability system component. If you're adding a status effect through an ability you can use the AddStatusEffect function in BP_Ability. If you want something to happen when the status effect is activated you will extend the Activate function in the child blueprint (remember to call the parent event first. Check out the mind controll status effect for an example).

    After this status effect has two main events you want to care about, which is the RunOnTurnStart and RunOnTurnEnd events. These are called as part of the RunOnActorBeginTurn/EndTurn events in BP_Unit, which are again called form the turn manager. Different turn managers call these at different times. BP_TurnManager and BP_TurnManager_Strategy call these for all units when a faction starts/ends its turn, while BP_Turn_Manager_Initiative call them when each individual unit is activated/deactivated.

    Leave a comment:


  • replied
    Nope, that is exactly what I'm going for! I reverted my changes and tried again, and this time it worked...there must have been a missing node connection somewhere

    Thanks for looking into it! I'm also starting to make some Status Effects, can you give me a quick explanation of how that system works (or point me to a tutorial somewhere?).

    Cheers!

    Leave a comment:


  • replied
    Originally posted by admlsnackbar View Post
    Hello again!

    I've been making some great progress, but ran into another issue tonight. I made an ability in which the owning unit kills itself. This seems to mess up the turn manager - once the ability finishes, the game hangs on the current player's turn. Even clicking the manual End Turn does nothing.

    Per your suggestion, I am using BP_TurnManager_Strategy. Here are the relevant BPs:

    Turn Manager Strategy
    Click image for larger version

Name:	TurnManager.png
Views:	99
Size:	89.4 KB
ID:	1815631

    Kamikaze Ability
    Click image for larger version

Name:	SuicideAbility.png
Views:	89
Size:	88.1 KB
ID:	1815632

    I stepped through the Turn Manager in debug and it seems to process everything through EndActiveFactionTurn and EventBeginActiveFactionTurn correctly.

    Thanks in advance!
    Hi, I tested it out with some slightly simpler code and it seems to work fine? This ability is a duplicate of BP_Ability_MoveAttack with an overridden ExecuteAbility function:

    Here is the result:


    Perhaps you're going for something different?

    Leave a comment:


  • replied
    Hello again!

    I've been making some great progress, but ran into another issue tonight. I made an ability in which the owning unit kills itself. This seems to mess up the turn manager - once the ability finishes, the game hangs on the current player's turn. Even clicking the manual End Turn does nothing.

    Per your suggestion, I am using BP_TurnManager_Strategy. Here are the relevant BPs:

    Turn Manager Strategy
    Click image for larger version

Name:	TurnManager.png
Views:	99
Size:	89.4 KB
ID:	1815631

    Kamikaze Ability
    Click image for larger version

Name:	SuicideAbility.png
Views:	89
Size:	88.1 KB
ID:	1815632

    I stepped through the Turn Manager in debug and it seems to process everything through EndActiveFactionTurn and EventBeginActiveFactionTurn correctly.

    Thanks in advance!

    Leave a comment:


  • replied
    Originally posted by 猫狗乱舞 View Post

    Thank you for your enthusiastic reply. I just learned to use blueprints. I have benefited a lot from reading your work. It looks very elegant

    Is there a problem with the old version of ATTBT? I bought it recently, I thought it was a new version

    Will the new version of ATTBT also have this problem in 4.25? How can I get the new version of ATTBT


    if the updated version is released, can the content of the new version be added? I saw the update of the action system mentioned above, I think it is very useful
    No, this is a problem with the newest version of ATBTT. More specifically it seems to be a problem with Unreal Engine 4.25, since the same problem happens if I open older versions of ATBTT (which I know did not have this problem) in UE4.25. As you have read I am working on an update that improves the action system. It is not available yet, but I will release it along with the first full version of UE4.26 UE4.26 preview 1 got released yesterday and it usually takes 1-2 months between the first preview release and the first full version release. Converting an ATBTT project to the new version will require quite a lot of manual work, as I have made many substantial changes to the toolkit.

    Leave a comment:


  • replied
    Originally posted by Monokkel View Post

    Hi, thanks for the bug report. I have previously done what you describe without having any issues. However, when I test it now I get the same crash that you are seeing, In fact, any change made to BP_ActionManager seems to cause the engine to crash when you run the project. The same thing happens when I open older versions of ATBTT in 4.25, but not in 4.24. This thus seems to be a bug in Unreal Engine and not ATBTT. I have sent a bug report to Epic and I will experiment to see if I can find a workaround. I'm sorry for the inconvenience, but there is not much else I can do at the moment.

    Edit: Ok, I've found a hack that seems to work, but it is pretty weird. Every time you make a change to BP_ActionManager, rename the Actions array to something new, then compile. I do not know why, but this seems to work. You can try doing this until I find a proper fix or Epic fixes this bug in the engine.
    Thank you for your enthusiastic reply. I just learned to use blueprints. I have benefited a lot from reading your work. It looks very elegant

    Is there a problem with the old version of ATTBT? I bought it recently, I thought it was a new version

    Will the new version of ATTBT also have this problem in 4.25? How can I get the new version of ATTBT


    if the updated version is released, can the content of the new version be added? I saw the update of the action system mentioned above, I think it is very useful

    Leave a comment:


  • replied
    Originally posted by 猫狗乱舞 View Post
    -From Google Translator-

    Hello, I want to debug in “Bp_ActionManage", and I want to get the name of the "current action" to understand the currently executing action, but I found that just adding "totext" will cause a crash, even if you delete it and run it, it will crash.


    And, using "getActionName" is the same

    What could be the reason for this?
    Or is there any way to track the sequence of actions?


    Sorry I didn’t notice that many people have mentioned the issue of tracking actions. I don’t know what keywords to search for to get the answer

    Thank you very much

    Engine version: 4.25 ATTBT version: 2.61

    {"alt":"Click image for larger version Name:\t20200924164941.png Views:\t2 Size:\t37.5 KB ID:\t1814844","data-align":"none","data-attachmentid":"1814844","data-size":"full","title":"20200924164941.png"}
    Hi, thanks for the bug report. I have previously done what you describe without having any issues. However, when I test it now I get the same crash that you are seeing, In fact, any change made to BP_ActionManager seems to cause the engine to crash when you run the project. The same thing happens when I open older versions of ATBTT in 4.25, but not in 4.24. This thus seems to be a bug in Unreal Engine and not ATBTT. I have sent a bug report to Epic and I will experiment to see if I can find a workaround. I'm sorry for the inconvenience, but there is not much else I can do at the moment.

    Edit: Ok, I've found a hack that seems to work, but it is pretty weird. Every time you make a change to BP_ActionManager, rename the Actions array to something new, then compile. I do not know why, but this seems to work. You can try doing this until I find a proper fix or Epic fixes this bug in the engine.
    Last edited by Monokkel; 09-24-2020, 03:28 PM.

    Leave a comment:


  • replied
    -From Google Translator-

    Hello, I want to debug in “Bp_ActionManage", and I want to get the name of the "current action" to understand the currently executing action, but I found that just adding "totext" will cause a crash, even if you delete it and run it, it will crash.


    And, using "getActionName" is the same

    What could be the reason for this?
    Or is there any way to track the sequence of actions?


    Sorry I didn’t notice that many people have mentioned the issue of tracking actions. I don’t know what keywords to search for to get the answer

    Thank you very much

    Engine version: 4.25 ATTBT version: 2.61

    Click image for larger version  Name:	20200924164941.png Views:	2 Size:	37.5 KB ID:	1814844
    Last edited by 猫狗乱舞; 09-24-2020, 10:48 AM.

    Leave a comment:


  • replied
    Originally posted by SpamBotWinner View Post

    Ty for your response. Hope to see your new ability system) I'm new to this and for me its hard to track what action is running right now (especially with ue debug coz for some reasons it hates interfaces and most of the time refuses to proceed to the interface's function execution and just skips it (it was a nightmare to fix my bug in Select actor event).
    I hear you. The current implementation of the action system is indeed tricky to debug, and easy to lose track of. I am making many changes in the coming update, but making the action system simpler to work with has been my number one priority.

    Leave a comment:

Working...
X