-
Notifications
You must be signed in to change notification settings - Fork 450
fix: snapshot system. last fixes for release #1129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ing the sent info) from preparing the buffer to send
…t in the specified limit, instead of stopping once the limit is busted
…pawns are limited in message size
…hot-system-spawn4
…hot-system-spawn4
…hot-system-spawn4
…Otherwise it grows unbound
…aves it disabled
…hot-system-spawn4
@@ -1067,5 +1118,37 @@ private void DebugDisplayStore() | |||
table += "======\n"; | |||
Debug.Log(table); | |||
} | |||
|
|||
static internal SnapshotDespawnCommand GetDespawnCommand() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see what this does. The struct constructor already initializes everything as default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this is a struct it will not pass the static instance by reference here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. After re-trying seems like I was confused with C++ (again).
Was using SnapshotDespawnCommand command;
instead of
SnapshotDespawnCommand command = new SnapshotDespawnCommand();
will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also do SnapshotDespawnCommand command = default
(will do exactly the same as default constructor)
var diff = Math.Min(63, m_CurrentTick - spawnCommand.TickWritten); | ||
|
||
// -1 to make the first resend immediate | ||
return (1 << diff) > (spawnCommand.TimesWritten - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty cool 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spawn/despawn backoff looks good.
…hub.com:Unity-Technologies/com.unity.multiplayer.mlapi into sam/feature/interpolation-for-network-transform * 'sam/feature/interpolation-for-network-transform' of github.com:Unity-Technologies/com.unity.multiplayer.mlapi: fix: networkscenemanager not releasing buffers from pool (#1132) test: fixed-length strings in netvars (#1119) fix: snapshot system. last fixes for release (#1129) refactor!: Unified Shutdown (#1108) chore: Fill out unity project for integration test project (#1128) feat: make ServerRpc ownership check an error log instead of warning log (#1126)
* feat: snapshot. MTT-1087 first part. separating the side effect (storing the sent info) from preparing the buffer to send * feat: snapshot. MTT-1087 second part. Writing SnapshotMessage that fit in the specified limit, instead of stopping once the limit is busted * feat: snapshot. MTT-1087 part 3. Writing spawns after acks, because spawns are limited in message size * feat: snapshot. MTT-1087 part 4. Using max spawn message size from NetworkConfig * feat: snapshot. mtt-1087. Forgotten , for performance * feat: snapshot. MTT-1089 pessimistic resend control. spawn part * feat: snapshot. MTT-1089 pessimistic resend control. despawn part * fix: snapshot. Cleaning up our clientData.SentSpawns data structure. Otherwise it grows unbound * feat: snapshot. Last fixes for release. Prepares for MTT-1089, but leaves it disabled * feat: snapshot. Last fixes for release. PR review comments * style: snapshot. Coding standards * style: snapshot. Coding standards
Use
GetSpawnCommand'
GetDespawnCommand` to get default-constructed structs. Makes the code lighter and protects the code from needing to change when a field is added to those structs.Keeps track of how many time a spawn was written to a message. Will be needed for controlling re-sends, but not used for now.
Empties the
SentSpawn
array, when spawns and despawns are ack'ed. It would grow unbound otherwise.That should be it for SnapshotSystem for this release. :-)