How do I stop my rider from flying off into the sky/trees/water?

Often, you'll see a rider flying straight into the trees, over the water, rapidly making circles on the course or just disappearing altogether during your rides. 

Zwift lagging client

The reasons for this can vary greatly depending on a number of factors, and Zwift has put some code in place in the latest releases to try to mitigate the problem, but for many it still occurs. 

As with many online games, tracking "location" is crucially important. You're either close enough for your sword to strike the dragon, or you're not. You either jump your car just before the edge of the cliff, or you speed over the edge and crash at the bottom.

Zwift is no different, and there's a constant need to communicate your location and predicted path back to the servers so it can update your location and plot your next set of turns or movements. 

If you have lag of any sort during your game, you will be more susceptible to having this happen to you. Let's break it into smaller pieces:

Zwift itself actually sends very little data back upstream, mostly because the actual visual rendering is handled locally by your Zwift client app so you can send small amounts of data and just handle the interpretation of the data client side.

It's similar to being told to draw a triangle over the phone rather than having to actually send a picture of a triangle through the mail to the other person. Also, many online games use data interpolation along with other techniques to hide the effects of delay or lag to the end user.

Interpolation is when you have a dataset and you generate new data points that fit in with the existing data, such as an acceleration of speed on the Zwift course. You use this in Zwift to make things look smooth because in reality the Internet isn't.

There's always delay (lag) when dealing with online gaming because issues like packet loss and data arriving out of order (packet 2 arrives before packet 1) can impact your overall experience.

If you tried to code a 1 to 1 experience then everyone would be teleporting around the screen all the time because by the time one movement confirmation is received it's already out of date and you're really dealing with past information.

You also need interpolation because games don't update instantly the game logic is only updated in certain certain time steps (frame rate) and data is only sent out over the Internet in certain time steps (tickrate).

For example, say in the previous update we know that a rider was at the orgin (0, 0, 0) but in the next update that same rider is reported as being at (0, 10, 0).

We dont want to just move that player to (0, 10, 0) because it's gonna look like he teleported so we use interpolation to virtually pedal him smoothly to this new location.

The end user sees something more like this: (0, 0, 0) to (0, 2, 0) to (0, 4, 0) until finally he arrives at (0, 10, 0) and now it actually looks like the rider pedaled more naturally to that location.

There are other code-level techniques as well that can help, for example, "Straight Lag Compensation". Interpolation makes things look smooth but they also need to feel smooth so you have to code the game so that it takes into account the lag that is happening and still provides as close to a 1 to 1 experience as possible.

Many online games use "Movement Prediction" to try to hide lag happening upstream. You'll notice this when you're riding and yourself or other players are lagging or disconnects and their rider keeps pedaling off into a wall or the trees. Sound familiar? That's generally the symptom of why that happens.

Some other games use "Rollback Techniques" as well that can work well in smaller use cases. In Zwift, this will look like a rider who was originally in front of you, now transporting behind you, or a rider that is making very tight circles on the course in front of you (obviously not using the 'turn around' option in Zwift).

If push the rollback algorithm too far, you will get "Snap-back" or "Rubberband" issues that make the game a lot more erratic feeling to the client. 

So make sure your connection is solid, and that other things aren't happening at the same time as you're playing that could impact the steady stream of bandwidth to your computer. Some of these could include: 

  • iCloud Synchronization on your Mac
  • Backup jobs running on your PC/Windows machine
  • Scheduled anti-virus scans running in the background
  • Background Windows or App Store updates being downloaded to your machine
  • Windows creating an automatic "Restore Point"
  • Windows Search Indexing
  • ...or any other processes which will impact both the CPU and network of your machine

Check your connection with any number of the tools available online, such as:

Good luck!