Unreal Engine - Replication Basics (2/3)

2021 ж. 9 Шіл.
11 765 Рет қаралды

Support the channel through donations. Crypto accepted!
PayPal: paypal.me/reidschannel?locale...
Patreon: / reidschannel
Bitcoin: 1JFwWHr4X6uAeoZadukzqKjzFBj3Qjy7Sk
Ethereum: 0x2B2Bc108F1Cc0fF899959dEF3226637787d8C3dE
Dogecoin: DNQ33YnhpWoTBokBNVkZP5ub8KTLkpyjpv
Join our community discord!
Discord: / discord

Пікірлер
  • 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.

    @duroxxigar@duroxxigar2 жыл бұрын
    • 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@Rick_Jagger Жыл бұрын
    • @@Rick_Jagger im curious if what you suggested is true. been trying to understand network replication fully

      @maiworld_@maiworld_ Жыл бұрын
    • @@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.

      @Rick_Jagger@Rick_Jagger Жыл бұрын
    • 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.

      @elliottberkley@elliottberkley Жыл бұрын
    • @@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.

      @duroxxigar@duroxxigar Жыл бұрын
  • 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.

    @DeepFriedOreoOffline@DeepFriedOreoOffline2 жыл бұрын
  • this set of videos is saving me hours! Thank you

    @XPol555@XPol555 Жыл бұрын
  • 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

    @DevGods@DevGods2 жыл бұрын
  • 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

    @B4NTO@B4NTO2 ай бұрын
  • 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?

    @Cvijo123@Cvijo1235 ай бұрын
  • 👍

    @stormolflak@stormolflak Жыл бұрын
  • 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

    @VizibilityZero@VizibilityZero9 ай бұрын
    • 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@ReidsChannel9 ай бұрын
    • @@ReidsChannel gotcha that was a great explanation thanks!

      @VizibilityZero@VizibilityZero9 ай бұрын
KZhead