Announcement

Collapse
No announcement yet.

Advanced Locomotion System V3

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

    Originally posted by CrashA51 View Post
    Still trying to add "Crouching" ... taking a closer look at the "Moving State" to see if I need to reconfigure the Crouching state and transitions. Adding transitions from Crouching to both Idle and Moving. Will add slide when hitting crouch, and speed is over 300, and will add "Prone" when holding down B button on the controller ... after I have basic crouching working.

    Do I need to set up the Crouching State like the Movement State, with a Blend Poses, of both a back and forward Crouch Blendspaces?
    Hey, sorry for the delay. So it seems to me like you are doing a little more work than really needed. Ill work you through how I would do it If I were to add crouching.

    So first off, I would most likely create a new Enum called something like "Body Position". I would add 3 enumerators, Standing, Crouching, and Prone. This would help to keep things more organized in the long run so I wouldn't have to deal with a bunch of Booleans.

    Click image for larger version

Name:	Capture1.PNG
Views:	1
Size:	25.0 KB
ID:	1130826

    Then, I would add that enum to the Component, and make a new custom event allowing me to switch it. I would also call the Update Camera Dispatcher and fire the Update Movement Speed Event.

    Click image for larger version

Name:	Capture2.PNG
Views:	1
Size:	107.3 KB
ID:	1130827

    I could then feed that Enum into wherever I wanted in any graph, similar to how locomotion state works.

    Click image for larger version

Name:	Capture3.PNG
Views:	1
Size:	102.2 KB
ID:	1130829

    In the CharacterBP I could use the Input action to call the event in the component, and set it to toggle Standing or Crouching.

    Click image for larger version

Name:	Capture4.PNG
Views:	1
Size:	101.1 KB
ID:	1130828

    Now that the neccessary logic has been added to switch the Enum, I could add it into the AnimBP, so that it can be used there. Then I would make sure the value would get updated properly. The easiest way to do that would be to add it in the 'Get Variables From Pawn' function, and update it to whatever the value from the component is.

    Click image for larger version

Name:	Capture5.PNG
Views:	1
Size:	81.6 KB
ID:	1130830

    At that point I would be free to add that enum anywhere I please into any part of the Event Graph or Animgraph, again, similar to locomotion state. Its actually really simple to get the animations working properly. Because the Grounded State Machine is pretty basic, and contains neccessary transitions for Idle, Moving, and Stopping, there is no reason to add another state exclusively for crouching. It could share all the same states as normal locomotion, since the transition logic is all the same. In the Moving state, I would add a Blend Poses by Enum node using the Body position Node, and then hook up the proper blendspaces, making sure to add them to the 'Locomotion' sync group so the feet cycle properly when blending.

    Click image for larger version

Name:	Capture6.PNG
Views:	1
Size:	173.5 KB
ID:	1130831

    For Idle, its all up to you and how you want your Anims to blend together. You could add a completely new Idle state, and add the nessecary transitions (also add crouching to the Idle Entry Enum)...

    Click image for larger version

Name:	Capture7.PNG
Views:	1
Size:	79.1 KB
ID:	1130832

    Or, you could add the crouching anim into one of the idle states, if the blending works. All up to you.

    Click image for larger version

Name:	Capture8.PNG
Views:	1
Size:	83.8 KB
ID:	1130833

    Also, for stopping, I would just add another selector with Body Position and add the appropriate anims.

    Click image for larger version

Name:	Capture9.PNG
Views:	1
Size:	64.8 KB
ID:	1130834

    Hopefully this sets you on the right track. Once you start working with it more you will understand how flexible the system is designed to be. Let me know if this helps!

    Comment


      Wow, thank you ...

      I was adding Crouched Idle and Crouch Movement States, and it did feel like I was duplicating a lot of work. I will go back and try it the way you suggested.

      Much appreciated

      Comment


        Moving along, but ran into a snag. On the Player Input Graph, not getting Switch Body Position "functions." Then on the Get Variables from Pawn, I am getting an error, asking for a valid target.

        Help!

        Click image for larger version

Name:	PlayerInput.PNG
Views:	2
Size:	108.5 KB
ID:	1130840

        Click image for larger version

Name:	Body_Position.PNG
Views:	1
Size:	107.2 KB
ID:	1130839

        Comment


          Originally posted by CrashA51 View Post
          Moving along, but ran into a snag. On the Player Input Graph, not getting Switch Body Position "functions." Then on the Get Variables from Pawn, I am getting an error, asking for a valid target.

          Help!
          Ok, not sure what you mean by you arent getting the functions in the input graph. As far as the Body Position target, you shouldnt need one. If you create a new Enum in the animBP using the Body position enum, then you can set it. Just make sure you add the Enum in the AnimBP and you shouldnt need a target.

          Comment


            Ya, I am a bit brain dead right now ... in your example the Switch body positions are "functions" ... how did you create them ... because when I drag out the from the switch on body position, all I can select are events, and from my limited understanding, events can't have any output? I though that might be part of the problem. Or am I just an idiot?

            Click image for larger version

Name:	function.PNG
Views:	1
Size:	62.1 KB
ID:	1130841

            Click image for larger version

Name:	PlayerInput.PNG
Views:	2
Size:	108.5 KB
ID:	1130842

            Comment


              Created the Body Position in the AnimBP, set it, and that worked.

              Click image for larger version

Name:	Target.PNG
Views:	1
Size:	50.9 KB
ID:	1130843

              Any guidance on the Events vs Functions for Switch Body Position?

              Comment


                NASA we have Liftoff! .... or should I say crouching. Once you catch on to the ALS system, it is so easy to build upon, just like you said. Tomorrow I will try Prone, then Swimming, ledge grab, the Parkour anims I procured, moon walking ....

                Click image for larger version

Name:	Crouching.PNG
Views:	1
Size:	134.2 KB
ID:	1130845

                Click image for larger version

Name:	Crouched.PNG
Views:	1
Size:	122.7 KB
ID:	1130851
                Last edited by CrashA51; 07-09-2017, 01:46 AM.

                Comment


                  Originally posted by CrashA51 View Post
                  Created the Body Position in the AnimBP, set it, and that worked.

                  Any guidance on the Events vs Functions for Switch Body Position?
                  Well I would use a Custom event, but Im sure a function would do the same thing. Create it in the component, and call it from the CharacterBP.

                  Comment


                    Just cleaning things up ... for anyone following this, you will also need to add Body Position, Blend Poses, with the appropriate "Crouch Idle" Anim, to the GroundedLocomotion > Stopping (state), or the ALS_Idle Additive will cause the character to stand up to the idle position from crouch moving, before stopping in the crouch position.

                    Once add, you you can move in crouch and stop directly in crouch, smooth as butter.

                    Click image for larger version

Name:	Stopping.PNG
Views:	1
Size:	44.8 KB
ID:	1130868

                    Still working on reversing my Crouch foot forward to fit better with Locomotion State 3, and adding the "crouch slide" when sprinting and hitting the crouch button.

                    Comment


                      Question for KingTumTum101 ...

                      I am starting work on adding Prone. Any idea on how to check to see if there is enough clear space to go Prone, to avoid "glitching" and unwanted prone positions, before transitioning into Prone? And when there is a blockage, feed up to the UMG a "Prone Blocked" message, like we see in Black Ops?

                      By the way, love watching my crouching character's head turn the direction of the camera when in Locomotion state 2, thanks to ALS ... without any additional effort on my part. This system really works great. Thanks for all the tips on adding Crouching.
                      Last edited by CrashA51; 07-09-2017, 02:43 PM.

                      Comment


                        Originally posted by CrashA51 View Post
                        Just cleaning things up ... for anyone following this, you will also need to add Body Position, Blend Poses, with the appropriate "Crouch Idle" Anim, to the GroundedLocomotion > Stopping (state), or the ALS_Idle Additive will cause the character to stand up to the idle position from crouch moving, before stopping in the crouch position.

                        Once add, you you can move in crouch and stop directly in crouch, smooth as butter. ]

                        Still working on reversing my Crouch foot forward to fit better with Locomotion State 3, and adding the "crouch slide" when sprinting and hitting the crouch button.
                        The stopping state issue is most likely because an appropriate anim isn't being selected on the stop transition (which fires the stopping anim notify event). But the way you have it now works too. The crouch slide could be done via a montage. Or a separate state could be added off of the moving state. Whichever works best in your case. Theoretically, the grounded state could get as complex as you need it to be, with more transitions and states for different actions, and it would still work well with the system as a whole because it is just inside the the grounded state.

                        Also, to be more clear about the function thing, I'm actually not sure why it says it's a function. I didn't notice that. I created a custom event imside the component which could set the enum, and then in the characterbp I got the reference to the component and dragged off of it to fire the custom event. Hopefully that straightens everything out.

                        Comment


                          Makes sense,

                          And thoughts on "I am starting work on adding Prone. Any idea on how to check to see if there is enough clear space to go Prone, to avoid "glitching" and unwanted prone positions, before transitioning into Prone? And when there is a blockage, feed up to the UMG a "Prone Blocked" message, like we see in Black Ops?"

                          When I sprint, then hit the crouch button, he actually studder steps, quickly shortens his steps, and slows down right into the crouch. Looks really cool. Want to keep that look, so I will need to use press and hold crouch button perhaps to enter the slide.
                          Last edited by CrashA51; 07-09-2017, 03:05 PM.

                          Comment


                            Originally posted by CrashA51 View Post
                            Question for KingTumTum101 ...

                            I am starting work on adding Prone. Any idea on how to check to see if there is enough clear space to go Prone, to avoid "glitching" and unwanted prone positions, before transitioning into Prone? And when there is a blockage, feed up to the UMG a "Prone Blocked" message, like we see in Black Ops
                            No, not off the top of my head. I havent done much experimenting with prone at all, so I'd have to look into it. My best guess would be to add an extra collision volume or something, and check if it's blocked. Other than that I'm not sure.

                            Comment


                              HI! - I love the system but I am having one small problem

                              I have my own character, if I leave a physics body on the root bone then ragdoll makes the guy fly up in the air non stop... if I remove the root physics body thing, then he ragdolls OK, but then the get up animation does not play on the floor (sometimes in the air, sometimes through the floor) - and also the camera gets "disconnected" - meaning, after getting up, I can run, but the guy doesn't move and the camera does - and I also get errors in the log that say "Attempting to move a fully simulated skeletal mesh, please use the teleport flag"

                              Any ideas what I missed?
                              Every day I beat my own previous record for the number of days I've stayed alive!

                              Comment


                                Originally posted by GeeksGoneBad View Post
                                HI! - I love the system but I am having one small problem

                                I have my own character, if I leave a physics body on the root bone then ragdoll makes the guy fly up in the air non stop... if I remove the root physics body thing, then he ragdolls OK, but then the get up animation does not play on the floor (sometimes in the air, sometimes through the floor) - and also the camera gets "disconnected" - meaning, after getting up, I can run, but the guy doesn't move and the camera does - and I also get errors in the log that say "Attempting to move a fully simulated skeletal mesh, please use the teleport flag"

                                Any ideas what I missed?
                                So, the most likely issue is that you haven't freed the linear constraints on the hip bone. Because of this, when the actor gets moved to the pelvis location, it brings the root joint along with it, but since the linear constraints on the pelvis are locked, it fights to stay above the root joint, resulting in your character gettin launched up in the air. Also, don't forget to disable any collision on the root physics body, since it will go inside the pelvis physics body.

                                As for the error, that's my mistake. I forgot to switch a node before I updated it. If you go into the component, find the Manage Movement modes graph, inside it find the Event tick events, open up the Ragdoll graph, and near the end you should two nodes, one not being used. Switch the input to the one not being used and you should be good.

                                Comment

                                Working...
                                X