Announcement

Collapse
No announcement yet.

top-down multiplayer

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

    top-down multiplayer

    Hi, Projects in Top-Down movement works with the mouse , but in multiplayer mode only works on the server. How to make it work on clients tried through replication functions , but the character is moving once only before.

    #2
    You should watch this series on networking through blueprint:

    https://www.youtube.com/playlist?lis...SFPRiBpwe5sTwc

    But basically: You check behind the "MouseMove" if the event was called from someone with authority. In the very strong majority of the cases only the server has authority so only your listen server will be able to actually use any functionality behind this.

    Cheers

    Comment


      #3
      These lessons I used while writing this bp, there is very superficial information, as well as in the wiki. It turns out the entire function Move to hit location can not be replicated , it is necessary to replicate the same way all the variables in it ?

      Comment


        #4
        Click image for larger version

Name:	move.jpg
Views:	1
Size:	458.0 KB
ID:	1068030
        Click image for larger version

Name:	move2.jpg
Views:	1
Size:	110.5 KB
ID:	1068031
        How to make work NavMesh in multiplayer mode ? Coordinates are obtained , but the character does not move

        Comment


          #5
          I had to use Move to Hit Location instead of Simple Move to Location. It is working 100% for me in Multiplayer and I haven't noticed any problems with it.
          Quinton Delpeche
          Founder - Gobbo Games | Designer - The Colony 2174 (Board Game) | Developer - Riders of Asgard

          Comment


            #6
            Originally posted by qdelpeche View Post
            I had to use Move to Hit Location instead of Simple Move to Location. It is working 100% for me in Multiplayer and I haven't noticed any problems with it.
            Simple Move to Location enters the Move to Hit Location is the default ' function in pure Projects top-down, it is strange that you have running , I have version 4.7.1 Projects to create a clean top-down multiplayer option put the number of players 2 and run dedicated server. Press play and movement of the unemployed, if run without run dedicated server that runs on the server side

            Comment


              #7
              Thank you , solved his problem by using rpc, but there were other problems , such as the rotation of the client character moving in the same position in all directions, also decided , you just do not match the speed of the animation , the character moves on a server running, and the client is slow steps .

              Comment


                #8
                Originally posted by qdelpeche View Post
                I had to use Move to Hit Location instead of Simple Move to Location. It is working 100% for me in Multiplayer and I haven't noticed any problems with it.
                The "Move to Hit Location" function in TopDownCharacter just calls "Simple Move to Location". There is no "Move to Hit Location" anywhere else. However, there is a "Move to Location" in AIController, but it needs an AIController.

                Calling "Simple move to Location" on the server does move the player, but rotation and animation is messed up.
                I would love to see a simple solution which "just works", IMO this should be something the CharacterMovement component should be able to handle.

                Comment


                  #9
                  After spending a day on this issue, I have a working solution (I'll post a tutorial or whatever someday).

                  Zak Middleton explained in this AnswerHub question that Simple Move to Location was not meant to be used in multiplayer.
                  Alex.Holyman posted an answer in the same AnswerHub question, which works. It uses a server-side AI Pawn, which does the movement. Your player-controlled pawn replicates the AI Pawn's movement in it's Event Tick.

                  In Alex's answer he uses a lerp of the server-pawn's transform and the client-proxy. If you experience any stuttering effect on the client, that's why. just use the server-pawn's transform.
                  And don't forget to destroy the AI-Pawn when you destroy your player's pawn (and vice-versa).

                  Comment


                    #10
                    Okay, so I know this topic is ancient but I recently had this same issue on UE 4.25 trying to get the TopDown Example to replicate properly. I have developed a working solution by dismantling the TopDown game and removing the VR stuff from it.

                    First Step is to setup a server RPC to tell the pawn on the server where to move to. That actually got me 90% there. Other issues came up in that the client controlled character would not rotate toward the movement and would jump around from point to point while moving. Well the Movement component is not replicated, and with the server version doing the actual movement the Velocity on the client was not set. Interesting thing was for the other player, movement looked fine, it was only the client's own character that was not working.

                    Step Two: Create a client only RPC on the Pawn that runs on Tick. Okay quick tip for Replication, NEVER do reliable network calls on tick, and try to only ever have one unreliable network call on tick (Epic has a few already so be careful). So I setup an on tick unreliable client function that fire's and forgets each tick on the server that sends the movement component's Velocity and the Pawns Rotation. On the client I directly set the Movement component's Velocity and the Pawns Rotation and bam it's working very good. You Could add some rotational interpolation but I was not having any issues with it visually.
                    Professional Game Developer
                    Asadeus Studios

                    Marketplace Content:
                    Pro Mounting System

                    Comment


                      #11
                      Originally posted by ArcainOne View Post
                      Okay, so I know this topic is ancient but I recently had this same issue on UE 4.25 trying to get the TopDown Example to replicate properly. I have developed a working solution by dismantling the TopDown game and removing the VR stuff from it.

                      First Step is to setup a server RPC to tell the pawn on the server where to move to. That actually got me 90% there. Other issues came up in that the client controlled character would not rotate toward the movement and would jump around from point to point while moving. Well the Movement component is not replicated, and with the server version doing the actual movement the Velocity on the client was not set. Interesting thing was for the other player, movement looked fine, it was only the client's own character that was not working.

                      Step Two: Create a client only RPC on the Pawn that runs on Tick. Okay quick tip for Replication, NEVER do reliable network calls on tick, and try to only ever have one unreliable network call on tick (Epic has a few already so be careful). So I setup an on tick unreliable client function that fire's and forgets each tick on the server that sends the movement component's Velocity and the Pawns Rotation. On the client I directly set the Movement component's Velocity and the Pawns Rotation and bam it's working very good. You Could add some rotational interpolation but I was not having any issues with it visually.
                      Hi, although the topic is old, but the problem is relevant. I don't quite understand what you mean. I use "Simple Move To Location" node on server (rpc). If you add an AI controller, it works well, except for small twitches on the client. This spoils the whole feeling of the game. Could you describe the second step in more detail?

                      Comment

                      Working...
                      X