Download

Shared Camera, Online 1v1 multiplayer camera issues.. (Blueprint project)

Hi

My name is Sam, I’m a student living in Finland (studying game development). We’re making a 1vs1 Bushidoblade esque sword fighting game.
The idea is to make a game that you can either play locally or online (via steam). I’m using The multiplayer template project, based on the tutorial that epic games has very kindly provided (thank you =))
the MP tutorial : Blueprint Multiplayer: Project Overview | 01 | v4.11 Tutorial Series | Unreal Engine - YouTube

the problem:
I’ve been trying to get a shared camera working for sometime now (2 weeks) and i haven’t managed to find any good solution yet. My most current attempt is shown in the following pictures and video.
Host side window:


client side window:


video showing the issue:

to create the shared camera I’ve been following the guidelines of this tutorial:

I have 2 empty actors, which i created blueprints of, the actors have the ability to follow the controllable characters (the first one follows the first playable character and the second follows the other playable character). I have my camera in the level which is looking at these empty actors, the reason i did it this way is because i haven’t been able to get the camera to look at both characters through a direct reference. the issue i’m having is that on the client screen the first actor will always “follow” itself into the ground, not like on the host side where it is working correctly. I’ve tried at least 10 different ways to fix it, checking its replicated etc, trying to execute on server, on owning client and just by event tick. I have a feeling it has something to do with the character references, but i can’t seem to find the solution by myself.

here are some of my blueprints:
lookatcamera:


actorlookat 1:

actorlookat 2:

Any help regarding this issue would be greatly appreciated. And if you have a better way of doing this, i’m all ears.
Thank you in advance, hope you all are having a great fall so far! =)

  • Samuelb

Update

I’ve managed to fix the problem where the other actor on clientside would “follow” under the level. I changed both actorblueprints to execute on server with a custom event (run on server and reliable) and on event tick calling the custom event. However, even though this solves the problem, i’m experiencing some lag now when testing. The game works fine when only one character is moving, but when i move both characters at the same time the client character will start warping around. I think i’m overloading my bandwidth with information, but i’m not exactly sure. Has anyone else had this issue?

Update2

I think I’ve managed to fix the problem, earlier I had checked “Always relevant” for the actorlookat actors. By unchecking this option, the lag spikes seem to be a lot less frequent or don’t happen at all.

-Samuelb