com.unity.netcode 0.0.1-preview.6
Notes: processedReleased November 26, 2019
Browse versions
PreviousNext
Unity Compatibility
Minimum Unity: 2019.3 (0b11)
Package Dependencies
✨ Features
- Made it possible to scale importance based on distance to support more ghosts.
- Nested entities constaining replicated data are now supported.
- Entity references now supported as ghost fields. The references are weak references which will resolve to Entity.Null if the target is not guaranteed to exist.
- NativeString64, enums and bools are supported as ghost fields.
- `ClientServerTickRate` added where you can configure certain behavior relating to timestepping. A headless server can be configured to sleep after hitting target framerate to conserve CPU usage.
- Send different data depending on if the entity is predicted or interpolated, some savings can be done in the predicted case.
- Added a protocol version which must match for the connection to succeed.
- Added time graphs and server view to the network debugger.
- Network simulator now supports jitter.
🔄 Changes
- The authoring flow has been improved.
- - `GhostAuthoringComponent` now automatically detects what components an entity has after conversion runs and automatically populates them when you press the "Update component list" button. You no longer need to manually type in each component name.
- - Default values can be defined for certain component types, for example with Translation components you usually want to synchronize the Value field. When default handling has been defined the ghost authoring component uses that when it parses the entity component list.
- - `[GhostDefaultField]` attribute added. This can be added to ghost variable which are to be synchronized. The GhostAuthoringComponent detects these fields.
- - `[GhostDefaultComponent]` attribute added. This can be used to define default behavior for how a component should be synchronized, InterpolatedClient, PredictedClient and Server.
- - `GhostCollectionAuthoringComponent` added. This is where all spawned prefabs can be registered
- - Paths are easier in general as you can set up the root of where you want generated files placed and defaults can be specified in code.
- - Which components result in variable data being replicated are marked in bold in the inspector, so it's easier to see how much data will be sent per ghost.
- Improved snapshot prediction handling
- - Uses the servers delta times now instead of the clients.
- - Support for dynamic timestep and fractional tick prediction.
- - Handles stalls and won't try to replay to far back in the rollback (64 frames is maximum)
- - Less boilerplate code needed to setup a predicted entity, more default handling moved to code generation
- - Added `GhostPredictionSystemGroup` with better calculations for the currently predicting tick on the client
- - Interpolation time is an offset from prediction time to make sure they do not drift.
- Multiple inputs are sent together so dropped inputs have less effect on misprediction.
- Thin clients added, these use fewer resources than full client simulations so it's easier to test with many clients now.
- An RPC heartbeat system was added which only runs when nothing is being sent from the client to the server, preventing a disconnect timeout from happening. As soon as inputs are sent and snapshot synchronization starts, the system stops running.
- RPC boilerplate code reduced, when a component inheriting`IRpcCommandRequestComponentData` is added to an entity along with `SendRpcCommandRequestComponent` it will be sent automatically.
- The client/server world bootstrapping has been simplified, you can now use your own custom bootstrapping more easily and create the client/server worlds depending on which one you want at runtime. By default the world creation in the editor is controlled by the playmode tools.
- `NetCodeConversionSettings` added which makes it possible to specify which type of build you want (client/server) in the subscene build settings workflow.
- Detect when ackmask desyncs occur
- Improved ghost code generation to make it able to regenerate code when there are compile errors.
- Snapshots are now acknowleged when there is no CommandSendSystem.
- Use the entities TimeData struct instead of getting time from Client/ServerSimulationSystemGroup
🔧 Bug Fixes
- The code generation in Ghost Authoring Components now generate imports for user namespaces.
- Code generation triggers an asset database refresh so the modified files are compiled.
- Command inputs now correctly respects the `NetworkStreamInGame` being present before starting transmission.
- Acks can now arrive with bigger interval than 64 ticks
- Generated code no longer requires unsafe code to be enabled in the project.
- ### Upgrade guide
- Unity 2019.3 is now required (beta 11 minimum) and Entities 0.2.0-preview.
- The `NetCode` folder was moved to a proper package, `com.unity.netcode` which should now be used instead.
- All the netcode was moved to a `Unity.NetCode` namespace.
- `[NotClientServerSystem]` attribute removed, use `[UpdateInWorld(UpdateInWorld.TargetWorld.Default)]` instead, it will do the same thing.
- `GhostPrefabAuthoringComponent` removed, use the new `GhostCollectionAuthoringComponent` instead for setting up ghost data.
- `ClientServerSubScene` removed, it's not needed anymore.
- `NetworkTimeSystem.predictTargetTick` removed, use `GhostPredictionSystemGroup.PredictingTick` instead.
- The interface for RPCs has changed and they no longer require a generated collection.
