Commit b3722b1
authored
fix: new interpolators delaying between stopping and starting (#3413)
This fixes the issue where a server authority instance would lag behind
when using the new interpolators. This was especially visible when the
moving body completely stopped, all state updates were processed, and
then shortly later it began to move again there would be a delay between
the 1st state update and the rest of the pending state updates.
This also fixes an issue where if the frame rate takes longer than the
tick frequency authority instances could invoke the same check for state
changes more than once in the same frame. This is not needed since
changes to the transform are frame driven and the check should only be
performed once per new tick(s).
<!-- Add short version of the JIRA ticket to the PR title (e.g. "feat:
new shiny feature [MTT-123]") -->
## Changelog
- Fixed: Issue where the authority instance of `NetworkTransform` could
check for state updates more than one time in a frame if the frame rate
is slower than the tick frequency.
- Fixed: Issue where the new interpolator types were blocking after the
first consumption of a sequence of buffered state updates.
## Testing and Documentation
- Includes the integration test: `InterpolationStopAndStartMotionTest`.
- No documentation changes or additions were necessary.
<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->
## Backport
No backport is needed for this update since it pertains to 2.x only
features.1 parent 9a52e11 commit b3722b1
File tree
6 files changed
+295
-28
lines changed- com.unity.netcode.gameobjects
- Runtime
- Components
- Interpolator
- Core
- Tests/Runtime/NetworkTransform
6 files changed
+295
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
Lines changed: 5 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| |||
292 | 294 | | |
293 | 295 | | |
294 | 296 | | |
295 | | - | |
| 297 | + | |
296 | 298 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 299 | + | |
302 | 300 | | |
303 | 301 | | |
304 | 302 | | |
| |||
314 | 312 | | |
315 | 313 | | |
316 | 314 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | 315 | | |
322 | 316 | | |
323 | 317 | | |
324 | | - | |
| 318 | + | |
325 | 319 | | |
326 | 320 | | |
327 | 321 | | |
| |||
Lines changed: 38 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
938 | 944 | | |
939 | 945 | | |
940 | 946 | | |
| |||
1878 | 1884 | | |
1879 | 1885 | | |
1880 | 1886 | | |
| 1887 | + | |
| 1888 | + | |
1881 | 1889 | | |
1882 | 1890 | | |
1883 | 1891 | | |
| |||
2011 | 2019 | | |
2012 | 2020 | | |
2013 | 2021 | | |
2014 | | - | |
| 2022 | + | |
2015 | 2023 | | |
2016 | 2024 | | |
2017 | 2025 | | |
| |||
2179 | 2187 | | |
2180 | 2188 | | |
2181 | 2189 | | |
2182 | | - | |
| 2190 | + | |
2183 | 2191 | | |
2184 | 2192 | | |
2185 | 2193 | | |
| |||
2225 | 2233 | | |
2226 | 2234 | | |
2227 | 2235 | | |
2228 | | - | |
| 2236 | + | |
2229 | 2237 | | |
2230 | 2238 | | |
2231 | 2239 | | |
| |||
2409 | 2417 | | |
2410 | 2418 | | |
2411 | 2419 | | |
2412 | | - | |
| 2420 | + | |
2413 | 2421 | | |
2414 | 2422 | | |
2415 | 2423 | | |
| |||
2440 | 2448 | | |
2441 | 2449 | | |
2442 | 2450 | | |
2443 | | - | |
| 2451 | + | |
2444 | 2452 | | |
2445 | 2453 | | |
2446 | 2454 | | |
| |||
4047 | 4055 | | |
4048 | 4056 | | |
4049 | 4057 | | |
4050 | | - | |
4051 | | - | |
| 4058 | + | |
| 4059 | + | |
| 4060 | + | |
| 4061 | + | |
| 4062 | + | |
4052 | 4063 | | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
4053 | 4069 | | |
4054 | 4070 | | |
4055 | 4071 | | |
4056 | 4072 | | |
4057 | 4073 | | |
4058 | | - | |
| 4074 | + | |
| 4075 | + | |
4059 | 4076 | | |
4060 | 4077 | | |
4061 | 4078 | | |
| |||
4501 | 4518 | | |
4502 | 4519 | | |
4503 | 4520 | | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
| 4525 | + | |
| 4526 | + | |
| 4527 | + | |
| 4528 | + | |
| 4529 | + | |
4504 | 4530 | | |
4505 | 4531 | | |
4506 | 4532 | | |
| |||
4562 | 4588 | | |
4563 | 4589 | | |
4564 | 4590 | | |
4565 | | - | |
| 4591 | + | |
4566 | 4592 | | |
4567 | | - | |
4568 | 4593 | | |
4569 | 4594 | | |
4570 | 4595 | | |
| |||
4576 | 4601 | | |
4577 | 4602 | | |
4578 | 4603 | | |
4579 | | - | |
4580 | | - | |
4581 | 4604 | | |
4582 | 4605 | | |
4583 | 4606 | | |
| |||
4586 | 4609 | | |
4587 | 4610 | | |
4588 | 4611 | | |
4589 | | - | |
| 4612 | + | |
4590 | 4613 | | |
4591 | 4614 | | |
4592 | | - | |
| 4615 | + | |
4593 | 4616 | | |
4594 | 4617 | | |
4595 | 4618 | | |
| |||
4600 | 4623 | | |
4601 | 4624 | | |
4602 | 4625 | | |
4603 | | - | |
| 4626 | + | |
4604 | 4627 | | |
4605 | 4628 | | |
4606 | 4629 | | |
4607 | 4630 | | |
4608 | | - | |
4609 | | - | |
4610 | 4631 | | |
4611 | 4632 | | |
4612 | 4633 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
386 | 387 | | |
387 | 388 | | |
388 | 389 | | |
| 390 | + | |
389 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
390 | 403 | | |
391 | 404 | | |
392 | 405 | | |
| |||
0 commit comments