Getting Started with Netcode for Entities! (DOTS Multiplayer Tutorial Unity 6)

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025

Комментарии •

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  2 месяца назад +3

    💬Netcode for Entities! One of the most requested topics, after quite a bit of research here is a super detailed tutorial, I hope you learn a lot!
    🌍 FREE 7 HOUR DOTS Course! ruclips.net/video/1gSnTlUjs-s/видео.html
    ✅ FREE Game Dev Report Newsletter - cmonkey.co/gamedevreportnewsletter
    📝 Get my C# Complete Course! cmonkey.co/csharpcourse
    🔴 RELATED VIDEOS 🔴
    Learn Unity DOTS! (FREE Tutorial Course) ruclips.net/video/1gSnTlUjs-s/видео.html
    EXTREME PERFORMANCE with Unity DOTS! (ECS, Job System, Burst, Hybrid Game Objects) ruclips.net/video/4ZYn9sR3btg/видео.html
    Making MULTIPLAYER Games has never been EASIER! ruclips.net/video/PCd3yp_VZ-c/видео.html
    The FASTEST TOOLS in the World! (Unity DOTS Asset Review, Animation, Pathfinding) ruclips.net/video/ehDbwr7PyJ4/видео.html
    Learn C# FREE Tutorial Course Beginner to Advanced! [2024 - 12 HOURS] ruclips.net/video/qZpMX8Re_2Q/видео.html
    Flow Field Pathfinding in Unity DOTS! (INSANELY FAST! 15 NEW Lectures) ruclips.net/video/xV0pFUAb7wc/видео.html

  • @zshsvsbhshs
    @zshsvsbhshs 2 месяца назад +9

    you are creating great courses and they all are free, meanwhile i still see people complain about little things in comments. i just wanted to thank you mr monkey, you are a hero

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 месяца назад +3

      Thanks! I hope this video helps a lot of people learn!

    • @Norritt42
      @Norritt42 Месяц назад +2

      He also have great Udemy courses that I can recommend.

  • @AaronAsherRandall
    @AaronAsherRandall 2 месяца назад +6

    The server side prediction looks so good! I was literally working with Photon today and wow, the demo you showed basically knocks what I was working on out of the water!

    • @DemetriMaude
      @DemetriMaude Месяц назад

      were you working with photon PUN or photon FUSION?

  • @GlassVaultStudio
    @GlassVaultStudio Месяц назад +1

    This is fantastic Hugo! Here is a Merry Christmas and a thank you from GVS. 🎄♥

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад +1

      Many thanks for the super thanks! I hope the video helps you learn! Merry Christmas!

    • @GlassVaultStudio
      @GlassVaultStudio Месяц назад

      @@CodeMonkeyUnity Would not even consider learning NE without a CodeMonkey tutorial on it! =) Your tutorials are an absolute game changer.

  • @yurybatsyuro8293
    @yurybatsyuro8293 2 месяца назад

    Thank you for making it only one hour long! What a pleasure it is to have an ability to scroll back when missed a single word!

  • @LegoCreatore
    @LegoCreatore 2 месяца назад +1

    This is amazing content. I definitely recommend the full DOTS course by the way, if you’re wondering if it’s worth it, I really believe it is. So much effort has been put in just like everything by Hugo it is easy to understand and there is a lot of back of forth in the comments under each lesson. I don’t think I’ve seen a more involved teacher
    Looking forward to every next tutorial you put out, I’m so impressed with the quality and how much you simplify very complex concepts

  • @lemetamax
    @lemetamax 2 месяца назад +5

    HOLY SHIIIT!!! Been waiting for this for ages!🎉

  • @NewbNinjas
    @NewbNinjas Месяц назад

    Fantastic work as always Hugo. Love this. I'm halfway through the DOTS course and I'd love to see the Netcode Networking integrated into that project so I can see how I might use it myself. Thanks a million as always.

  • @bagi1941
    @bagi1941 2 месяца назад

    Found my old project made with Photon PUN2 and was going to remake it with Netcode for Entities but it was still in beta and there where no tutorials on how to start with it. And this has come at the perfect time.

  • @BlueGooGames
    @BlueGooGames 2 месяца назад +1

    This is crazy Code Monkey! Two hours ago i was thinking about if Unity netcode for entities would be a good fit for our future game, or if i should look into Photon or something else. So it’s obvious that you’re reading my mind! Thanks, now i will enjoy the video! 😅

  • @arof1594
    @arof1594 2 месяца назад

    Oh Wow, thats what ive been looking for, i am decent at coding dots but didnt look into netcode for dots till now. Nice to see a good video on that powerfull tool

  • @breaking_studio
    @breaking_studio Месяц назад

    We recently started studying Netcode for Entities, and aside from the official documentation, this is the best tutorial I’ve seen-it clarified a few things for me. I just wish you had gone into more detail about session management with Relay, which I find essential for a game. I hope you’ll cover it in the future, as we spent quite a bit of time figuring it out ourselves.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      I'm glad you like the video!
      By session management you mean just the connection? I looked briefly at that sample and it seemed pretty straightforward, I'll look into it some more

    • @breaking_studio
      @breaking_studio Месяц назад

      @@CodeMonkeyUnity Sorry, I wasn't very clear. I meant managing a scene prior to the game where players can choose from a list of sessions and decide where to connect to play. This is seen in the widget package examples. I encountered a lot of problems once players had chosen the session and the game started. When loading a new scene, if not done correctly, the connection is lost or the clientworld loses the networkstreamdriver. Therefore, I believe that an in-depth exploration with some best practices could be beneficial for everyone who wants to use Netcode for Entities. I couldn't find any tutorial that addressed this aspect, which I consider important in the construction of a game.

  • @thegooberator
    @thegooberator Месяц назад

    This just makes my game so much more easy. Goat video

  • @harneetsingh9420
    @harneetsingh9420 Месяц назад

    Many thanks Hugo ! big help, I will watch it after work 😀👍🙏

  • @AaronAsherRandall
    @AaronAsherRandall 2 месяца назад

    CodeMonkey you are the best! Thank you so much for making this!

  • @alec_almartson
    @alec_almartson 2 месяца назад +2

    Thank You Code Monkey. 💯👏🏻
    I really appreciate it.
    This is Amazing... AAA Knowledge for free, and of course there's always the option to pay for premium content.

  • @ConnorMakesGames
    @ConnorMakesGames 2 месяца назад +1

    You just saved me, was just getting started with this and struggling

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 месяца назад

      Yeah it definitely is a bit tricky to get started, took me quite a while of reading the documentation and the samples to figure out how it works, I really hope this video helps!

  • @alexdacat
    @alexdacat Месяц назад

    Thank you so much! This is invaluable!

  • @castlecodersltd
    @castlecodersltd Месяц назад

    Very interesting, thank you 🙂

  • @arsalino1116
    @arsalino1116 26 дней назад

    Hey bro, love your courses.
    Just purchased the DOTS one and im so amazed by the quality.
    Any chance you make a fully blown course with Network for entities and DOTS?
    Maybe reuse what we build on your ECS RTS Course and add multiplayer?
    Ideally with some Listen Server logic.
    Sorry for asking for too much but i would insta buy the course :D

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  25 дней назад +1

      I am currently working on basically remaking my simple multiplayer that I just published but making it with Netcode for Entities ruclips.net/video/YmUnXsOp_t0/видео.html
      After I-m done with that I want to get back to my DOTS RTS game and convert that one into multiplayer.
      That's a lot of work so it will take some time but that's the plan!

  • @nixjavi7220
    @nixjavi7220 Месяц назад

    Amazing! Thanks

  • @philippedasilva1164
    @philippedasilva1164 Месяц назад +1

    Hi CodeMonkey, great tutorial once again. Not totally sure but could it be that your issue with the EntitiesSubscene not being loaded correctly is due to the fact that you are suppose to load it using a dedicated system so that it can actually "await" for the LoadSceneAsync to finish loading and react to the component stating that the subscene is loaded before moving on with the connection?

  • @pedramkavian
    @pedramkavian 2 месяца назад

    Hey CodeMonkey, would be nice if you could explain the workflow of making game in a gaming company. I mean the steps from game design, art, programming, audio and so on.

  • @SojoTaku
    @SojoTaku Месяц назад

    LESSS GOOOOOOOOO

  • @tiyu_ler1341
    @tiyu_ler1341 3 дня назад

    I want to create a 2D puzzle game for 2 players, where each player sees different information on their screen and can interact with or influence objects in their own way. My question is: I don't have a traditional player (prefab); on your screen, there are just objects you can interact with, like a maze. Different players can only see part of it, and they need to communicate in order to navigate through it. (one player see only horizontal lines and can move up and down, the other one see vertical lines and can move left and right)
    Is there a way I can create the game logic for a game without player characters, but where each player has their own scene and we can share information about each player's actions with each other in real time?

  • @disobedientdolphin
    @disobedientdolphin 2 месяца назад +5

    Hey! Could one apply this to the game that is created in your DOTS course? Or is it even planned to include MP into the DOTS game / course?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 месяца назад +10

      I'm going to research that right now. Basically you need to make the Units and Buildings into Ghosts, and just with that it should already be pretty good. Then make RPCs and GhostFields to synchronize all the other data. I'm hoping it won't be too difficult so I'll be able to make a few lectures on it.

    • @carrickmullin5547
      @carrickmullin5547 2 месяца назад +2

      @@CodeMonkeyUnity Can't wait, almost done the paid course

    • @PivotStickF
      @PivotStickF 2 месяца назад +2

      ⁠@@CodeMonkeyUnityThat would be amazing!

  • @bluzenkk
    @bluzenkk 2 месяца назад

    lovely.

  • @toancanh682
    @toancanh682 2 месяца назад

    All of this is free ? Holy cow

  • @mohamadbakr6474
    @mohamadbakr6474 Месяц назад +1

    Thanks very much for always teaching us what we want.
    I have a question,
    I haven't went through the video yet, but in the overview match making wasn't mentioned. How can we include match making in netcode for entities?
    Thanks

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад +1

      There's a separate tool for that, I covered it here ruclips.net/video/90Iw1aNbSYE/видео.html

    • @mohamadbakr6474
      @mohamadbakr6474 Месяц назад +1

      @CodeMonkeyUnity thanks very much

  • @malaka_96
    @malaka_96 2 месяца назад +1

    First 🔥

  • @MechabitGames
    @MechabitGames 2 месяца назад

    Thanks for this but I'll just wait for all the boilerplate stuff to be included by default

  • @muuubiee
    @muuubiee Месяц назад

    Well, I was going to go through turbos netcode video... But I suppose I can start with this one instead.

  • @alhu5514
    @alhu5514 Месяц назад

    From your experience working with both systems is there a number of objects where networked ecs is better than networked gamobjects?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      Hmm I haven't tried doing a stress test so not sure but technically yes Netcode Entities is meant to be much more capable than NGO.
      I would guess NGO's limit is around 20-50 network objects, (Unity themselves recommend 2 to 8 players + other objects) depending on how much they move/change state. Whereas I assume Netcode Entities should be able to handle hundreds

  • @yaboijagerlive7923
    @yaboijagerlive7923 27 дней назад

    Hey, so for my project I really only need DOTS to handle the hundreds of non player enemies, other than that I use mainly GameObjects. If I was to migrate that project to multiplayer, should I go with Netcode for Entities or would NGO work just fine and still give me the benefits of DOTS for handling said enemies? Thank you!

  • @Jaimekk
    @Jaimekk 2 месяца назад

    Você parece que lê minha mente 😂

  • @aimojorma7674
    @aimojorma7674 Месяц назад

    For the error at 1:14:10 I get 2 errors on the Player 2 window's console: "InvalidOperationException: This cannot be used during play mode, please use SceneManager.LoadScene()/SceneManager.LoadSceneAsync() instead." which is caused in something in the Playmode package, and "Asset Assets/SceneDependencyCache/1e860e01e6467dd37402a7b72a4cf33b.sceneWithBuildSettings couldn't be imported. (Most likely the assets dependencies or the asset itself is being modified during import.)" which happens in the Entities package. Your fix and removing the subscene from the scene list works, so I don't need help with it but I would be interested to know what are causing the errors, in case someone knows what's happening there.

  • @jonahmininger3385
    @jonahmininger3385 Месяц назад

    at 16:42 when you go and edit the multiplayer build settings, My settings for the client are greyed out and I can't edit the NetCode Client Target from "Client And Server" to just "Client". Do you know if there is some sort of setting preventing me from changing that? I did also make a new project and start your tutorial and it worked so I'm also curious if that's something that only works if the project is made with the HDRP? I'm not sure if my game was made on that and that's why it isn't working.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      Hmm strange, were you in play mode? If so stop playing and it should allow you to change.
      I haven't seen that option be blocked so no idea why that could happen, I doubt it's related to HDRP. Maybe try changing the Build Target, maybe you have it set to Dedicated server or something, change it to a normal PC build.

    • @jonahmininger3385
      @jonahmininger3385 Месяц назад

      @@CodeMonkeyUnity Maybe I'm misunderstanding your video, but isn't what you setting up in the video a dedicated server setup? or is it and your simply setting it up without the use of the dedicated server? On your suggestion though, I did have it setup on a Linux Server but I tried all the other options and it didn't resolve my problem. Any other thoughts?

    • @you_what319
      @you_what319 12 дней назад

      Edit > Project Settings > Multiplayer > Build > NetCode Client Target, set this to Client and Server. This example can be used as a dedicated server you would switch this back to client to remove any server logic from it's build.

  • @PeterMilko
    @PeterMilko Месяц назад

    Photon is cheaper than Netcode. Can someone please give me a good argument for Netcode?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      If you already like it then keep using it! I haven't used it myself but as far as I know all Netcode tools are awesome nowadays, so use whatever you like.
      By the way Netcode has no cost, Netcode is just the connection. Do you mean Relay? You can use Unity Relay or any other Relay tool with any Netcode toolstack.

    • @rikuleinonen
      @rikuleinonen 28 дней назад

      Netcode performs far better than Photon in my experience. Also, Netcode is free. Relay is paid, but you'd still have to use Relay or a similar service even with Photon.

  • @MohamedGaber-gs3xz
    @MohamedGaber-gs3xz Месяц назад

    Any idea if Netcode for entities is better than the DotsNet created by the authors of mirror ?

    • @tryfinally
      @tryfinally Месяц назад

      mirror is bad and dotsnet is dead

    • @MohamedGaber-gs3xz
      @MohamedGaber-gs3xz Месяц назад

      @tryfinally why ? And which do suggest as an alternative?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад +1

      Hmm no idea since I haven-t used either of those sorry

  • @unal8245
    @unal8245 Месяц назад

    Can you show steamworks + netcode in unity6?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      The only thing different is swapping the transport layer, that is indeed something I'd love to research someday

  • @NewbNinjas
    @NewbNinjas Месяц назад

    so assuming I wanted to use this tutorial but I was running a headless server instance, so the server wasnt a player, how would I go about that?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      Basically no difference, everything the same, you would just have a ServerWorld and no ClientWorld on the server

    • @NewbNinjas
      @NewbNinjas Месяц назад

      @@CodeMonkeyUnity Wouldn't there be some issue with the connectivity to the game? Like, if the server runs an instance, wouldn't it assume there was a player?

    • @you_what319
      @you_what319 12 дней назад

      Good Question, for me using a linux server build, I do not have any issue with the server thinking it's a client. However, I skipped the part with the UI buttons and
      have it just use the autoconnect feature.

  • @driedpotatoes
    @driedpotatoes 11 дней назад

    Fun Fact: you can use Unity.Logging inside of burst compile methods.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  10 дней назад +1

      Oh that's fascinating! I didn't know that package existed. It looks like it was made specifically for logging in DOTS, very interesting.
      Thanks for the tip!

  • @ckjdinnj
    @ckjdinnj Месяц назад +1

    Someone at unity is hovering their finger over the “deprecate current networking api” button and is just waiting for me to start following this tutorial.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      The only networking API they have deprecated was UNET almost 10 years ago, so I would say don't worry about that
      Or if you want go use Netcode for Game Objects, it has already been around for 5 years and is continually getting updates, it's not going anywhere.

  • @sagarhm2237
    @sagarhm2237 27 дней назад

    bro how to run netcode in aws can u share some doc

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  26 дней назад

      What do you mean by that? Netcode is just the connection that sends bytes from A to B, it doesn't "run" on anything.
      You mean dedicated servers? I'm not familiar with AWS but with Unity you export a executable for the server then you run that in some AWS container

    • @sagarhm2237
      @sagarhm2237 26 дней назад

      @@CodeMonkeyUnity Thanks sir.

  • @danielmakuntima5363
    @danielmakuntima5363 Месяц назад

    If i send the game to my friend thas has onathor pc would the conections work? if he opened my game, would we play together?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      If you setup NAT and your firewall then yes. Otherwise you need to use something like Relay to bypass the firewall ruclips.net/video/msPNJ2cxWfw/видео.html

  • @godtierslayer3046
    @godtierslayer3046 Месяц назад

    Woow

  • @mrbinggrae5954
    @mrbinggrae5954 Месяц назад

    Is it not possible to use Addressables in Unity DOTS?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      Not sure what you mean by that, Addressables doesn't have anything to do with Netcode or DOTS. You can use Addressables in a mostly DOTS project

    • @mrbinggrae5954
      @mrbinggrae5954 Месяц назад

      @@CodeMonkeyUnity Is it unnecessary to manage assets dynamically in Unity DOTS?

  • @WelshGuitarDude
    @WelshGuitarDude Месяц назад

    How can I load scriptable objects which has meshes and materials I want to load the mesh and materials used for procedural generation into the dots but baking only works on monobehavior and mesh / materials are also not allowed in components since they are managed unity objects. How do I resolve this...

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      All clients have the same build so all clients have the same scriptable objects. You would use some kind of Enum to send an RPC to the server to define what data you want to grab from what scriptable object.

    • @WelshGuitarDude
      @WelshGuitarDude Месяц назад

      @@CodeMonkeyUnity yeah but thats not what im asking. How do you bake the scriptable object data to an entity so you can use that data from the scriptable object as essentially prefabs because you cant have references to them in entity components.

  • @KirbySamaDesu
    @KirbySamaDesu 2 месяца назад

    Mito

  • @rajsah4667
    @rajsah4667 2 месяца назад

    Hello, does netcode contains host migration system?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 месяца назад +2

      Sadly no I don't think so, at least I didn't see any mention in the docs. It's possible but you'd have to handle it yourself, set up a Lobby and if the host disconnects define another player to be the new Host and start the connection again

    • @rajsah4667
      @rajsah4667 2 месяца назад +1

      @@CodeMonkeyUnity yup, that's wierd PUN 2 solved this issue years ago,
      Thanks please make some tutorial on PUN 2 that will be helpful for us

    • @damislav
      @damislav 2 месяца назад

      ​@@rajsah4667 pun is amazing

    • @lemetamax
      @lemetamax 2 месяца назад

      I think they're working on that to get it into future unity 6 versions

  • @CrunchyDev
    @CrunchyDev 2 месяца назад

    Second

  • @lesstalkmorefun1548
    @lesstalkmorefun1548 2 месяца назад +1

    Code monkey! Since when are you using ai generated pictures???

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 месяца назад +4

      Since it's been available, it's an excellent tool that helps me spend more time on the content of the video itself as opposed to making thumbnails (which I hate doing)

  • @dailynightcore7490
    @dailynightcore7490 Месяц назад +1

    am i the only one who really struggles with him going this fast?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад +2

      You're not supposed to follow this in realtime, just like I absolutely did not learn all of this in one hour, it took me weeks to research for this video.
      So take your time, pause as much as you need as you're writing your own code, best of luck!

  • @goADXX
    @goADXX Месяц назад +1

    please stop using ai thumbnails
    PLEASE

    • @MintTree117
      @MintTree117 Месяц назад

      Lol

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад

      Why? It's an excellent tool that helps me make much better thumbnails than I could draw myself, and it helps me save time so that I can spend that time on the thing that actually matters, the content of the video itself

    • @goADXX
      @goADXX Месяц назад +1

      @@CodeMonkeyUnity i do belive that low quality thumbnails look better then the ones made by ai
      no one will mind if you used ms paint to do so

    • @rikuleinonen
      @rikuleinonen 29 дней назад

      @@CodeMonkeyUnity people don't like AI. It immediately put me off too which is why I scrolled down to see if anyone else was bothered by it. It seems they are.
      I care about the content people make. Not the content that an AI regurgitates. Even if it's a lower quality thumbnail I just don't care. The fact it was made by a person and has actual intent and care behind it is far more impactful in my opinion. You can disagree. But know that a decent chunk of your viewers, including me, hold this opinion. Art is not the field any of us wanted AI to go for first. It was the last. In fact many of us would prefer if AI never went for art.
      I think the best way to describe it is that art is like a conversation. I don't like talking to a public service robot. But I do like talking to you.

  • @pushingpandas6479
    @pushingpandas6479 2 месяца назад

    are get paid by unity to produce so "positive" videos? They not really netural imho

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 месяца назад +10

      Uh? What does this video have to do with positive or negative? This is a Tutorial...

    • @chriscopsey4205
      @chriscopsey4205 2 месяца назад +4

      absolute manchild comment located

    • @greenheart5334
      @greenheart5334 2 месяца назад

      ​​@@CodeMonkeyUnityi do not use unity but it is ok. But unity corp isnt sadly, at least for now. Btw, i got addicted to creating pixel roguelike recently 😅

  • @mohammedzawia1054
    @mohammedzawia1054 Месяц назад

    Using AI art for your thubmnail, pitiful.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Месяц назад +2

      Yup it's an excellent tool that allows me to spend more time on what actually matters, the content in the video, as opposed to the thumbnail which I hate doing