Hey,
I am integrating UE4 (just as client) with a 3rd party dedicated server. I have issues about how to handle movement replication.
Current implementation of movement replication:
Suppose I have player A and player B connected to the server.
- They are in the same world and can see each other.
- Both players update their location/rotation vector to the server every 10ms.
- For Player A’s client, an ACharacter is created to represent player B. This ACharacter gets location (only x and y if player B is walking on ground)/rotation update every 10ms.
My questions are:
-
How to update ACharacter’s position and rotation?
I am trying to use UCharacterMovementComponent since it can handle animation and different movement mode. But the issue is it is affected primarily by current Velocity and Acceleration. And the location/rotation update is vector.
I also tried to use MoveUpdatedComponent to do smooth movement. But this function call ignores the ground.
Should I calculate the velocity by the location update? (I need to move it to the exact position in 10ms)
-
Should I use APawn and UPawnMovementCompont since ACharacter may consume lots of CPU?
I searched some relative topics for a while, and I noticed that ACharacter is maybe too heavy. And the player could see hundreds of ACharacters at the same time.
Considering I am using 3rd party server and the position/rotation & other replication frequency is decreased by distance, is the ACharacter still too heavy?
-
How to use UCharacterMovementComponent movement prediction?
Just want to have a try, maybe the prediction is not a bad idea.
I am reading corresponding server code now, but it’s complicated and time consuming. I am really appreciated if you can give any hint/document/guide for above topics.
Cheers