Commit 28109b4
authored
fix: NetworkTransform teleport interpolating from last position on non-authoritative side [NCCBUG-166] (#2110)
* fix
NetworkTransform was setting the value of m_Bitset but not resetting the individual bits if there was no deltas. This would result in a gradually increasing message size over time when updating the NetworkTransform.
* update
migrating the assignment back down below the CanCommitToTransform
* fix
This resolves the issue where clients were applying every value marked to be synchronized even if the update didn't include specific axis values.
* test
This includes some fixes to prefabs that hadn't been updated to the more recent changes in NetworkTransform that limited the minimum threshold (i.e. they were set to 0 which causes issues)
* fix
Since we are now no longer sending the entire transform values, this addition prevents the non-authoritative side from making changes to the transform.
* style
removing whitespace
* update
Adding some test adjustments and including rotation to interpolation measurements.
* style
removing an unused namespace.
* style
fixing issue with reference to UnityEngine's Object after I removed the system namespace.
* fix
This includes the adjustments for client authoritative mode to work without sending RPCs.
* fix
This update fixes the issue where the authoritative side was interpolating when interpolate is enabled.
Now, the authoritative side no longer interpolates.
* manual test updates
These changes make the player client authoritative within the Samples Menu->Additive Scene Loading manual test/sample.
* update
reverting the change of m_Bitset to an internal.
* test update
updating test to account for reverting back to the private m_Bitset.
* update
Migrated the code that updates interpolators with the current value if the axis is not set into the AddInterpolatedState method as opposed to it being in the ApplyInterpolatedNetworkStateToTransform
* fix
First pass fix for teleporting.
* test manual
Manual test adjustments (still working on player motion controller from client side)
* manual test
Adjustments for the teleporting sample/manual test.
Still working on the new player cube motion model.
* test manual
Improved motion model (still could use some more work for client to server side).
Now packing data sent from client to host/server.
Added UI text that displays whether the instance is a server, host, or client.
* update
removing debug code
* fix
This fixes the last issues with teleporting and the updated player motion model.
* fix
Cleaning up how we handle transitioning to and from global and local space.
Minor adjustment to the validation test to assure the range of error being tested on the client side is the same as the delta position threshold range.
* update
Removing the NetworkTransformState Position, Rotation, and Scale since we are only sending the values that changed (i.e. if the x-axis of position was the only thing that was set and NetworkTransformState.Position was used, then the Y and Z axial values would be invalid).
* fix
removing code block no longer needed.
* style
removing a comment that was no longer needed.
* update
applying suggested changes
* update
replacing the GetReplicatedNetworkState() method with a getter ReplicatedNetworkState property.
* update
This is a new approach:
- Make in-between state updates additive
- Clear our state's Bitset value and prepare to capture any deltas for the next network tick period.
* update
Realized since we are back to additive (per network tick), we can now remove the non-authoritative interpolation work around for not having all values that changed within the associated NetworkTransformState's network tick period.
* update
Disposing the NetworkVariables when the NetworkTransform is destroyed.
* update
Suggestion updates and comment fixes.
* style
adding Sam's comment.
* style
updated comment to include what we are preserving.
* update
Removing the ApplyTransformValues and SetTransformValues as they are no longer needed.
Also, removing the associated properties.
* Test Manual
Updates to manual test related assets and scripts.
Removed the "make a pooled object invisible to hide the teleport interpolation issue" hack that would disable the render mesh when despawned and enable it shortly after it is spawned.
Increased tick rate to 32 in the additive scene loading test.
Fixing white space issues.
* update
Removing the unused serverTime addition as well.
* update
Renamed ApplyInterpolatedNetworkStateToTransform to ApplyAuthoritativeState.
(It didn't make sense if interpolation is disabled)
* tests update
This includes an updated NetworkTransformTests that tests both authority types while running in Server and Host modes.
This includes some updates to naming for easier identification of what each test does (in test runner and in code).
* Update
Minor adjustment where we don't need to send a local properties over the stack via parameters.
* test
Added interpolate enable/disable values to all tests.
Now, all NetworkTranaformTests are done with interpolation enabled and disabled.
* fix and update
Fixed another issue that was exposed while cleaning up the code base.
Was able to remove even more of the code added previously.
Some clean up as well as making one additional method private as opposed to protected to prevent us from having to release a minor version vs patch.
Also, ApplyTransformToNetworkState, and ApplyTransformToNetworkStateWithInfo only return if the state is dirty (the rest can be determined from within the state itself).
ApplyLocalNetworkState, used for integration tests, now just returns the NetworkTransformState.
* fix
This fixes the issue with the memory leak message in the editor NetworkTimeTests (very odd this fixed the issue).
* test manual
Switched over to an owner authoritative NetworkTransform that also includes the playermovement.
Adjusted the PlayerCube NetworkPrefab and minor adjustment to the CollideTeleporter.
* update
updating the changelog
* fix
Found a minor logic issue in ApplyTransformToNetworkStateWithInfo where the state dirty flag could be reset before end of the current network tick. This could result in state being carried forward into the next network tick. This resolves that issue.
* update
Minor adjustment to how we handle applying a rotation measurement on the non-authoritative side.
Removed a property not being used outside of a single method and added additional comments to the PlayerMovement component.
* update
This update includes the final changes required in order to support the previous NetworkTransform model where it was always server authoritative and client owners could direct/apply state via internal RPCs. This also includes the ability for a server to apply/dictate state when running in client owner authority mode.
This includes updates to the NetworkTransform tests that validate all of these updates and increase the amount of coverage for NetworkTransform.
* style
moving new private m_ClientRpcParams and m_ClientIds up to the rest of the property declarations.
Adjusting comment
* test manual
Minor adjustments for the random player movers.
Applying the server authoritative player prefab back to be the default for the additive scene sample (this makes it easier to compare to main branch).
* style
removing a no longer needed comment.
adding note about future clean up for NetworkTransform.
* style
fixed spelling issue
* style
removing left over comment and spelling
* style
removing legacy/unused namespaces
* update
realized our CommitLocallyAndReplicate method was serving no purpose at this point.
added the assignment of NetworkTransformState to the ReplicatedNetworkState within TryCommit and removed CommitLocallyAndReplicate.
* update
removing legacy check for TryCommitTransformToServer that is no longer needed.
* update
removing m_Transform (no purpose for it)
Fixing minor grammar issue with a comment
* test manual update
removing additional IsOwner check.
* revert
reverting the changes I made to the editor test NetworkTimeTests as I just had Yamato crash again in a different area in NetworkTimeTests with the same memory leak error.
* style
replacing LF/CR
* Style
Improving comments1 parent 7b6bcc6 commit 28109b4
File tree
28 files changed
+4712
-764
lines changed- com.unity.netcode.gameobjects
- Components
- Tests/Runtime
- NetworkTransform
- testproject
- Assets
- Prefabs
- References/Scene
- Samples
- Teleport
- Scripts
- Tests/Manual
- SceneTransitioningAdditive
- Scripts
- ProjectSettings
28 files changed
+4712
-764
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
Lines changed: 447 additions & 264 deletions
Large diffs are not rendered by default.
Lines changed: 439 additions & 149 deletions
Large diffs are not rendered by default.
Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
27 | | - | |
| 25 | + | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| |||
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
68 | | - | |
| 66 | + | |
| 67 | + | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | | - | |
89 | | - | |
90 | 87 | | |
91 | 88 | | |
92 | 89 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| 267 | + | |
265 | 268 | | |
266 | 269 | | |
267 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
130 | | - | |
131 | | - | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
| 134 | + | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| |||
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
141 | | - | |
| 143 | + | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| |||
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
194 | | - | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| |||
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
209 | | - | |
| 211 | + | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
216 | | - | |
217 | | - | |
| 218 | + | |
| 219 | + | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| |||
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
248 | | - | |
249 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
250 | 266 | | |
251 | 267 | | |
252 | 268 | | |
| |||
271 | 287 | | |
272 | 288 | | |
273 | 289 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 290 | + | |
302 | 291 | | |
303 | 292 | | |
304 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2523 | 2523 | | |
2524 | 2524 | | |
2525 | 2525 | | |
2526 | | - | |
| 2526 | + | |
2527 | 2527 | | |
| 2528 | + | |
2528 | 2529 | | |
2529 | 2530 | | |
2530 | 2531 | | |
| |||
0 commit comments