I'm stuck with this problem and it's too long to explain to sum it up in a title

Hello and thank you for taking your time to help me.

I have a problem with the multiplayer game I am trying to code. In it, players shoot rockets at each other with various effects. So here it is, in the game I would like to have the rockets change randomly every 5 seconds (not all players have the same rocket). So far I have coded this like this:

  1. From a ‘Set Timer by Event’ updated every 5 seconds, I call a replicated event to the server which in turn calls a replicated event to the Multicast.

Capture1

  1. This event replicated to the Multicast uses a Blueprint Interface to send a message to a Game Instance containing a randomly selected material from a predefined list.

Capture2

  1. From the received material, I define a ‘Matériau’ variable in the Game Instance.

Capture3

  1. Then with a Beginplay event on my rocket actor, I use a ‘Which Missile?’ function, which uses the name of the material to set to True a boolean variable specific to the effect of the rocket. (Example: If the material is called ‘Slowness’ then the boolean variable ‘Slowness’ will be set to True)

  1. Then, with the Event Hit event, I destroy the rocket and make particles appear from events replicated to the server and the Multicast.

  1. Finally, with a replicated Event Destroyed, I get a reference to all players present in a Sphere Trigger and apply to them the related effects.

Capture

So far, my code seems to be correct, however in game it works perfectly for the server but for the clients, the rocket takes the effect of the material drawn for the server and moreover the server doesn’t see the particles of the clients rockets. And this is my problem.

For the shooting for the players:

  • If the left click is clicked then it brings up the replicated rocket actor from replicated events to the server and Multicast.

For the rocket:

  • It is an actor with a Projectile Movement of velocity 6000.

Thanks again for helping me.
Tchoupizbouby

Does the emitter have to be passed through the server and the multicast node ?

Hello and thank you for your help.

Indeed, it is not necessary to make the emitters go through replicated events, thank you !
The emitters problem is solved but not the rocket effects, the effects are still mixing.

So I’ll take a concrete example of my problem to make sure it’s clear:
Let’s say the client gets the ‘Speed’ rocket and the server gets the ‘Slowness’ rocket.
When the client fires and the rocket hits something, the effect will be slowness, not speed.
What is needed is that everyone has their own rocket with their own effect and that when it explodes the effects correspond to the announced effects and that they are applied to the other clients and to the server.

Thanks again for solving the emitters problem.
Tchoupizbouby

Multicast executes on all. Server has only one GameInstance. Server cannot know what each client’s missile is.

If the result is only visual it may not be a problem, as each client can spawn its own visuals in projectile’s OnDestroyed. But if you want to do more (damage, knockback) it’s gonna be a problem, because these things have to be done on authority (server) side, and server doesn’t know client missile type.

Instead of storing on GameInstance, you should store each player’s missile type within a per-player container class such as PlayerState. Things will go much smoother from then on.