Search Unity

NetCode Questions

Discussion in 'NetCode for ECS' started by Tarmack, Jan 28, 2020.

  1. Tarmack

    Tarmack

    Joined:
    Dec 16, 2016
    Posts:
    12
    Hi, i am actually starting to use the NetCode 0.0.4 from Unity and i have some questions about the GhostPrefabs:
    In all the samples, the prefab is a simple GameObject, that doesn't have child.

    What happend if i add a child (or many) with colliders(arms, hands, weapons for exemple etc ... do they all have to get a GhostPrefabComponent ?.

    Thx
     
    Opeth001 likes this.
  2. Tarmack

    Tarmack

    Joined:
    Dec 16, 2016
    Posts:
    12
  3. timjohansson

    timjohansson

    Unity Technologies

    Joined:
    Jul 13, 2016
    Posts:
    473
    You only add the GhostAuthoringComponent to the root GameObject on the prefab in that case. The child GameObjects will be converted and included in the entity prefab. You can synchronize data on the child entities and it will be replicated together with the other entities in the prefab.
    You cannot currently exclude components on a child entity with the server/interpolated/prediceted checkboxes, and performance is not as good when having multiple entities since it needs to access all the entities at the same time for serialization.
    We are using this pattern for most ghosts in the DotsSample.
     
  4. Tarmack

    Tarmack

    Joined:
    Dec 16, 2016
    Posts:
    12
    Thx a lot !
    I feel like we are connected i just opened the Unity forums to see if i had an aswer lol!
    I haven't downloaded the Dots Sample Yet, but i'm doing this toonight.

    Btw can we have any roadmap on NetCode ? so we can follow what's planned for it etc ?

    Thx.
     
    Mikael-H and GameDevDustin like this.
  5. GameDevDustin

    GameDevDustin

    Joined:
    Jul 17, 2015
    Posts:
    16
    Would love to see a roadmap for NetCode!
     
    efpoman and Mikael-H like this.
  6. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Is there a better way to represent hierarchies using netcode? It becomes very clunky very fast with lots of (error prone) manual clicking. I made a car with 4 wheels. Each wheel has one entity for where the original position is and one where it goes depending on suspension. This generates a lot of hierarchy and (by default) lots of stuff that does not need to be synched. I only need one value to be synched really (the amount of movement dud to suspension).

    In the image you can see that it is a bit hard to navigate since not even names are there to guide me :) I am sure I am not using the system as intended so I am curious what the intended way is... upload_2020-4-18_21-36-2.png
     
    florianhanke likes this.
  7. florianhanke

    florianhanke

    Joined:
    Jun 8, 2018
    Posts:
    426
    I asked a similar question as you a while back since I have a similar issue (only probably worse since I have weapons and a turret on the car as well): https://forum.unity.com/threads/netcode-how-to-set-child-component-handling.806991/ (see answer at the end – based on the changelog https://docs.unity3d.com/Packages/com.unity.netcode@0.1/changelog/CHANGELOG.html I don't think that's quite possible yet)
     
    Mikael-H likes this.