Skip to content

Commit

Permalink
com.unity.netcode@1.0.10
Browse files Browse the repository at this point in the history
## [1.0.10] - 2023-05-23

### Added

* What's New and Upgrade Guide section in the docs.
* New NetworkRequestListenResult cleanup component, that can be used to track the result of a listen request.

### Changed

* documentation index page with up-to-date info and links.
* Removed forcing local client/server to alway use the loopback address to connect.
* It is now possible to listen to the NetworkEndPoint.Any also for IPC connection.
* The NetworkStreamDriver.GetRemoteAddress always return a consistent address for the connection when the NetworkDriver is configured to use the Unity Relay. Before, an invalid address was returned after the connection has been established, that was incorrect.
* Exposed all the internal state of the NetworkTimeSystem as public API

### Fixed

* exceptions when NetworkRequestListen and/or. NetworkRequestConnect are handled and proper handling of multiple (erroneous) requests presents.
* A problem with InterpolatedTick, going back and not recovering correctly in presence of large application, either the server or the client, stalls (i.e after loading).
  • Loading branch information
Unity Technologies committed May 23, 2023
1 parent 916c73e commit e6db301
Show file tree
Hide file tree
Showing 44 changed files with 828 additions and 421 deletions.
58 changes: 40 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog


## [1.0.10] - 2023-05-23

### Added

* What's New and Upgrade Guide section in the docs.
* New NetworkRequestListenResult cleanup component, that can be used to track the result of a listen request.

### Changed

* documentation index page with up-to-date info and links.
* Removed forcing local client/server to alway use the loopback address to connect.
* It is now possible to listen to the NetworkEndPoint.Any also for IPC connection.
* The NetworkStreamDriver.GetRemoteAddress always return a consistent address for the connection when the NetworkDriver is configured to use the Unity Relay. Before, an invalid address was returned after the connection has been established, that was incorrect.
* Exposed all the internal state of the NetworkTimeSystem as public API

### Fixed

* exceptions when NetworkRequestListen and/or. NetworkRequestConnect are handled and proper handling of multiple (erroneous) requests presents.
* A problem with InterpolatedTick, going back and not recovering correctly in presence of large application, either the server or the client, stalls (i.e after loading).


## [1.0.8] - 2023-04-17

### Changed
Expand Down Expand Up @@ -39,27 +61,27 @@

### Changed

* The following components have been renamed:
NetworkSnapshotAckComponent: NetworkSnapshotAck,
IncomingSnapshotDataStreamBufferComponent: IncomingSnapshotDataStreamBuffer,
IncomingRpcDataStreamBufferComponent: IncomingRpcDataStreamBuffer,
* The following components have been renamed:
NetworkSnapshotAckComponent: NetworkSnapshotAck,
IncomingSnapshotDataStreamBufferComponent: IncomingSnapshotDataStreamBuffer,
IncomingRpcDataStreamBufferComponent: IncomingRpcDataStreamBuffer,
OutgoingRpcDataStreamBufferComponent: OutgoingRpcDataStreamBuffer,
IncomingCommandDataStreamBufferComponent: IncomingCommandDataStreamBuffer,
OutgoingCommandDataStreamBufferComponent: OutgoingCommandDataStreamBuffer,
NetworkIdComponent: NetworkId,
IncomingCommandDataStreamBufferComponent: IncomingCommandDataStreamBuffer,
OutgoingCommandDataStreamBufferComponent: OutgoingCommandDataStreamBuffer,
NetworkIdComponent: NetworkId,
CommandTargetComponent: CommandTarget,
GhostComponent: GhostInstance,
GhostChildEntityComponent: GhostChildEntity,
GhostOwnerComponent: GhostOwner,
PredictedGhostComponent: PredictedGhost,
GhostTypeComponent: GhostType,
GhostChildEntityComponent: GhostChildEntity,
GhostOwnerComponent: GhostOwner,
PredictedGhostComponent: PredictedGhost,
GhostTypeComponent: GhostType,
SharedGhostTypeComponent: GhostTypePartition,
GhostCleanupComponent: GhostCleanup,
GhostPrefabMetaDataComponent: GhostPrefabMetaData,
PredictedGhostSpawnRequestComponent: PredictedGhostSpawnRequest,
PendingSpawnPlaceholderComponent: PendingSpawnPlaceholder,
ReceiveRpcCommandRequestComponent: ReceiveRpcCommandRequest,
SendRpcCommandRequestComponent: SendRpcCommandRequest,
GhostPrefabMetaDataComponent: GhostPrefabMetaData,
PredictedGhostSpawnRequestComponent: PredictedGhostSpawnRequest,
PendingSpawnPlaceholderComponent: PendingSpawnPlaceholder,
ReceiveRpcCommandRequestComponent: ReceiveRpcCommandRequest,
SendRpcCommandRequestComponent: SendRpcCommandRequest,
MetricsMonitorComponent: MetricsMonitor,

### Removed
Expand Down Expand Up @@ -244,8 +266,8 @@ MetricsMonitorComponent: MetricsMonitor,

### Use the new NetworkTime component

All the information in regards the current simulated tick MUST be retrieved from the singleton NetworkTime. In particular:
* The GhostPredictionSystemGroup.PredictedTick has been removed. You must always use the NetworkTime.ServerTick instead. The ServerTick value will correcly reflect the current predicted tick when inspected inside the prediction loop.
All the information in regards the current simulated tick MUST be retrieved from the singleton NetworkTime. In particular:
* The GhostPredictionSystemGroup.PredictingTick has been removed. You must always use the NetworkTime.ServerTick instead. The ServerTick value will correcly reflect the current predicted tick when inspected inside the prediction loop.
* The GhostPredictionSystemGroup.IsFinalPredictionTick has been removed. Use the NetworkTime.IsFinalPredictionTick property instead.
* The ClientSimulationSystemGroup ServerTick, ServerTickFraction, InterpolationTick and InterpolationTickFraction has been removed. You can retrieve the same properties from the NetworkTime singleton. Please refer to the `NetworkTime` component documentation for further information about the different timing properties and the flags behaviours.

Expand Down
6 changes: 3 additions & 3 deletions Documentation~/ghost-types-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ You must define the Template file correctly. It can be added to any package or f
You will get errors if a) you define a `UserDefinedTemplate` that has no found Template file b) vice-versa, or c) you make errors when defining the `UserDefinedTemplate`.
Code-Generation errors of the Template _may_ cause compiler errors.

This new template `MyCustomNamespace.MyCustomTypeTemplate.NetCodeSourceGenerator.additionalfile` needs to be set up similarly to the default types templates.
This new template `MyCustomTypeTemplate.NetCodeSourceGenerator.additionalfile` needs to be set up similarly to the default types templates.
Here is an example copied from the default `float` template (where the float is quantized and stored in an int field):

```c#
Expand Down Expand Up @@ -170,7 +170,7 @@ namespace Generated
}
```

A good way to assign this "#templateid" is to use something like `CustomNamespace.CustomTemplateFileName`. All the default Netcode package template uses an internal
A good way to assign this "#templateid" is to use something like `CustomNamespace.CustomTemplateFileName`. All the default Netcode package templates uses an internal
id (not present in the template) with the following format: `NetCode.GhostSnapshotValueXXX.cs`.

>[!NOTE] The default types uses a slightly different approach at the moment, being embedded in the generator dlls.
Expand Down Expand Up @@ -203,7 +203,7 @@ namespace Unity.NetCode.Generators
Smoothing = SmoothingAction.InterpolateAndExtrapolate,
SupportCommand = false,
Composite = false,
Template = "Assets/Samples/NetCodeGen/Templates/MyCustomNamespace.MyCustomTypeTemplate.NetCodeSourceGenerator.additionalfile",
Template = "MyCustomNamespace.MyCustomTypeTemplate",
TemplateOverride = "",
},
});
Expand Down
Binary file added Documentation~/images/entities-splash-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Documentation~/images/entities-splash-image.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 13 additions & 24 deletions Documentation~/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

# Unity Netcode for Entities
The Netcode for Entities package provides a dedicated server model with client prediction that you can use to create multiplayer games. This documentation covers the main features of the Netcode package.

## Preview package
This package is available as a preview, so it is not ready for production use. The features and documentation in this package might change before it is verified for release.
The Netcode for Entities, part of the Unity's Data Oriented Technology Stack (DOTS), provides
a server authoritive with client prediction framework that you can use to create multiplayer games.

### Development status
The Netcode for Entities developers are prototyping the package in a simple multi-directional shooter game, similar to Asteroids, as well as another set of samples, publicly available [here](https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/NetcodeSamples), which are used for both showcasing the package features and testing the package internally.
See our publicly available [Unity Netcode Samples](https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/NetcodeSamples) for introductory step by step sample, material, and some more advanced demos.

The main focus of the Netcode development team has been to figure out a good architecture to synchronize entities when using ECS. As such, there has not yet been much exploration into how to make it easy to add new types of replicated entities or integrate it with the gameplay logic. The development team will focus on these areas going forward, and are areas where they want feedback. To give feedback on this package, post on the [Unity DOTS Netcode Forum](https://forum.unity.com/forums/dots-netcode.425/).
![](images/entities-splash-image.png)

## Installation

Expand All @@ -19,23 +18,13 @@ Netcode for Entities requires you to have Unity version __2022.2.0f1__ or higher

This package uses Unity’s [Entity Component System (ECS)](https://docs.unity3d.com/Packages/com.unity.entities@latest) as a foundation. As such, you must know how to use ECS to use this package.

## Known issues

* Making IL2CPP build with code stripping set low or higher crashes the player (missing constructors). Code stripping must be always set to none/minimal.
* When connecting to a server build with the editor as a client (like from frontend menu), make sure the auto-connect ip/port fields in the playmode tools are empty, if not it will get confused and create two connections to the server.
* In some rare cases, found so far only on Mac M1, a StackOverflow exception may be thrown inside the generated XXXGhostComponentSerializer.GetState method.
Usually the problem start occurring with component sizes around 4K+. </br>
To help nailing down when this is happening, you can uncomment the following lines inside the Editor/Templates/GhostComponentSerializer.cs template (remember to recompile the source generator after that) or drag the offending
generated class inside the assembly it pertain and modify it there.
```csharp
//ADD THIS LINE TO DEBUG IF A BIG COMPONENT MAY BE CAUSING A STACK OVERFLOW INSIDE THE GetState
// const int maxSizeToAvoidStackOverflow = 4_500;
// if (s_State.ComponentSize > maxSizeToAvoidStackOverflow)
// {
// UnityEngine.Debug.LogWarning($"The type '{s_State.ComponentType}' is very large ({s_State.ComponentSize} bytes)! There is a risk of StackOverflowExceptions in the Serializers at roughly {maxSizeToAvoidStackOverflow} bytes! Remove large fields.");
// }
```
## Always looking for your feedback
The Netcode for Entities team is always looking for feedback, suggestion and improvement.
To give feedback on this package, post to
- [Unity DOTS Netcode Forum](https://forum.unity.com/forums/dots-netcode.425/).
- [Unity DOTS Discord Channel](https://discord.gg/unity/).

## Additional resources

* [Prerelease (1.0.0-pre.65) documentation](pre-release.md)
* [Getting started](getting-started.md)
* [Upgrade guide](upgrade-guide.md)
* [What's new](whats-new.md)
9 changes: 8 additions & 1 deletion Documentation~/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ To setup Netcode for Entities, you need to make sure you are on the correct vers

## Unity Editor Version

Netcode for Entities requires you to have Unity version __2022.2.0b8__ or higher.
Netcode for Entities requires you to have Unity version __2022.3.0f1__ or higher.

## IDE support
The Entities package uses [Roslyn Source Generators](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview). For a better editing experience, we suggest to use an IDE that's compatible with source generators.
The following IDEs are compatible with source generators:

* Visual Studio 2022+
* Rider 2021.3.3+

## Project Setup

Expand Down
3 changes: 0 additions & 3 deletions Documentation~/pre-release.md

This file was deleted.

Loading

0 comments on commit e6db301

Please sign in to comment.