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




    Anchor offset should not affect it. That is just if you want to offset all tiles, which is currently only used for multi-tile units that have a center between tiles. I'm guessing you're not passing the vector locations to the action properly. Not sure what could be wrong here. Could you screenshot your setup and post it here?
    I started taking screenshots...and noticed I had deleted 1 branch... inserting it again made everything work. I wish the compile would sometimes notice these things kinda like missing a semicolon when coding

    Sorry for your time Knut, thanks for answering, and happy for you turning in your PhD!

    Comment


      Originally posted by Juxtapox View Post

      I started taking screenshots...and noticed I had deleted 1 branch... inserting it again made everything work. I wish the compile would sometimes notice these things kinda like missing a semicolon when coding

      Sorry for your time Knut, thanks for answering, and happy for you turning in your PhD!
      Glad you fixed the problem, and thanks!
      The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

      Comment


        Originally posted by Monokkel View Post


        One way is to set PathfindingType of the unit no NoDiagonalMovement. But perhaps you want to enable diagonal movement, but have it cost 2 AP? In that case you have to modify the default edge cost generation. Here is what you need to add:



        This is for a map with no heightmap. If you're using heightmap you need to modify either AddTileEdgesOneLevelHeightmap or AddTileEdgesMultilevelHeightmap the same way.
        This worked great. Only problem is I have to modify the grid manager in core (or i could always create a duplicate). I'd like to be able to just create a child, and then override that function, but for some reason it does crazy things when I try that.

        EDIT: Actually, just figured this out. I had to clear the local edges variable I was using (Because it's overriding a function that not does not end in a return node, it just creates an event in the event graph, so i can't use local variables, so i had to create a new normal variable for it). Now it works perfect! Thanks for the info!

        Click image for larger version

Name:	Capture.PNG
Views:	17
Size:	195.2 KB
ID:	1584931
        Last edited by ridley075; 02-14-2019, 10:35 PM.

        Comment


          The AI loops through all its abilities and generates an estimated value for each. It chooses to use the one with the highest value, but if none have a value higher than 0 they just skip their turn. If they have no abilities they should just skip their turn.
          How can we control that? I have an aimed and snap shot. If they don't move, they can aim and have a better hit chance, if they do they can move and snap shot with a lower hit percent.

          Comment


            Originally posted by Monokkel View Post

            Hi Mars, the easiest way to do this is to change the places where the EndActiveActorTurn function is normally called to the EndEntireFactionTurn function (which is in BP_TurnManager). In the normal example map this is done in BP_PlayerController_ATBTT (at the right side of the WidgetInput comment box), in BP_Unit (right side of the Select Actor comment box), and in BP_MoveAttack (bottom right of the Click comment box). Hope that gives you the result you want.
            Ok like I said in my previous message, it work but I noticed something.

            If I move a unite and don't attack or end my turn I can move others unit too.

            What I want is if I take the decision to move a unite I can't move other unit until my next turn even if I don't attack or end my turn. Because I want player to be able to move only one unit by turn.

            Thank you for you support.

            Comment


              Originally posted by Monokkel View Post
              I'm guessing that maybe you forgot to disable collision for the tree mesh so that it blocks line of sight?
              The updated videos on the basic stuff would do me real good...Yeah, like you said, I had to tweak collisions. It's all very basic stuff I'm dealing with I think: now I'm trying to correctly make this child unit BP die; everything is working fine except the static mesh I added stays on the grid even after the unit dies and the tile is freed.

              I can't understand some aspects of the BP_Unit events. There is a "Kill Unit" event, triggered from the Take Damage function, which I assumed is responsible for removing the unit from the game once it's dead. However, after debugging with breakpoints it seems it only is activated on the last kill before win/lose condition is achieved?

              Click image for larger version

Name:	bp6.jpg
Views:	17
Size:	57.0 KB
ID:	1585419

              It's so bizarre, since the Branch condition is a simple "if the unit's health is <= 0"...And yet the game only pauses at the breakpoint on the last kill of a faction unit, AFAIK.

              Also, what's a good debug way to find out what blueprint is calling another blueprint's events/functions? Print pins and breakpoints don't allow you to see what came before them, and the Reference Viewer doesnt include references made outside the current BP.
              Artstation | 3D Artist | Krakow

              Comment


                Originally posted by ridley075 View Post

                This worked great. Only problem is I have to modify the grid manager in core (or i could always create a duplicate). I'd like to be able to just create a child, and then override that function, but for some reason it does crazy things when I try that.

                EDIT: Actually, just figured this out. I had to clear the local edges variable I was using (Because it's overriding a function that not does not end in a return node, it just creates an event in the event graph, so i can't use local variables, so i had to create a new normal variable for it). Now it works perfect! Thanks for the info!
                Overriding functions in blueprints is a bit weird like that. You'll notice that quite a few of my functions have a boolean output variable called bSuccess that isn't really used. This is mainly so that child blueprints overriding this function will have it overridden as a function and not an event.

                Originally posted by crossmr View Post
                How can we control that? I have an aimed and snap shot. If they don't move, they can aim and have a better hit chance, if they do they can move and snap shot with a lower hit percent.
                If you're basing your abilities on BP_Ability_Laser the AI value calculation is largely based around hit percent chances. It loops through all tiles in move range and checks the hit chance to hit various enemies from each tile, as well as the chance of being hit from those units at each tile. You can add your hit chance modification into that code as well. The simplest way to do this is to modify the FindAbilitySpecificTileValueModifier function of Laser. Something like this should do the trick:



                Originally posted by MarsOdysseus View Post

                Ok like I said in my previous message, it work but I noticed something.

                If I move a unite and don't attack or end my turn I can move others unit too.

                What I want is if I take the decision to move a unite I can't move other unit until my next turn even if I don't attack or end my turn. Because I want player to be able to move only one unit by turn.

                Thank you for you support.
                I'm assuming you're basing the abilities of your units off BP_Ability_MoveAttack. The code for switching to another unit for this ability is held in the DefaultClick function of BP_Ability. You need to add a check here that prevents you from switching units if the current unit has already acted (which in the default toolkit means that it has less than its max AP). This should work:


                Originally posted by Justo View Post

                The updated videos on the basic stuff would do me real good...Yeah, like you said, I had to tweak collisions. It's all very basic stuff I'm dealing with I think: now I'm trying to correctly make this child unit BP die; everything is working fine except the static mesh I added stays on the grid even after the unit dies and the tile is freed.

                I can't understand some aspects of the BP_Unit events. There is a "Kill Unit" event, triggered from the Take Damage function, which I assumed is responsible for removing the unit from the game once it's dead. However, after debugging with breakpoints it seems it only is activated on the last kill before win/lose condition is achieved?

                Click image for larger version

Name:	bp6.jpg
Views:	17
Size:	57.0 KB
ID:	1585419

                It's so bizarre, since the Branch condition is a simple "if the unit's health is <= 0"...And yet the game only pauses at the breakpoint on the last kill of a faction unit, AFAIK.

                Also, what's a good debug way to find out what blueprint is calling another blueprint's events/functions? Print pins and breakpoints don't allow you to see what came before them, and the Reference Viewer doesnt include references made outside the current BP.
                Yep, I know updated videos are sorely needed. I'm planning to start working on that next weekend. The code for destroying units is a bit weird in the toolkit, and it is because of the action system and multiplayer. You don't want to destroy a unit actor as part of the server side code, because all that stuff happens instantly, before animations are run. The units cannot be destroyed before all their animations have finished running. However, the unit still needs to be dead as far as the game logic is concerned, so it is removed from the GridUnits and InitiativeOrder arrays/maps (The RemoveUnitFromGame function).

                Also, if the game is multiplayer we cannot simply destroy the unit immediately after the death animation is done playing on the server, as the clients might lag behind due to poor connections. Because of this a special action is called using the action system (called QueueDestroy). This action is run by the action manager, setting a life span to destroy the actor. This is by default set to 30 seconds, which should prevent issues for anything but the most extreme network issues. I'm not that happy with this hardcoded timer, though, and am currently working on a more flexible and intelligent solution to this particular problem.

                Anyways, for your particular unit this means that you need to add functionality that hides it after it is killed, from the reference point of the client, but is still not destroyed, from the game logic's point of view. Check out BP_Unit_Anim and the AnimateDeath event where the health bar is hidden. You want to hide the unit mesh here as well.
                The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                Comment


                  Originally posted by Monokkel View Post

                  Yep, I know updated videos are sorely needed. I'm planning to start working on that next weekend. The code for destroying units is a bit weird in the toolkit, and it is because of the action system and multiplayer. You don't want to destroy a unit actor as part of the server side code, because all that stuff happens instantly, before animations are run. The units cannot be destroyed before all their animations have finished running. However, the unit still needs to be dead as far as the game logic is concerned, so it is removed from the GridUnits and InitiativeOrder arrays/maps (The RemoveUnitFromGame function).

                  Also, if the game is multiplayer we cannot simply destroy the unit immediately after the death animation is done playing on the server, as the clients might lag behind due to poor connections. Because of this a special action is called using the action system (called QueueDestroy). This action is run by the action manager, setting a life span to destroy the actor. This is by default set to 30 seconds, which should prevent issues for anything but the most extreme network issues. I'm not that happy with this hardcoded timer, though, and am currently working on a more flexible and intelligent solution to this particular problem.

                  Anyways, for your particular unit this means that you need to add functionality that hides it after it is killed, from the reference point of the client, but is still not destroyed, from the game logic's point of view. Check out BP_Unit_Anim and the AnimateDeath event where the health bar is hidden. You want to hide the unit mesh here as well.
                  Thats actually the only thing that is keeping me away from buying your toolkit.... videos are tooooo outfdated

                  Comment


                    I'm struggling to get collision on the walls to work properly. It seems random. The same wall blocks one path but not another. My intent is to have doors that open so collision on the door and wall have to be correct. This is fairly easy in UE4 and works as intended in my other projects. Thank you.

                    Update: Collision is resolved but I am unable to figure out how to allow the mouse to interact with objects like opening a door.
                    -Nick
                    Last edited by NickNasti; 02-25-2019, 10:01 AM.

                    Comment


                      Originally posted by A-J-K View Post

                      Thats actually the only thing that is keeping me away from buying your toolkit.... videos are tooooo outfdated
                      Yep, the early ones especially, which is of course extra annoying for beginners. New tutorials are coming soon.

                      Originally posted by NickNasti View Post
                      I'm struggling to get collision on the walls to work properly. It seems random. The same wall blocks one path but not another. My intent is to have doors that open so collision on the door and wall have to be correct. This is fairly easy in UE4 and works as intended in my other projects. Thank you.
                      -Nick
                      How have you set up the grid manager? Are you using the Trace for Walls option for this? If so, make sure your meshes are blocking the WallTrace channel. If this is already the case, send me a screenshot of your setup and I'll try to figure out what might be wrong.
                      The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                      Comment


                        Originally posted by Monokkel View Post

                        Yep, the early ones especially, which is of course extra annoying for beginners. New tutorials are coming soon.



                        How have you set up the grid manager? Are you using the Trace for Walls option for this? If so, make sure your meshes are blocking the WallTrace channel. If this is already the case, send me a screenshot of your setup and I'll try to figure out what might be wrong.
                        4.22 is coming soon, i guess this would be a very good opportunity for a fresh documentation... Just saying

                        Comment


                          Hi,found this via a google search for turn-based strategy + unreal, and it looks super-great. Only question I have is, how much can I configure the enemy AI? I'm new to game development, and scripting + AI are the things I'm most interested in.

                          Comment


                            Monokkel Sorry for the late, thank you it work now like I want.

                            One more thing please.

                            I would like to have a simultaneous combat mode. I explain when a unit attack another unit a melee range (1 square around the target) both unit attack each other at the same time.

                            I want it only for melee attack. So if an archer attack from a distance he dont take damage. But if the same archer attack in the mele range of the other unit he take dammage.

                            Can you help me to setup this.

                            Thank You.


                            Comment


                              Originally posted by A-J-K View Post

                              4.22 is coming soon, i guess this would be a very good opportunity for a fresh documentation... Just saying
                              Already on it Just finished recording a new tutorial changing meshes and animations for units and more are planned.

                              Originally posted by Pleamak View Post
                              Hi,found this via a google search for turn-based strategy + unreal, and it looks super-great. Only question I have is, how much can I configure the enemy AI? I'm new to game development, and scripting + AI are the things I'm most interested in.
                              Happy to hear my toolkit is the top recommendation AI is handled within ability blueprints. What this means is that all abilities have customizable code for evaluating the "value" of using a specific ability from a specific tile on a specific target. The AI loops through all these options and decides the best one based on the parameters set. Customizing the AI involves modifying this code. Note that AI is one of the more complex topics of TBS development and the system is pretty involved. It is designed to be highly modular and customizable, though, so once you understand it you can create all sorts of behaviors.

                              Originally posted by MarsOdysseus View Post
                              Monokkel Sorry for the late, thank you it work now like I want.

                              One more thing please.

                              I would like to have a simultaneous combat mode. I explain when a unit attack another unit a melee range (1 square around the target) both unit attack each other at the same time.

                              I want it only for melee attack. So if an archer attack from a distance he dont take damage. But if the same archer attack in the mele range of the other unit he take dammage.

                              Can you help me to setup this.

                              Thank You.
                              I see, that should not be too hard to implement. Basically in the abilities you use, when it normally calls for just the current unit to attack you would also call on the enemy unit to attack back (provided it lives). There might be some complications I'm not seeing, though. I'm busy tonight, but I'll try to look into it tomorrow.

                              Edit: Managed a quick test. Made a copy of BP_Ability_MoveAttack and added this to the end of the ExecuteAbility of that ability. Should be a good starting point:

                              Last edited by Monokkel; 02-24-2019, 11:58 AM.
                              The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                              Comment


                                Originally posted by Monokkel View Post

                                Already on it Just finished recording a new tutorial changing meshes and animations for units and more are planned.
                                Nice!
                                Just a little question, your hex tile toolkit looks kinda Mutan Year Zero / Xcom 2 style when it comes to the actual game play "mechanic". Is it posible to change this mechanic, to a more kinda RTS style gameplay? What i basically mean is, free movent of lets say 5 or 10 units through the hex or quad tiles, not this i make a move... the AI makes a move mechanic etc... If you know what i mean... The same guestion goes for the multiplayer mode.

                                Comment

                                Working...
                                X