Vixen
dd8b0a81
csharp
public struct NetworkParent

Which frame a NetworkTransform is expressed in.

Read the guide page for this →

As a component

Size
4 bytes — 1024 rows in a 16 KB chunk, alone on the archetype

Remarks

A component of its own rather than a field on NetworkTransform, and that is the whole design. Almost nothing in a world has a parent, and a field would put thirty-two bits on every transform in the game so that the handful of riders and turrets could have theirs. As a separate replicated component an unparented entity pays nothing at all — no record, no lane, no mask bit — and the transform stays the 88 bits doc 16 costed it at.

It is a NetworkId and not an Entity, for the reason NetworkId exists: the same vehicle is a different handle on every peer. Zero means world space, which is also what a default-initialised one means, so an entity that never had a parent and one that has just lost it are the same value.

Its arrival is not ordered against the parent's. A rider can be told which vehicle it is in several ticks before the vehicle itself is spawned — interest resolved them in one order and the budget shed them in another. What the receiving side does about that is NetworkTransformApplySystem's, and the answer is that the rider does not move until the frame it is quoted in exists. Applying the numbers as world coordinates meanwhile is the one thing that must never happen: it puts the rider at the vehicle's seat offset from the world origin and then corrects itself, which reads as the netcode teleporting people into the ground.

Fields and properties (1)

  • public uint Value

    The NetworkId the position and rotation are relative to. Zero is the world.

Used by (8)

  • MotionTestsVixen.Net.Tests
  • NetworkParentReplicatorVixen.Net
  • NetworkTransformApplySystemVixen.Net.Engine
  • NetworkTransformBridgeTestsVixen.Net.Engine.Tests
  • NetworkTransformCaptureSystemVixen.Net.Engine
  • NetworkTransformInterpolateSystemVixen.Net.Engine
  • NetworkTransformInterpolationTestsVixen.Net.Engine.Tests
  • TypeRegistrationVixen.Net