Search Unity

Feedback PhysicsGraphicalSmoothing and PhysicsGraphicalInterpolationBuffer should be Predicted Client

Discussion in 'NetCode for ECS' started by Kmsxkuse, May 14, 2023.

  1. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    PhysicsGraphicalSmoothing [PGS] is a physics component used for rendering smoothing by interpolating (when PhysicsGraphicalInterpolationBuffer [PGIB] exists) or extrapolating (when PGIB isn't on the entity).

    Current default variants for these two components is All Predicted for PGS and All (not set to anything) for PGIB.

    Since the server never needs to render anything, neither of these components are of any use and are wasting chunk capacity.

    Interpolated ghosts as well don't need any physics interpolation because their movement is controlled by the server data packets and not physics. Hence PGIB is being wasted on interpolated clients.

    I would like to suggest that these two component be default set to Predicted Client in NetCode's
    PhysicsDefaultVariantSystem
    .
    Code (CSharp):
    1. [GhostComponentVariation(typeof(PhysicsGraphicalSmoothing), nameof(PhysicsGraphicalSmoothing))]
    2. [GhostComponent(PrefabType = GhostPrefabType.PredictedClient)]
    3. public struct PhysicsGraphicalSmoothingDefaultVariant
    4. {
    5. }
    6.  
    7. [GhostComponentVariation(typeof(PhysicsGraphicalInterpolationBuffer), nameof(PhysicsGraphicalInterpolationBuffer))]
    8. [GhostComponent(PrefabType = GhostPrefabType.PredictedClient)]
    9. public struct PhysicsGraphicalInterpolationBufferDefaultVariant
    10. {
    11. }
     
    Last edited: May 14, 2023
  2. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I would like to add on that consider change to enableable component and disable the components for non predicted client ghost to make both predicted and interpolate ghosts merge into same archetype by default. And also even better for variant system add the feature to make it able to override component to become enableable component with / without [GhostEnabledBit].
     
  3. NikiWalker

    NikiWalker

    Unity Technologies

    Joined:
    May 18, 2021
    Posts:
    316
    Hello! Thanks for this feedback, great catches! I'll ping back once the team has had time to action them.

    I know @CMarastoni has ideas in this area.

    Oh, good catch! You're right, this is achievable relatively easily via variants.

    All of the above is now in our backlog. :)
     
    Kmsxkuse likes this.