Skip to content

Conversation

SamuelBellomo
Copy link
Contributor

@SamuelBellomo SamuelBellomo commented Sep 17, 2021

Adds the ability to bypass interpolation when resetting a transform's position.
This is useful for when a character dies and respawns at their spawn for example. In this case, we don't want to interpolate to spawn, we just want the character to "be" at the spawn, without interpolation.

This is called by the authority, it sets the "is teleporting" bit, indicating to clients that this new state should not be interpolated.
no additional data should be taken by this, since it's part of the m_Bitset ushort bit field

Depends on #1177

…nsform

* develop:
  test: Perf tests part 3. Adding ExecuteStepInContext for better test readability (#924)
  test: Perf tests part 2. Adding Test Coordinator and base test class (#923)
  fix: (MLAPI.Serialization) 'specified cast is not valid.' on NetworkW… (#951)
  test: Perf tests part 1. Basis for multiprocess tests process orchestration.  (#922)
  feat: network animator Trigger parameter support (#872)
…nsform

* develop:
  feat: snapshot. Adding RTT computation API. (#963)
  feat: snapshot. Milestone 1b. Testproject "manual test" "scene transitioning" working with snapshot. Disabled by default. (#862)
  test: multiprocess tests part 6: fixing issues runnings all tests together (#957)
  docs: Perf tests part 5. Adding documentation and instructions (#952)
  test: Perf tests part 4. Adding example of performance test with spawning x network objects at once (#925)
  test: Correctly teardown OnNetworkSpawn/Despawn tests.
…nsform

* develop:
  feat: pack NetworkTransform into one state variable, prevent sync popping (MTT-818) (#964)
  feat!: Network Time (RFC #14) (#845)
  test: small fix to ManualNetworkVariableTest.cs, exposed during anoth… (#968)

# Conflicts:
#	com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs
…nsform

* develop: (32 commits)
  refactor: calling networkShow(NetworkObject) code in networkshow(List<NetworkObject>) (#1028)
  feat: snapshot. MTT-685 MTT-822 (#1021)
  test: adding a multi-instance test checking NetworkShow and NetworkHide on lists of objects (#1036)
  fix: corrected NetworkVariable WriteField/WriteDelta/ReadField/ReadDelta dropping the last byte if unaligned. (#1008)
  chore: run standards check over solution files (#1027)
  chore: replace MLAPI with Netcode in Markdown files (#1025)
  fix!: added plainly-callable Add() method to NetworkSet [MTT-1005] (#1022)
  fix: fixing incorrect merge done as part of commit 85842ee (#1023)
  chore: cleanup/upgrade serialized scenes (#1020)
  chore: replace MLAPI with Netcode in C# source files (#1019)
  test: add network collections, struct and class tests MTT-936 (#1000)
  test: add buildtests to test build pipeline on target platforms (#1018)
  chore: rename MLAPI types to Netcode (#1017)
  chore!: rename asmdefs, change top-level namespaces (#1015)
  Replacing community NetworkManagerHUD with a simpler implementation (#993)
  test: network prefab pools and INetworkPrefabInstanceHandler (#1004)
  fix: do not expose Runtime internals to TestProject.ManualTests asmdef (#1014)
  refactor: snapshot. merge preparation. Removing old acks, removing unused varia… (#1013)
  chore!: per-asmdef namespaces instead of per-folder (#1009)
  feat: snapshot. ground work, preparing depedencies. No impact on code behaviour (#1012)
  ...

# Conflicts:
#	com.unity.multiplayer.mlapi/Prototyping/NetworkTransform.cs
#	com.unity.multiplayer.mlapi/Runtime/Messaging/InternalMessageHandler.cs
@LukeStampfli
Copy link
Contributor

LukeStampfli commented Sep 18, 2021

Code looks fine. I'm personally not a huge fan of having this as part of the state but I can see why we are doing it because it's flexible.
An alternate way which in 99% of cases works fine is to use interpolation in all cases unless the distance between the two interpolation points is larger than a threshold and in that case teleport.

Teleportation here could be needed for small jumps too.
Also, this doesn't add bandwidth. We're already sending a 16 bits bitfield, of which 4 or 5 weren't used. I just used one, the amount of bandwidth used by this PR is the same as before.

Yeah I want us to send 12 bits using a bitserializer and not waste 3-4 bits long term. Because this adds up for every transform.

mattwalsh-unity and others added 9 commits September 18, 2021 18:14
…eton reference for this, since multiinstance tests don't like them :(
…transform-teleport

* sam/feature/client-network-transform:
  fixing issue with tests where we had tickrate set to 0. Removed singleton reference for this, since multiinstance tests don't like them :(
  delegate to allow server to override client changes
  work on setDelta
  feat: NetworkAnimator and ClientNetworkAnimator (#1191)

# Conflicts:
#	com.unity.netcode.gameobjects/Components/NetworkTransform.cs
…ty-Technologies/com.unity.multiplayer.mlapi into sam/feature/client-network-transform

* 'sam/feature/client-network-transform' of github.com:Unity-Technologies/com.unity.multiplayer.mlapi:
  docs: author changelog (1st iteration) (#1087)
…transform-teleport

* sam/feature/client-network-transform:
  removing delta
  docs: author changelog (1st iteration) (#1087)
Base automatically changed from sam/feature/client-network-transform to develop September 20, 2021 15:57
* develop:
  feat: ClientNetworkTransform (#1177)

# Conflicts:
#	com.unity.netcode.gameobjects/Components/NetworkTransform.cs
@mattwalsh-unity mattwalsh-unity enabled auto-merge (squash) September 20, 2021 16:33
@mattwalsh-unity mattwalsh-unity enabled auto-merge (squash) September 20, 2021 16:39
mattwalsh-unity and others added 4 commits September 20, 2021 09:52
…hnologies/com.unity.multiplayer.mlapi into sam/feature/transform-teleport

* 'sam/feature/transform-teleport' of github.com:Unity-Technologies/com.unity.multiplayer.mlapi:
  revert: ClientNetworkAnimator (#1191) (#1203)
@mattwalsh-unity mattwalsh-unity merged commit 92fc3e6 into develop Sep 20, 2021
@mattwalsh-unity mattwalsh-unity deleted the sam/feature/transform-teleport branch September 20, 2021 17:49
mollstam pushed a commit to Keepsake-Games/com.unity.netcode.gameobjects that referenced this pull request Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants