LogoLogo
⚠️ Outdated documentationGo to LatestHomeAPI
SDK 0.7.4
SDK 0.7.4
  • Welcome
  • Overview
    • What is coherence?
    • How does coherence work?
    • Features and Roadmap
    • Rooms and Worlds
    • Requirements
  • Get Started
    • Install coherence
    • Scene setup
    • Prefab setup
    • Build and run
    • Baking and code generation
    • Create a free account
    • Deploy replication server
    • Share builds
  • Authority and communication
    • How authority works
    • Authority transfer
    • Commands / Messages
    • Client messages
    • Server-side and input queues
    • Input prediction and rollback
    • Animations
  • Persistence
    • Overview
    • Configuring persistence
    • Storage
    • Example – A global counter
  • Optimization
    • Overview
    • Simulation frequency
    • Areas of interest
    • World size
    • Level of detail
    • Interpolation
    • Extrapolation
  • Connected entities
    • Overview
    • Entity references
    • Parent-child relationships
    • CoherenceNode
  • Simulators
    • Overview
    • Client vs. simulator logic
    • Build and deploy
    • Simulator load balancing
    • Room Simulators
    • World Simulators
    • Simulator Slugs
    • Testing Simulators Locally
  • Tutorial project
    • Get the Tutorial Project
    • Start Tutorial
      • 1. Transforms
      • 2. Physics
      • 3. Persistence
      • 4. Animation and Variables
      • 5. AI Navigation
      • 6. Network Commands
      • 7. Team based
      • 8. Connected Entities
  • Game Services
    • Game account
    • Key-value store
    • Matchmaking
  • Developer Portal
    • Overview
    • Dashboard
    • Enabling Game Services
    • Configure Rooms
    • Manage Worlds
  • API reference
    • Network SDK
      • CoherenceSync
      • MonoBridge
      • LiveQuery
      • Archetype
      • Sample UI
      • Settings Window
      • Custom Bindings (Advanced)
      • PlayResolver
      • Rooms
      • Worlds
    • Cloud API
      • API tokens and keys
      • Game account
      • Key-value store
      • Matchmaking
    • Replication Server
    • Simulation Server
  • Schema reference
    • Overview
    • Specification
    • Field Settings
    • Archetypes and LOD-ing
  • Resources
    • Downloads
    • SDK Update Guide
    • Video Tutorials
    • Glossary
    • CLI Utilities
    • Simulator CLI arguments
    • Helper Scripts
    • Troubleshooting
  • Community
    • Discord
  • Additional information
    • Pricing
    • SLA
    • Unreal Engine support
    • WebGL
    • Peer-to-Peer (P2P)
    • Known Issues
    • Changelog
Powered by GitBook
On this page
  • Overview
  • Binding Interpolation Settings

Was this helpful?

Export as PDF
  1. Optimization

Interpolation

Last updated 3 years ago

Was this helpful?

Overview

Depending on the settings in our project, data may not always arrive at a smooth 60 frames per second through the network. This is completely okay, but in order to make state changes (e.g. movement, rotation) appear smooth on the client, we use interpolation.

Interpolation is a type of estimation, a method of constructing new data points within the range of a discrete set of known data points.

The way interpolation works in coherence is that we wait for three data points and then start smoothing the subsequent values according to the interpolation parameters defined in the interpolation settings provided.

Binding Interpolation Settings

On the Select and Optimize windows, every binding which has an interpolable type will shows a interpolation settings object picker next to it.

Currently supported interpolable types are:

  • int

  • float

  • Vector2

  • Vector3

  • Quaternion

coherence provides built-in interpolation settings for position and rotation, but you are free to create your own and use them instead.

You can also create an interpolation settings asset: Assets > Create > coherence > Interpolation Settings

There, you have a few settings you can tweak:

  • Curve Type: the type of interpolation used

  • Elasticity: seconds to remain behind the current interpolation point, applied to smoothdamp function or slerp

  • Max Distance: maximum distance between data points before the component "teleports" to the next value without smoothing.

  • Latency

    • Manual: seconds to stay behind the sample data.

    • Auto: targetInterpolation = autoLatencyFactor * packetDeltaTime

      • -1 disables auto latency.

  • Overshooting

    • Max: how far into dead reckoning we can venture when the time fraction exceeds 100%.

    • Retraction: how fast to pull back to 100% if we overshoot the allowed dead reckoning maximum in seconds

Interpolation works both in baked and reflection modes. You can change these settings at runtime via the Select window (editor) or accessing the binding and changing the interpolation settings yourself:

if (coherenceSync.TryGetBinding(typeof(Transform), "position", out IBinding binding)
{
    // change your interpolation settings at runtime
    binding.InterpolationSettings = ...
}