Strange network behaviour

Hi Everyone. I’ve built a prototype based on the C++ Third Person template to which I’ve added a custom PlayerController class. I’ve been using it multiplayer for some time now without problems, albeit with server and clients on the same machine. I’ve started testing it across multiple machines on a LAN today and having some strange issues.

On two identical laptops the client joins the server no problem and everything works fine but when my test desktop client tries to join the server laptop things go wrong:

  • The client’s player is locked in place and can’t move. It can be seen to rotate on the spot on the client only (using a joypad) but can’t move anywhere.
  • I’ve added in a shooting action to the template. Despite not being able to move I can still shoot and the action is replicated and seen/heard on the server.
  • The server can see the client’s player on screen but the client can’t see the server’s player.
  • Sometimes the client will be controlling a debug camera and can fly around the world.

After doing these tests I went back and tried an unmodified version of the Third Person template and it all works fine so I’ve broken something somewhere but I’ve no idea where to begin.

To add to the mystery if I use the laptop as the client and the desktop as the server all is fine.

Any and all thoughts welcome!

This can be many things.
Check that your PlayerController is chosen in GameMode (and that GameMode is chosen in Maps&Modes).

Similar things have happened to me when no GameMode (and as a result, no PlayerController) has been set in Maps&Modes, after I moved some blueprints around.

If that doesn’t help, I can only say that UE_LOG is your friend. I don’t know your skill level, so forgive me if I am being patronizing, but I would just carpetbomb the input chains (that don’t work) with UE_LOG (or print to screen if you BP)…

Good luck :slight_smile:

Ok it turns out the Character Movement’s MovementMode is MOVE_None on the bad player. I’ve tried setting it repeatedly to MOVE_Walking but it keeps reverting back.

Actually it’s the client that keeps saying MOVE_None. The server says MOVE_Falling. If the client tries to jump it will change to MOVE_Falling and remain in that mode forever (because it never lands).

Also I previously stated that the client couldn’t see the sever’s player but that’s actually not the case. Everything about the game is fine except the client’s player not moving.

Any thoughts? Why should this only happen on a specific machine?

Check collisions. Maybe something is stopping the actor from landing with it’s collision component and change the states properly…

Nice thought but I’ve tried putting the spawn point in the air and the character just hangs there.

edit: something else I’ve just noticed is the bJustTeleported flag is always set. For both server and client.

This seems to be fixed. I’m not entirely sure what the problem is but it relates to the way I’d set up input bindings.