Slippage (Latency)
Sometimes due to network latency, inputs arrive late. Under Easel's rollback netcode multiplayer model, this can lead to an unusual situation where a sound was scheduled to start playing 40 milliseconds ago, but we didn't know about it until now. Since time travel has not been invented yet, there are a few possible courses of action:
- Skip the first 40 milliseconds of the sound. The remainder of the sound plays precisely on time, synchronized with any visuals. If the sound has important audio cues at the beginning, for example a gunshot sound that starts with a "bang", they won't be heard.
- Late but in Full: Play the sound in its entirety, starting from now. The sound would play 40 milliseconds late. A "bang" sound would lag 40 milliseconds behind the visuals of the gun firing, which might be jarring. However, for a less time-critical sound like the hum of a spaceship engine, the lateness might not be noticeable, and instead this might feel more natural.
- Mix: A mix of the two: we can choose any amount of slippage between 0 and 40 milliseconds to get the effect we want.
The slip parameter of the Hear and Sing functions
lets a sound slip behind its scheduled start time,
letting you choose between skipping the beginning of the sound, or playing it late, or a mix of the two.
The default value of slip is 0.025s,
meaning the sound can start up to 25 milliseconds late and still be played in its entirety.
This value is designed to be a good compromise for most sounds,
but you can configure this value in the [audio] section of easel.toml: see Audio Configuration.