Announcement

Collapse
No announcement yet.

Make character decelerate when you release input (with replication on dedicated server)

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

    Make character decelerate when you release input (with replication on dedicated server)

    Hi

    I am trying to make my character decelerate instead of stopping immediately. Ground friction wont solve this because it affects horizontal movement (don't want character to ski) so I need my own implementation. Feels like character movement is missing this setting altogether.

    I check if there's any horizontal movement, if there is, I store the current horizontal acceleration, I check if the timeline is playing, and if it is, I stop it.

    Here is an image of my setup:
    Click image for larger version

Name:	code_repl.jpg
Views:	1
Size:	304.3 KB
ID:	1154569

    This causes the character to jitter when I stop moving. I assume that the server doesn't agree with the character's position or something along those lines. I don't know where to look to fix it because I'm not sure and I've spent hours trying each possibility I can think of.

    I do not think the Event Tick can affect the server like inputs can even if it's using Add Movement Input. Am I wrong? The entire idea here is that there isn't any input.

    Any help on how to set this up properly would be appreciated. Thanks!

    #2
    Vaei- the character by default does decelerate when you release input. There is a built in variable you can adjust I think called "braking deceleration walking" that applies some deceleration when you let go of the input. Your character is still subject to slowing due to the friction in the level so you may also have to adjust that to get the effect you're looking for, but it should be simpler to achieve than making a whole new function as you did above.

    Comment


      #3
      Originally posted by Pheesh View Post
      Vaei- the character by default does decelerate when you release input. There is a built in variable you can adjust I think called "braking deceleration walking" that applies some deceleration when you let go of the input. Your character is still subject to slowing due to the friction in the level so you may also have to adjust that to get the effect you're looking for, but it should be simpler to achieve than making a whole new function as you did above.
      Ah.. I specifically mentioned it because this wasn't a solution :O .. The default ground friction is high, yes. Putting braking deceleration on 0.000001 while ground friction is as low as it can go without making the character slide across the ground when he runs around is nowhere near sufficient. I want him to actually slow down to a stop, not just have a tiny bit of blend time for the animation.

      Comment


        #4
        Okay, well another approach is to reduce friction only when you are not currently hitting any input keys. When you press an input key again friction gets set back to normal. Together with the lower braking I think you could achieve what you are looking for.

        Comment


          #5
          I'll try it tomorrow but I still need to know the way to make a system like this on a dedicated server. I've actually tried asking a few times over the past few months and I never get a response that's helpful in that regard so I still haven't been able to learn anything

          Comment


            #6
            Originally posted by Pheesh View Post
            Okay, well another approach is to reduce friction only when you are not currently hitting any input keys. When you press an input key again friction gets set back to normal. Together with the lower braking I think you could achieve what you are looking for.
            Now that I'm properly awake, this wont work. It has the *exact* same issue as my method I've already implemented. There is no pressed/released for input axis such as a controller, and I'd have to map WASD to an input to sort of fudge the system along.. ultimately, I'm going to have to resort to event tick which is back at square 1.

            And I see that by some.. cosmic abnormality.. no one on this forum has any idea at all how to replicate anything to do with the player on a dedicated server.. not like any game needs that.. How many of these posts and how many months is it gonna take for an actual answer! >.< Waste of time.. All I want to do is affect the player via it's movement and have it actually work on the server/clients. But it doesn't seem possible and no one knows despite every authoritative game needing it... All these tutorials deal with really basic stuff like variable replication or input events which isn't going to help.
            Last edited by Vaei; 06-29-2015, 06:21 PM.

            Comment


              #7
              Will your method work on the server/single player?

              Comment


                #8
                Originally posted by _cDub View Post
                Will your method work on the server/single player?
                I can't execute anything on the server via tick if it's a dedicated server, so no.

                As for the single player I'll have to check later.

                Comment


                  #9
                  I'm in the same boat as you as far as fully understanding how to implement replication in blueprints, but here's a few threads I found helpful as a starting point:

                  https://answers.unrealengine.com/que...dmovement.html
                  https://forums.unrealengine.com/show...ht=replication

                  Comment

                  Working...
                  X