Networking broke on all versions and computers

84664-ue3multi.png

I’ve created a new project, in 4.7, 4.9 and 4.10 on mine and a friends computer. I go into the level blueprint or create a new character and put in this simple script. All it does is call a multi cast that prints a text.

From the clients side it will not replicate on server. I can’t do any multicasting from client side in any version of unreal. Same problem with RepNotify, clients don’t replicate anything on server.

It’s impossible to do any kind of networking and I don’t understand why this is happening as it seems to effect all versions and computers. There’s no way I can be the only one effected by this.

Hmmmm I think you don’t have a complete understanding of UE4 Networking yet. A Net Multicast function replicates to all clients only if the server executes it, if it is the client who calls it, then he does it only for himself.

If you read the description in the node, it says “Replicated To All (if server)”.

84666-multicast.png

So what you are calling “bug”, is actually a design choice. I suggest you to read about function replication and variable replication.

Here’s a guide for RPCs and their behavior. (Remote Procedure Call, i.e. Net multicast, Server, Client, functions)

As for this particular case, if you want to call a Multicast function from a client you would have to put it inside a Server function first so the client can send the call to the server and then the server executes the multicast as requested by the client.

Something like this:

Hope this was helpful :slight_smile: !

That’s not how the Unreal video tutorials show how to do it. When I tried that on my existing project it did it on server twice.

I’m not saying it. Unreal documentation says it. Multicast executed by client will never replicate to everybody else.

Alright, I’ll play around some more. Thanks for your help. Do you know why the RepNotify doesn’t work?

Do I need to send the RepNotify to a OnServer event to a MultiCast event. That seems like a lot for every function I need replicated.

What rep notify is meant for, is to execute code that is “synchronized” with the moment a replicated variable changes. For example say you wanna change a texture, or play a sound when your health variable changes, what you do is you set health to rep notify and then do the changes in the corresponding function. Note that a rep notify will be executed by everybody (server and all clients), but this doesn’t mean it is replicated.

What’s the difference between execute and replicate? When I do it with print it only prints on the client.

That’s not how the Unreal video tutorials show how to do it. When I tried that on my existing project it did it on server twice.

What do you mean it does it twice? I’ve tested this, it only does it once for everybody.

I have to run my code through this to have it multicast. Isn’t there any easier way than this? Surely there’s a better way than this, I’m going to have to call almost all my function on this switch statement. My friends doing a networked game and he just runs his function on server and they naturally replicate to all clients.

Unreal uses an authoritative approach for networking, meaning that the server is always right and the server tells everybody what to do. Replicates has different context when talking about variables and functions. For functions, replicate means that if the server does it, everybody else will do it as well. Sorry if I was a little bit ambiguous with the term.

I think what you need here is replicated variables, not functions. Multicast is commonly used for aesthetic purposes, not for anything game play important.

For example: Spawn particles, visual effects, sounds, etc.

Probably not. It all depends on how you structure your code, but you need to really understand networking first. I don’t know what you plan to do with the rep notify, or why do you need to do those Multicasts.

This is changing the size and colour of the character which is tied into the gameplay.

Use replicated variables then. Not functions. By the way, I think the original question has been answered, could you mark it as such? :smiley: