Download

Networking: Client -> Server -> All clients

I’ve been trying to sync my custom pawn data to all players across the network. Using the networking tutorials from Epic, I was only able to sync between one client and the server, but as soon as I added more clients, their data was not updated.

I’m pretty new to this, so after a lot of experiments I figured out that I can sync my custom data by by calling a Multicast from the server.

So basically in this case:

  1. Player rotates/moves turret, sends this data to the Authority through an RPC (Run on server)
  2. Server checks if this behavior through Has Authority
  3. Server sends out data to all clients through a Multicast

I feel like I’m missing something or doing something completely wrong. I would love to hear your opinion!

87996308b1419326bbbe6fbea20c4d21c23b4b37.jpeg

Is your “SetTurretRotationOnClients” actually checked with the Multicast option? Can you show us the options for each of the custom events?

Thanks.

Yes it is, but somehow the editor rarely updates the custom event with the replication settings. I’m not sure if that’s a bug on 4.7.6.

dd97a999ec1a12e30c1880f1e08f4a936c8bef2d.jpeg

the editor updates it but the names remains the same , you can fix that buy pressing F2 when it doesnt update and confirming the name again

Okay … the item you are rotating, is it set to replicate … sometimes you have to set its movement to replicate as well … not sure how you have set up the actor/pawn.

The turret is a subobject of a tank inside a Pawn blueprint. The movement of the tank is being replicated, but since the turret is a subobject, it is not automatically being synced across the clients.

In the mean time I’ve moved the MoveTurret function in step 1 to step 3. The turret’s rotation is now being set according to a replicated Vector3 variable.

I think that cheating would still have been possible the way I set it up in the first screenshot, correct?

@Axxi, thanks, I’ll try that!

Basically yes, because you are not checking if the client can move the turret. Typically in this scenario (or in the scenario for Kaboom Arena), the server checks whether the client actually has enough bombs to be able to throw a bomb.

In your scenario you aren’t really performing a check whether the client can move the turret … you are just handing the move off to the server that is then telling all the clients to do it.

There is nothing wrong with this way and it is the preferred way, but cheating will be possible because you have no way of checking whether the client can move the turret.

I hope I am making sense, because without understanding the full concept of your game … it is difficult to know whether this would actually ever be a problem. HTH.

Thanks, Quinton!

Honestly there is no concept of the game, it is merely a project to familiarise myself with UE4. I just kind of switched from Unity and am liking this engine a whole lot better.

In this case, there is no need to check wether the user can move its turret, I’m just trying to grasp the concept of syncing movements across clients without having someone suddenly teleport to the other side of the map, for instance.

That is perfect then … the way you are doing it is what I understand as the preferred way of doing it for a true multi-player game … and is exactly the way I am doing it in my game. Good luck and feel free to shout if you need more help. 8-}

Thanks a lot for your help, I was very uncertain about this procedure but feel a lot more confident now :slight_smile:

I looked at your game ‘Kaboom Arena’ and must say it looks very promising. Keep up the good work!

Thanks man … v0.4.0.0 is currently underway and we will finally have victory conditions and power ups … should be a blast … lame joke … I know. 8-{