This whole replication thing makes me angry. But its not only that, there are several problems all packed together into some circular dependency of problems.
First problem is stuttering: killed that link
It is terrible, adding camera lag helps, but character is still visibly warping. I tried all starting templates, every time i add player pawn as character (and try to replicate its movement) i get that stuttering, first person is free from it. For movie i created worst scenario (ie. no camera arm lag and camera is attached to character mesh). But ti is in all setups that i could imagine, well besides one, that i cannot make working.
So my solution is to separate camera from pawn. Let players posses camera pawn client side (that is only camera), then server will move characters to match camera pawn input. I wanted to do it trough AI, for that i created “very advanced” KeyboardAI. But problem is that “simple move to location” does not work when i call it on event tick. When i call it every second or so its sometimes work (that depends on setup), but with longer periods you can feel like character is unresponsive.
I could drop that keyboard AI and use normal pawn for moving soliders around, but then they need to be possessed to rotate. Strangely add movement input works, but turning does not, probably because all those pawns rotate to match controller desired rotation.
And last problem (a bit unrelated). When i try to change enum variable that is in animation blueprint (ie. walking, crouching or running) editor crashes while compiling such thing, but only if its for multiplayer. When i drop number of clients to 1, everything is fine. I will make answerhub question about it if i can replicate this using some epic template.
Ps. I wasted whole weekend on this, instead of adding cool stuff like damage system. At least i learned character setup and animation blueprints quite well.
@Gmi my "solution" with moving AI characters on server, then replicating them is something like you suggest.
However there is one big problem, when server is under heavy load (ie. PC that runs listen server is toaster not server) i got big rubber banding and warping on clients for controlled characters.
It is kind of unplayable, and you cannot demand from every user to be smart and not host game when his system barely can run client. This will lead to lots of whining. I can see such stuff on every mmo forum, people with very outdated hardware complain that game is lagging, and blame servers or poor optimization, while its their own 8 years old toaster system.
Also i learned numerous times that its not worth going against Unreal engine way of doing things, it usually backfires later on. Like that “driven by AI player pawns”. I recently created again normal pawn that is controlled by keyboard. And stuttering is back in 4.11.
I have feeling that is due to 2 different things trying to update movement and doing concurrent updates which results in stuttering. Just cannot find which two are messing up. I also cannot guess what is CORRECT setup for multiplayer 3rd person character with fixed camera. Even epic templates when you orient camera to character yaw, gets same stuttering.
My guess is that either camera YAW orientation fights against character direction, or its replicated character movement that fights between server and client. I added some line tracers to see forward direction of character and its visible that it tries to orient to 2 different directions. Maybe that animation blueprint that has blendspace for walking from -180 to +180 and unreal trying to do full circle rotation.
I kind of found culprit, posting my previous post worked like rubber duck.
In animation blueprint there is node that calculates direction from velocity and base rotation. When moving backwards it constantly feeds -175 +175 that causes stuttering.
I have bit more of same effect elsewhere, but that from my calculations.
All the time i had turned on “orient rotation to movement” (from previous version where camera was more top down)
Then i overwrote movement direction and rotation from blueprint. I was sure that there somewhere is concurrent update of movement.
And ofc it was most visible with biggest difference ie moving backwards, then while moving forward disappeared.
If you are using Enhanced Input Local Player Subsystem to set up your mapping context via Add Mapping Context double check that it is being setup on the Client Level for the Local Player Controller.
This was causing bad stuterring on my client instances because I was spawing the actor on the Server and then possesing it and also adding the mapping context there as well. Once I broke it into parts Spawning handled on Server and Enhanced Input on Client it fixed my issue. I would disable any AnimBPs first to double check its not being caused by those before looking into Enhanced Input.