If you gave me this BP, first thing I would do is delete all your “Switch Has Authority” nodes, right now they are not setup right and nothing will work the way it’s all wired.
The following is the logic you want to think about:
- client hits a button or something to “join gang” (lol); so you want this event function call (the blue node) to be replicated to the server (Run On Server)
- now the server knows client “joined gang” (lol); so now have the event call (the red node) run another function call (blue node again) of another custom event that is set to “Multicast” so that all clients, including the client that initiated this whole thing, can see the results of “joining a gang” (lol)
Again to summarize, it’s a two step approach:
- have client tell server something happened
- have server tell everyone (on your client’s behalf) that something happened, and now everyone will know as well as you!
Remember that when you replicate from the server to a client (2nd step from above) that you have 2 options:
- Run On Owning Client: this will make it so that ONLY the client that initiated the action can see the results on their machine
- Multicast: this makes it so that ALL clients can see what someone else did in a MP(multiplayer) game
To clarify, let’s use a typical FPS MP game as an example, think something like Call of Duty. Below are some typical gameplay scenarios that require replication, and I’ve put down what replication option they should use- can you guess which method should be used for each scenario?
- a player throws a grenade at the enemy team- which replication method should be used? (Multicast|why? because everyone needs to know that a grenade is blowing people up)
- a player shoots another player in the face and kills them (Multicast|why? everyone needs to know that someone died)
- a player gets hit by a bullet, they are wounded so they see a red blood effect on their screen (Run On Owning Client|why? because only that client sees their own screen, so only that one has to see the blood effect)
- a player in the distance gets hit by a bullet, a red particle effect is seen as a splash of red mist (Multicast|why? because everyone needs to be able to see that effect come off the wounded player’s 3rd person character mesh)
- a player’s ammo count in their HUD (Run On Owning Client|why? because only that player/client needs to see their ammo count on their HUD)
Multiplayer networking is a crazy deep topic and we could literally discuss it for days in a workshop or something, but I hope I helped clarify a bunch of the doubts in your mind. If you’re overwhelmed, that’s normal. This is something that network gameplay programmers do for a living at AAA studios, so yeah it is a specialized job. I never recommend people new to game development to attempt tackling this area. I even have trouble explaining this to fellow coworkers at my studio. Very advanced stuff. Feel free to ask about anything you have doubts on and good luck!