How can I set up Networked Character Movement?

Hi All

I am having trouble moving a character on a client system in a networked game environment. I am pretty sure I am not implementing something, but I am not sure what. Before I resort to simply copying all of the ShooterGame example code, I would like to try to understand what is happening. The host game log eventually gives a message that “owner” and “player state” has been unmapped for longer than usual, but before connecting the client using "open " the character was controllable on the client.

Notes

  • I have successfully connected to the host and both characters are visible on both machines.
  • Only the host system character is moveable. (On the client’s character does not respond to the mouse clicks.)
  • The same thing happens if the client and host are on the same system.

Background:
My goal is to have two characters on a map being controlled by two players on different systems. I have started with the top down template. I start the host game from the command line as a listen server.

I am not sure entirely what would be wrong and without much code it is difficult to give an exact answer, but I found that my client character couldn’t be controlled but my host could if I was missing :

Super::GetLifetimeReplicatedProps(OutLifetimeProps);

from the

void AYourCharacter::GetLifetimeReplicatedProps(...) const
{
}

Hi Dune

Thank you, that did help! The character now moves, but not entirely correctly yet. I believe the initialization/replication of all the required data is not happening properly. I am trying to find some info, but it is still quite sparse.

I have found a UE3 document and it seems the info is mostly applicable. I don’t quite understand yet how the client predicts movement while waiting for confirmation from the server. I am not sure if this happens automatically or if I am supposed to add this myself. Anyway, will get there!

To answer my own question (just to end this one off):

The movement functionality has to be called on the server.