[UE4] How to REPLICATE/REPNOTIFY Multiplayer Values in Unreal Engine!

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ธ.ค. 2024

ความคิดเห็น • 38

  • @aaronhunt7204
    @aaronhunt7204  3 ปีที่แล้ว +9

    I forgot to mention in the "setting up server/multicast events" part, multicasting a repnotify variable is actually not necessary. For the sake of preventing frustration, sometimes a multicast is needed for replicating components or for other types of usage outside of this particular demo, but I wanted to include multicasting in the video for anyone who wants to set up a system like this without OnRep functionality.

    • @gimmiemyfuckingname
      @gimmiemyfuckingname 3 ปีที่แล้ว +2

      Could you please do a video on these "sometimes situations"? This always seems so simple and straightforward in tutorial videos, but when applying to my own stuff it only seems to work half the time. Even doing the exact same thing in the same blueprint will work for one function but not the next...in particular, my current struggle is with item chests, either nobody sees the change, they see double the items put in, or sometimes the widgets won't update etc

    • @romancolaneri3087
      @romancolaneri3087 2 ปีที่แล้ว

      I have a doubt about multicast vs. OnRep.
      Let's say I need to replicate an explosion... I should put the particle system and sound in the multicast event and the destroying of the actor inside de OnRep right?... Or is it in the other way? I tried testing it but I see no differences in the gameplay so I'm trying to undestand it sorry😅

  • @Ragers82
    @Ragers82 ปีที่แล้ว +1

    You are the real mvp. Most tutorials out there does not mention any of this, thus i struggled with some aspects of replicating my gun and animations etc over the multiplayer... this solved it.

  • @jacobsmallman5018
    @jacobsmallman5018 2 ปีที่แล้ว +2

    This was the best tutorial on replication I have seen so far. Clear and to the point.
    Thanks Aaron

  • @alfonshedstrom9859
    @alfonshedstrom9859 2 ปีที่แล้ว +2

    3:41 The reason why values like this might be squared is because getting the squared length of a vector is a cheaper operation than getting the normal length, so it’s perfect for getting a bit more optimization when comparing vector lengths, especially since this is something that happens a lot.

  • @Guraw
    @Guraw 2 ปีที่แล้ว

    This video is really good. Not many tutorials out there that get straight to the point on how to replicate a variable properly. Good execution. Helped me a lot with setting custom colors for my character creator :D - liked and subbed

  • @Cpt.Tripps
    @Cpt.Tripps 2 ปีที่แล้ว +3

    Quick LPT, input fields in Unreal act as a calculator already. If you write "1000"1000" it will change your value to 1,000,000

  • @CrownKing2499
    @CrownKing2499 3 ปีที่แล้ว

    I would love to see more networking tutorials and tips, keep it up!

  • @catdsnny
    @catdsnny 3 ปีที่แล้ว

    Distance squared because taking a square root is super expensive. Nice video, thanks!

  • @edwardkeefner3540
    @edwardkeefner3540 2 ปีที่แล้ว +1

    The distance calculator is squared because it's a cube and not a plane. And square roots are expensive in the engine.

  • @fleurbird
    @fleurbird 3 ปีที่แล้ว

    This is actually very useful

  • @zeon3d755
    @zeon3d755 3 ปีที่แล้ว

    Nice! Thanks.

  • @pietpanzerpanzer5335
    @pietpanzerpanzer5335 ปีที่แล้ว

    Why does the playercontroller cause an access none error in multyplayer when trying to move a pawn variable in input axis events

  • @TimBorggrenDenmark
    @TimBorggrenDenmark ปีที่แล้ว

    And if the characters are not on the server - But on a Dedicated server?

  • @gamiumdev
    @gamiumdev 3 ปีที่แล้ว +3

    i love how he brings up a calculator to square 1000 😂😂. Great video though

  • @irjayjay
    @irjayjay 3 ปีที่แล้ว

    What a legend, thanx so much for this! I'm struggling to see why we'd use any other way of replicating? Probably only in cases where only the players present should be able to see the event trigger, like for an instantaneous explosion, that shouldn't retrigger for anyone else when they get near?

  • @wimeradus
    @wimeradus 3 ปีที่แล้ว +3

    The server does not own the actors that you’re talking about. The Owning client owns their own instances of the actors. And if some of these actors are set to replicate then the server will overwrite these actors since the server has authority over them. Authority however is not the same as ‘owning’ them. So what you are saying slightly before 2:12 is inaccurate.

    • @wimeradus
      @wimeradus 3 ปีที่แล้ว +1

      I’m talking about the Playercontroller, Playerstate and playercharacter. These are owned by the Owning Client. Aka the player that plays/controls this character/player controller.

    • @wimeradus
      @wimeradus 3 ปีที่แล้ว

      But other then that good explanation on the functionality of RepNotify!

  • @diegomartinez3211
    @diegomartinez3211 ปีที่แล้ว

    How to replicate a boolean variable in RepNotify to replicates the conditional to all clients?? I tried search anything about this, but not find nothing related, always talks about functions that are actived in the OnRep Functions but for others cases, or other types o variables... please if you have info or videos that talk about this, i thanks you for support!

  • @bossman602
    @bossman602 2 ปีที่แล้ว

    When I set the Net Cull Distance Squared in the ThirdPersonCharacter blueprint, to 1000000.0, as you did in the video. Only my server character is disappearing from my Client character view. I can still see my client character from the server character view. My steps to reproduce are... I created a third person template game, then set the net cull distance squared, then set the number of players to 2 and set net mode to play as listen server. then i click play and move the characters to the opposite sides of the map. Any insight would be greatly appreciated!

  • @KG-dp9sg
    @KG-dp9sg 3 ปีที่แล้ว +3

    In the second scenario when you walk into the cube the replicated color property is changed and both the server and the clients receive it.
    Then, the blueprint code updates everyone's mesh based on that color.
    When you leave relevancy and come back the CLIENT re-reads the replicated property but there's no longer a way to update the default mesh.
    The client doesn't know about the blueprint code that did it in the first place.
    Set the mesh as replicated, call a server event (not a multicast) and set the mesh to a random color.
    No need for repnotify.

  • @warn2522
    @warn2522 3 ปีที่แล้ว

    Nice video

  • @AsGLeagueStudios
    @AsGLeagueStudios 2 ปีที่แล้ว

    How can i setup replication with Oceanology 5 , i cant get refund and they con me into buying then was like well too bad and kicked majority of user that ask about this from their discord. So i have this $300 product and cant use it for my mutliplayer game :/

  • @DevinDTV
    @DevinDTV 3 ปีที่แล้ว

    hey I'm trying to test something with relevancy distance, but have encountered a problem: when the client i'm controlling walks into relevancy distance of a 2nd client, my window focus switches to the 2nd client. like i'll be walking forward on client1, but then when it loads on client2, suddenly i'm walking forward on client2 instead.
    any ideas?

    • @aaronhunt7204
      @aaronhunt7204  3 ปีที่แล้ว

      I've never seen that, what version of the engine are you using?

    • @DevinDTV
      @DevinDTV 3 ปีที่แล้ว

      @@aaronhunt7204 nvm it was entirely my fault. i was setting input mode to game only on beginplay, but was getting the controller reference in an ambiguous way. i appreciate you getting back to me when i asked, though.

  • @DevinDTV
    @DevinDTV 3 ปีที่แล้ว

    good video

  • @sethdaigle2284
    @sethdaigle2284 ปีที่แล้ว

    just when i thought my understanding of netcode was enough to start making stuff...... Its specifically when he opens the variable as a function for me. Its like I dont know 1/4 of what I think I know and theres no easy way to learn the other 75%. Just bang my head against the wall for a decade until I think ive got all the info I need :/

    • @sethdaigle2284
      @sethdaigle2284 ปีที่แล้ว

      Good vid though, appreciate the info

  • @vegitoblue2187
    @vegitoblue2187 3 ปีที่แล้ว

    3:51 Distance is squared as square root is expensive on CPU

    • @aaronhunt7204
      @aaronhunt7204  3 ปีที่แล้ว

      How is it expensive on CPU?

    • @vegitoblue2187
      @vegitoblue2187 3 ปีที่แล้ว

      @@aaronhunt7204 the calculation in itself is on machine level if I'm not wrong that is what I read in a lot of places.