Really helpful videos! For a bit of a better explanation on the Owning Client thing: Think of when you spawn an actor, it has an instigator pin, but if you open the drop down it also has an owner pin. The Instigator of an actor is typically the player responsible for that actor coming into existence. For example, in an FPS game, when a bullet spawn on the server, the server would need to be passed the information of the player firing that bullet, as that player would be the one gaining benefit from the damage caused by that bullet. This can be done by passing the player controller, then collecting all the active player controllers on the server and checking which index is the required player. However, just like the instigator is the player that created the object, the owner is the player that owns the object. If an actor is placed in the world, on runtime it will be owned by player 0, which in a multiplayer game will be the local player on the server, which is why in a listen server it's possible for the server to affect an un-owned object. This is also why Has Authority is 99% of the time the server, since all actors spawned without a set owner will default to being owned by the server's local player, giving the server authority over those actors. So to finish the above example, when a bullet spawns on a server, the instigator is set to the player firing the bullet, but the owner is left blank. This way, the server continues to hold authority over the bullet and relay information to the instigating player upon having it do damage.
A reason to use OnRep over Multicast is when you need to change the state of an object. Unreal doesn't always load everything for a connected client, only what is relevant to them. So, if you open a door for example, with a multicast, only the clients that are within range will have the door open. When another client finally enters the range, it will be closed, because it gets loaded on demand. If you use an OnRep to open the door though, the state of the object is updated and if someone walks into the range of the door for it to load, it'd be loaded and then it will open the door.
I know your answer is old, but wouldn't it be the same when you use multicast with the "reliable" checkbox in this case? So it will always multicast it?
@@maiworld_ Well it was a question, because I'm also not sure. But I know reliable means something like "high priority", so it will be executed in any case. Not reliable on the other hand means it will be executed if there are ressources and (not sure) when the player is nearby (or has vision). So reliable should be used to save the door state like "open" or the final door position, but the animation or visual effects should be NOT reliable, because you don't have to animate (or play a effect) to players far away, because they can't see it anyway. Take battlefield for example with up to 128 players, if you would replicate any animation and effect from any player to ALL other players, you would kill the server.
I've thought multicast was for the one time situation that you are present for, like the sound of a footstep and rep notification is for when you need evidence later when you arrive later, like a foot print.
@@Rick_Jagger Never got notified of the reply. Sorry for late response. No, it's not the same. In your scenario, only the people who are relevant will have the door open.
Thanks for all of these tutorials, I havent finished the episode yet. However i ran into issues when i tried to do something similar but with input from player pressing E. The moment i switched to overlap it worked directly. Im assuming my problem is related perhaps to hot my input is registered. Will continue watching and once again thanks
Hi, first of all, great tutorial, even now after 2 years it is still straightforward to follow and everything applies. I am just wondering how did you get the value of NetLoadOnClient? .. i see in your video briefly that you are calling the function "Is Net Load On Client" and i don't have this function and i guess you made it but how if this property is not exposed from actor object?
If it’s a variable that’s important you could have the server force a net update to make sure that variables information is updated semi instantly. I’m still trying to wrap my head around multicasts but from what I seen in the content examples it’s use is for making sure everyone that is in a range gets the update instantly. If I’m not mistaken they also use a multicast to initiate variable replication so it’s like using a combination of the 2 l. I might have to double check that though
I dont know if you still respond to these comments, but I'm confused as to why the client can change the color of the box when the "Switch has authority" checks to see if the event is happening on the server. When ever I use this in UE 5.1 the client can never interact with that object when "Switch Has Authority" is connected to it, it just does nothing. @ReidsChannel
If the client has authority over an object then that switch will return true. so it really depends who has authority of ownership of it. For example, each client has authority over their own HUD widget, so doing a switch has authority inside of there will always succeed on a client.
Really helpful videos! For a bit of a better explanation on the Owning Client thing:
Think of when you spawn an actor, it has an instigator pin, but if you open the drop down it also has an owner pin. The Instigator of an actor is typically the player responsible for that actor coming into existence. For example, in an FPS game, when a bullet spawn on the server, the server would need to be passed the information of the player firing that bullet, as that player would be the one gaining benefit from the damage caused by that bullet. This can be done by passing the player controller, then collecting all the active player controllers on the server and checking which index is the required player.
However, just like the instigator is the player that created the object, the owner is the player that owns the object. If an actor is placed in the world, on runtime it will be owned by player 0, which in a multiplayer game will be the local player on the server, which is why in a listen server it's possible for the server to affect an un-owned object. This is also why Has Authority is 99% of the time the server, since all actors spawned without a set owner will default to being owned by the server's local player, giving the server authority over those actors. So to finish the above example, when a bullet spawns on a server, the instigator is set to the player firing the bullet, but the owner is left blank. This way, the server continues to hold authority over the bullet and relay information to the instigating player upon having it do damage.
A reason to use OnRep over Multicast is when you need to change the state of an object. Unreal doesn't always load everything for a connected client, only what is relevant to them. So, if you open a door for example, with a multicast, only the clients that are within range will have the door open. When another client finally enters the range, it will be closed, because it gets loaded on demand. If you use an OnRep to open the door though, the state of the object is updated and if someone walks into the range of the door for it to load, it'd be loaded and then it will open the door.
I know your answer is old, but wouldn't it be the same when you use multicast with the "reliable" checkbox in this case? So it will always multicast it?
@@Rick_Jagger im curious if what you suggested is true. been trying to understand network replication fully
@@maiworld_ Well it was a question, because I'm also not sure. But I know reliable means something like "high priority", so it will be executed in any case. Not reliable on the other hand means it will be executed if there are ressources and (not sure) when the player is nearby (or has vision). So reliable should be used to save the door state like "open" or the final door position, but the animation or visual effects should be NOT reliable, because you don't have to animate (or play a effect) to players far away, because they can't see it anyway. Take battlefield for example with up to 128 players, if you would replicate any animation and effect from any player to ALL other players, you would kill the server.
I've thought multicast was for the one time situation that you are present for, like the sound of a footstep and rep notification is for when you need evidence later when you arrive later, like a foot print.
@@Rick_Jagger Never got notified of the reply. Sorry for late response.
No, it's not the same. In your scenario, only the people who are relevant will have the door open.
this set of videos is saving me hours! Thank you
Thanks for all of these tutorials, I havent finished the episode yet. However i ran into issues when i tried to do something similar but with input from player pressing E. The moment i switched to overlap it worked directly. Im assuming my problem is related perhaps to hot my input is registered. Will continue watching and once again thanks
Hi, first of all, great tutorial, even now after 2 years it is still straightforward to follow and everything applies. I am just wondering how did you get the value of NetLoadOnClient? .. i see in your video briefly that you are calling the function "Is Net Load On Client" and i don't have this function and i guess you made it but how if this property is not exposed from actor object?
If it’s a variable that’s important you could have the server force a net update to make sure that variables information is updated semi instantly. I’m still trying to wrap my head around multicasts but from what I seen in the content examples it’s use is for making sure everyone that is in a range gets the update instantly. If I’m not mistaken they also use a multicast to initiate variable replication so it’s like using a combination of the 2 l. I might have to double check that though
👍
I dont know if you still respond to these comments, but I'm confused as to why the client can change the color of the box when the "Switch has authority" checks to see if the event is happening on the server. When ever I use this in UE 5.1 the client can never interact with that object when "Switch Has Authority" is connected to it, it just does nothing. @ReidsChannel
If the client has authority over an object then that switch will return true. so it really depends who has authority of ownership of it. For example, each client has authority over their own HUD widget, so doing a switch has authority inside of there will always succeed on a client.
@@ReidsChannel gotcha that was a great explanation thanks!