Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Question Is there an upgrade guide for Netcode for Entities 1.2.0-pre.6

Discussion in 'NetCode for ECS' started by moatdd, Jan 13, 2024.

  1. moatdd

    moatdd

    Joined:
    Jan 13, 2013
    Posts:
    178
    I updated my project from 2022.3.13f1 to 2023.3.0b1 and it's broken some things related to netcode.

    First of all, I'm using a custom bootstrap because I don't want my game to auto-connect when I start it. I want to go through some menus and config stuff first and I don't want to just throw players into a match.

    The documentation provided for the Networked Cube goes the auto-connect route but doesn't explain how to do it in the aforementioned way. This onboarding process is AWFUL. Your 200IQ staff have created a monster that badly needs learning materials for mortals like me to be able to use. There's no freaking ladder with rungs low enough for me to reach.

    I remember I managed to solve it for 2022.3 but it was HELL. Now it's all changed and I'm overwhelmed with error messages and I don't know where to begin.

    You guys are really smart but what you don't seem to get is that lesser intellects like mine have to struggle to get all your second generation Unity systems to work together, because that is what making a game with Unity seems to be nowadays.

    (second generation Unity refers to things like scriptable render pipelines, the new input system, uitoolkit, entities, netcode, addressables, basically everything that has been created in isolation in the last 5 or so years but seemingly hasn't ever been integrated into the same body of work, except that is what I've been trying to do and now I'm burned out)
     
    Last edited: Jan 13, 2024
  2. moatdd

    moatdd

    Joined:
    Jan 13, 2013
    Posts:
    178
    upload_2024-1-14_18-28-7.png
    Where are the samples?!
    Did you forget to link them in the manual?
    Did you forget to add them to the package?
    upload_2024-1-14_18-30-13.png
    ARRRRRRGGGHHHHHHH
     
  3. moatdd

    moatdd

    Joined:
    Jan 13, 2013
    Posts:
    178
    Found the github of netcode samples. downloaded them and opened them up in the beta.

    upload_2024-1-14_21-19-53.png

    Yeah I might just go on vacation until you guys sort this out
     
    jephir likes this.
  4. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    907
    Hey moatdd.

    Thank for the feedback. I think in the pre release some things were missing:
    - The upgrade guide should have been updated with the necessary changes user-side. There should be anything relevant or necessary you need to do though to make your project work as before. If that is not the case we are gladly check this out.

    - for the sample itself, I think they weren't updated, or at least something odd happened with burst. We will check this out.

    The AutoConnect is disabled by default. When you install the NetCode package the game. There is no need to disable it. The AutoConnect is an opt-in not an opt-out feature.

    While I do understand the initial learning curve for Netcode for Entities (and in general Entities) is steep, especially for programmer used to the GameObject landscape, it is not either one of the hardest.
    The NetcubeSample is just showing a quick start guide.
    The HelloNetcode samples are way more step-by-step process of learning one feature at time and are easy to follow, and contains a lot more docs in code and in the sample itself.

    Not to mention , the AutoConnect is also pretty documented in the ClientServerBootstrap class. So with some minimal reading you can understand all about it.

    As I said, I do understand pain and frustration, but please moderate your tone. This sound accusatory and we are instead trying our best to make thing easier as possible. We are lacking good documentation, we know about that, so please help us with that by giving constructive feedbacks.
     
    moatdd likes this.
  5. moatdd

    moatdd

    Joined:
    Jan 13, 2013
    Posts:
    178
    I used beta 2023.3.0b1 and add the NetcodeSamples project to the Hub.

    https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/NetcodeSamples

    I think that the documentation needs to approach this from a more standard use case/scenario for implementation into a commercial product which would be something like:

    1. Launch program EXE.
    2. Preload all addressable assets and shaders.
    3. Show annoying user-skippable middleware and publisher intro splash screens. (OODLE, BINK, etc.)
    4. Show any intro trailers/cutscenes.
    5. If using Entities for any interactive or realtime main menu effects, start client presentation world.
    6. [Press Start] (to enter main menu and adjust options)
    7. Display main menu.
    8. If the player decides to quit, destroy client presentation worlds and de-load all assets, in that order.
    9. When player starts a multiplayer game, launch the lobby system.
    10. When a player finds a game from the lobby, start/initialize appropriate network world(s).
    11. Connect to server or start host and connect to it.
    12. If the connection fails/timeout deinitialize the network worlds and return to main menu
    13. Go in game on connection.
    Do you see how this changes things? We don't just do all the entity-related stuff in a vacuum, all at once. A lot of stuff often has to be orchestrated to run before Entities get involved, and then Entities have to mesh with other systems (such as Addressables, the new Input System, the lobby and multiplayer systems, which may or may not be provided by Unity Services)

    Fortunately, this orchestration is often quite the same across implementation of nearly every game you encounter out there, and it gives a clear structure as to how the tutorial steps should be presented, where the context of execution is provided alongside each step. What I'm looking for in a tutorial is something more like an implementation guide.

    Then once you're ingame:

    1. How do we support pausing?
    2. How about saving and loading?
    3. What happens if someone has created a custom map/scene on their server and this information needs to be synchronized to other clients?
    4. What happens when someone joins in late-game and we have to synchronize them?
    5. When a round ends and a new round begins, how should we clear/reset things?
    6. What happens when someone joins when a round is ending or the round is loading?
    7. When the game ends / upon disconnection, how should things be cleared/reset to the menu state?

    These are the sorts of questions that involve pushing the implementation of Entities/Netcode beyond a jam game. I get annoyed when the Unity marketing department uses terms like "production ready" to bait developers like me into thinking that new features are ready to be used at a foundational level for a deeper game only to be unpleasantly surprised when it turns out that nobody tried to make these systems talk together, and that work falls to me, and there's zero information on how to do this because I always seem to be the first person to encounter it despite the questions I have in the list above being very... standard and to be expected. How can I be the first and only person having these questions?

    I'll follow up on this soon in a more civil fashion, I'm just a little too unstable at the moment and I'm sorry for my outburst. I have no excuse. At this point I've basically just run out of options and willpower and I regret having anything to do with entities. I don't just deal with learning entities. I deal with learning everything. If you can find me anyone at Unity that could make a game all by themselves using all of Unity's 2nd generation systems then they should be the ones to make the docs.
     
    Last edited: Jan 16, 2024
  6. moatdd

    moatdd

    Joined:
    Jan 13, 2013
    Posts:
    178
    I think that someone who is coming to entities from scratch may even have an easier time than someone who has a lot of prior experience working with things like GameObjects getting sideswiped by the changes. It's a lot harder to unlearn things and when you have a lot of built-up experience making things work together and the introduction of a chaotic element like Entities just flips the table.

    Like when I learned that after struggling to understand and implement Addressables to create a modding-friendly file architecture I THEN learned that Subscenes don't work with Addressables and I have to use some sort of Content Delivery system, so now there's a ton of other stuff I have to get involved in.

    I do understand a lot of the stuff and I wouldn't have gotten this far if I didn't. Problem is, entities are way harder to learn because there are a lot more restrictions as to what you can and can't get away with because as the system is designed for optimal efficiency, a lot of the guardrails for memory management are not there -- you have to be responsible for every bit of memory you allocate and deallocate and debugging is a lot harder when the stack traces point to autogenerated code and there's a lot less for me to work with because I can't simply enter the disassembler to see what is going on under the hood.

    For instance, I was able to bumble my way quite far working with scriptable renderer pipelines through undocumented issues simply by going through with Rider's disassembler to see how other systems worked and then to determine a solution, but every time something with Entities goes wrong I get errors in autogenerated code or in inaccessible areas, and the iterative compile times with Entities can sometimes be really slow.

    You can explain things like Entities to me very quickly, but it will take a lot longer to make me understand them.

    Again, I apologize for losing my cool. It's just... I am right now at a crossroads as to whether I should continue to try and press on with Entities because of the promise of what it could bring or to gut it from my codebase and stick with conventional techniques because this thing could basically break in a way that I can't fix at any time. It is *very* abstract to work with and honestly, it's so easy for me to do something that results in massive error spam. Honestly, Unity feels like a piecemeal agglomeration of technologies that is actively driving me towards Unreal, which is a cohesive game engine, and the only thing keeping me working with Unity is my familiarity with the platform and the amount of time I have invested in my project.
     
    Last edited: Jan 16, 2024
  7. ScallyGames

    ScallyGames

    Joined:
    Sep 10, 2012
    Posts:
    50
    As I'm just reading this post while in the process to upgrading to 1.2:

    This now seems to be addressed, if you read through https://docs.unity3d.com/Packages/c...hangelog/CHANGELOG.html#120-pre4---2023-11-28 it says

    I haven't tested it yet but this seems to do exactly what you want to do.

    Also check out the new Megacity Metro sample which has a similar setup with initial menu into multiple connection options.