Network Movement Issues On Client

Hi Guys, yet again bashing my head against a wall :slight_smile:

so I have a flying space ship blueprint class (inherited from pawn (have also tried default pawn))

I have added a floating Pawn movement component to it.

in class defaults i have turned on Replicates and Replicate Movement and i have turned on component replicates on the floating pawn movement component.;base64

And here is my movement code (had to strip it back to see what the issues were with no luck)

now when i move on the server, it replicates to the client fine.

when i move on the client, the ship doesn’t even move on either screen let alone replicate from the server?

is there something funky i am missing, i did try replicating multicast to the clients but again same issue?

Please tell me im missing something obvious, i thought changing the movement on the server with authority would automatically replicate to all clients with those flags turned on?

kinds regards

You’re not having the client do anything. Execution (add movement input) is only on the server.

hi, thanks for taking the time to reply :slight_smile:

Fair point but as the server i move, it replicates fine, so things running on the server should auto replicate, i figured that the same mechanics would work for the client?
the client sends to the server, the server moves, it replicates down, same as the servers pawn did, is that not how it works?

kind regards

Not with the base Pawn class. The client has to execute “Add movement input”, then replicate the axis value to the server.

The “Character Movement Component” has a lot of the replication/networking built in.

Thanks @Rev0verDrive that sounds fair, assumed the server side was more magical :smiley: seems i was wrong.

@EntrpriseCustomr Thanks for the details options, @TheJamsh has helped before on a different topic :smiley: very knowledgeable, will find the post you are talking about.

as for the options, being a space game movement needs to be as fluid as possible across network so id imagine number 1 is out,

i will start will trying number 3 as that’s the quickest and easiest option to try out, if that works, i will see how it goes.
My ship i have rigged to have moving parts so its already a skeletal mesh, so should be straight forward to set up (except for the collision as you say, may have to play with that a bit)

if that cant work, then number 2/Pawn 'movement replication may be the final solution.

will have a play today and see what i can get working and get back to you with the results :slight_smile:

Thanks guys, that was a big help clearing up a misunderstanding on replication :slight_smile:

Ok so the character bp worked fine straight away infact, no need to even run on server, all replicated straight away,

quite straight forward but its annoying i cannot re-parent the collision mesh or anything on it, so might spend some time investigating the code for ACharacter and seeing what they do for their replication and doing a basic copy and seeing if i can get the same performance out of the pawn.

when im done ill post my findings here for reuse :slight_smile: (it will be c++ but at least others might benifit from it

Yeah CMC’s Capsule collision component is the only collision that can actively “block”. All other collisions added to the class will only generate overlap events. You can use collision overlaps to disable input (pitch/yaw), but it’s a lot of work.

Yeah the Character Movement Component hides the very complicated network prediction/reconciliation away. It’s quite difficult to extend (requires C++ and a lot of prior knowledge of how the system works) - but this will get easier in the future.

Epic is working on a Network Prediction plugin that has very promising results already, but there is no ETA on when it might be considered production-ready and a lot of fundamental code is changing often, but there is IMO enough to get started if you’re feeling brave. Natuurally due to the inherent complexity of network movement, this is all C+±only for now.

There is a flying pawn example included in the samples - you can get the latest version of it from here (I’m not sure if it’s included in launcher builds, or what the state of it is in 4.25).…workPrediction

Note, if you don’t need prediction or aren’t too worried about hacking/exploits for the time being - you can opt for a client-auth approach that simply sends your latest transform info to the Server, and have the local player ignore replicated movement.

HI @TheJamsh :smiley:

i currently found a tutorial that extends the pawn movement component and sort of copies in the character movement replication prediction stuff (with changes), however i needed to use the floating movement component, so im applying the same process but using that as its base and see if i can getting it working, i have done c++ for about 15-20 years so not too worried about getting my hands dirty on this one, its just understanding the flow for the predictions, I am almost there, 1 issue atm that when the client connects it shoots off in reverse :smiley: not sure whats happening there but will figure it out, assume i havent set an initial position and its correcting it to somewhere insane :smiley:

Very interesting on the network prediction plugin, would be very interested in that :smiley: do you know where i could find it unless its not freely available?

I did think about forwarding on the transform from client to server and back down utilizing repnotify, but i figured i would give this other one a go first as its early enough in the project :slight_smile: will let you know how i get on and will share the tutorial and the code i did from it here if i get it working :smiley: if i cant get it working the way i like i may just temporarily do as you suggest and let it be hack-able for the time being :smiley:


** EDIT **

you event pasted the link, was obviously tired :smiley:…workPrediction

FYI I have some issues in the c++ side so created a child thread here…rection-issues

for fixing that