Server Authoritative Character Movement

Hi there!

I’m trying to learn character movement and i have recently seen the example in the First Person included example. However, if i understand it correctly, the movement is applied by the client and then automatically replicated to everyone else. It works, but i would like to make it controlled by the server to help with cheating. I have not been able to find a tutorial that covers Server authoritative movement (i suppose you would use RPC’s) so at this point i’m stuck.

If you want to handle cheating prevention you would have to dig into the C++ source for actors.

By default the server is the authority and won’t let anybody move unless it “accepts it”. So in the First Person example the movement is applied by the client and replicated, but if the server doesn’t agree with the movement, it will flag it.

A good test you can do is to add a sprinting button but don’t replicate it. You will see that the client will sprint but keep lagging back to it’s original walking movement position. By default this should be plenty of cheating prevention for you.

Is there no other way?
May i ask you if you know a good tutorial on replicated movement using RPC’s (just to try)?

I think we need to start over.

Unreal Engine uses a Server & Client model. The server is the big boss and decides what all the clients connected to the server will see and experience.

For instance, I can play a sound on the client, but if I don’t replicate it to the server, it will not play for any other client.

You can create a multiplayer game with only blueprints. You use events to send data and to and from the server.

The character blueprint is by default replicated for it’s base set of animations. However, if you add a sprint function to make the character run faster, you would need to setup the replication for sprinting yourself. I think some functions like jumping is also replicated by default.

Have a look at this: https://youtu.be/XknYqK3qiMI?si=gKbt69FSlVNDOS7H

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.