I know that player controllers can’t, and pawns can. What other classes can/cannot use multicast functions?
Others may want to correct me if I’m wrong, but I believe that the Actor class is the lowest level class that can be placed in the world. As such, I would think that anything derived from AActor has replication capabilities. Player controllers are derived from actors and can have multicast events, so are pawns.
I recently discovered that player controllers can’t actually have multicast functions, because they don’t have authority to see the other clients’ controllers.
Yes that’s true. They can have multicast events but you are correct, the PC doesn’t exist outside the local instance but any actor based class that exists in every game instance should be able to do it.
I found a video that explains this, and all of networking, incredibly clearly. He says that net multicast functions must be called from any actor that’s replicated.
Multicast works on any replicated Actor however PlayerControllers are set to be OnlyRelevantToOwner which means they will only be replicated to the Owner and no one else.
Because the PlayerController is only replicated on the Owning Client then calling NetMulticast will have the same outcome as calling a Client RPC on PlayerControllers or any other Actor set to OnlyRelevantToOwner.
As a side note I can add that “Relevancy” is often one of the things that is forgotten about when starting to learn multiplayer. People tend to just learn how to make RPC’s and be happy when things looks like they are working … until they stop working … because the RPC was sent while the Actor was not relevant to a particular player and therefore dropped.
Then the initial reaction is to check the “Always Relevant” box on everything and then it works again. Then later down the line you start getting huge bottlenecks or random connection problems and race conditions when the game begins because you now have thousands of Actors competing for bandwidth all at once.
My advice: Learn about relevancy and when to use Replicated variables as early as possible.