Announcement

Collapse
No announcement yet.

Replication Help

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

    Replication Help

    Hey guys,
    So i wanted to build an fps for fun and as i was done with the empty hand animation i wanted to see how it works in mp (even tho i havnt replicated anything yet)
    Got some weird results and also couldnt fix them relating to animation.
    Summary at first:
    Every player can see themselves fine.
    Server can see all players fine
    Clients cant see anybody fine, not even the server.

    example picture:

    Left Server ; Right Client

    Red is the direction of the capsule (Skeleton Mesh)
    Blue is the control rotation (the arrow itself is not replicated, its just hooked up to tick-> get control rot-> set world rot, which makes me think why the hell can the server see this then, and how the hell is it that the server isnt showing his "control rotation")

    To me it seems like a 1way mirror, where the server gets all the information (even tho he shouldnt) and doesnt give it out to anyone.
    Also the walk animations etc is based on calculation how the character moves and where he is facing, the server can see that one fine again.
    But everyone else sees it like...lagging..

    Ive managed to implement sprinting with not problem but this stuff is a bit confusing to be honest.
    If anybody could help me out here i would really appreciate it.
    Thank you in advance
    Last edited by IAMspEeDex; 04-16-2019, 01:01 PM.

    #2
    Anyone D:? getting out of ideas

    Comment


      #3
      I am not familiar with the 'empty hand animation' so I am not sure what you are trying to do but I will say that you will get almost nothing working in a multiplayer game without replication. In multiplayer the server is the boss and all the clients follow the servers lead. It is not a peer to peer network. If a client spawns an actor then that actor will only be seen by the client. That is the way it is. For everyone to see a spawned actor it must be spawned on the server and it must be set to replicate and, if you want the clients to see it move you have to set it to replicate movement. Very little is done for you automatically. A client can get something spawned (or destroyed for that matter) by calling an event that runs on the server and spawns the actor there. It seems to me that you need to watch some videos or read some guides maybe.

      Comment


        #4
        Thank you for ur answer. I have very little knowledge about replication that is true but i wanted to know. why the server can see the clients true control rotation and forward vector of the capsule. but the server doesnt giving out its control rototation at all. (or from other clients) ive tried multicasting and replicating variables in the animation blueprint. iv got shooting sprinting etc working in mp but the animation is another thing. it seems like its working but the server is not giving out the needed informations

        Comment


          #5
          Not done character animations but I can tell you what I had to do when manipulating bones for a bending helicopter blade. What happens is that the server runs the bending blade routine but none of the clients do and so they do not see any change. What I had to do was to make all the variables needed to bend the blade replicate and then, make the bending blade routine be called by a multicast event node. So, all the clients ran the bending blade routine as well as the server.
          The same thing applies to particle effects. Generate a particle effect and only the server will see it. You have to have a multicast event that runs on each client so every client spawns the particle effect themselves.
          I think it will be the same pattern for your animation. Create a multicast event that triggers the animation. Then all the clients will perform the animation too and not just the server.
          maybe.
          cheers
          Podge.
          Let me know if that works for you. Sometimes it is like talking to the void here.

          Comment


            #6
            yeah i found my solution:
            https://answers.unrealengine.com/que...transform.html

            turnes out its no good to check for velocity and control rotation in the animation blueprint because apperently there is a client and server animation.
            weird thing tho i checked for these infos now in the character and in the animation i casted them from the player. i set these values with that switch to authority(on character only). so my question is. does autohrity mean in that situation owner of server, or owner of that pawn? could mean both as far as i can tell.

            also player mesh was "lagging"/more like smoothes with the rotation which seemed like a function to me and yes i did find it:
            Character movement component->character movement (networking)->Network simulated Smooth Rotation time set it to 0
            Seems useless to me if the server cant see that "smooth rotation" but every other player can. or maybe im jsut doing timething wrong.

            Thanks for ur help tho podgyhodgy, u made some points which made me think more clearly about it.
            I would post somescreenshots but in the threat ive linked is everything pretty much explained which screenshots and stuff also the only variables i had to replicate where the ones in the player itself, not even in the animation. still dont understand ue4 replication... but it works so eh
            Last edited by IAMspEeDex; 04-17-2019, 07:40 AM.

            Comment

            Working...
            X