Swim Bike Run
Slowtwitch.com
x
Advanced Search
Logo
Twitter Vimeo Facebook Youtube
Search

# The Birth of Zwift

Dan Empfield Mon May 04 2020

How and when did Zwift start? Zwift’s co-founder and current president, Eric Min, saw an online post by programmer Jon Mayfield who, according to Wikipedia, described a "3D trainer program" he was developing as a hobby project. You can still read Jon’s post, on the Slowtwitch Reader Forum, dated April 14th, 2012, and the user reaction to it: 86 replies, more than 26,000 views.
Below are Jon Mayfield’s words from that post, and a second post in the thread where he answers questions from a few users. The strikingly well-formed images are from Jon’s post back then. What you see in that post was the beginning of an obsessive experience that has enhanced the riding experiences of so many cyclists and triathletes.

“Being in SoCal I don't get to use my trainer that much, but when I do it sucks. Over the last 2 winters I spent a little time writing a 3d program to make training less dull, and I've logged quite a few hours on it over the last 2 winters. I figured it'd be worth showing, since it's kinda neat and I think this crowd would get a kick out of it.
“First, the overview: Its fully ANT+ Compatible (reads heartrate, cadence, powertap), it saves out standard Garmin .FIT files for WKO+/TrainingPeaks/Whatever, if you don't have a powermeter it'll save out a fit file with power by estimating your watts using standard trainer speed->power equations, it runs on MAC or PC, and PC has full 5.1 surround sound support. There are AI racers of various speeds you can try to pass, there are special interval modes (you program in a whole workout, or just ride around the scenery, or both) with voice prompts telling you when to start/stop the interval, and I built a from-scratch PC/MAC joystick for the front wheel to sit on so you can steer around the world. It also has a video playback mode where it plays most non-DRM'd videos but still has the interval prompts and graph overlays, but that is a bit flaky at the moment and its PC only (no MAC video yet).

“When I wrote the first version back in 2010 I had to "crack" the ANT+ packets, which took me a couple weeks....weeks after I finished figuring out what the packets meant, the ANT+ group released full specs to everybody. At that point, I figured there would be all sorts of commercial apps available so I didn't work on this thing almost at all during 2011. I just used it for my workouts, and that was that. Now that it’s April 2012, I'm still pretty shocked there aren't half a dozen things like this commercially available.
“ANT+ data comes through a normal ANT+ usb stick. I haven't messed with the ANT+ stuff in over a year so I couldn't tell you right now the update rates, but I do know that HR packets seemed pretty random, cadence/speed was about once a second (and at slower pedaling speeds repeat packets would be sent with no differences between the previous packet), and PowerTap I simply don't remember. The app has a full built-in command console and ANT+ logs can be enabled, and the whole thing dumps raw data out to a txt file so I could look sometime later if people were really curious. I do smooth the speed data a little, but I'm not totally happy with that. I need to add in the 3s/10s/30s power displays, right now watts is instantaneous. Every test run I've done, I also recorded on a Garmin Edge 500, and once uploaded to Garmin connect both my and Garmin’s fit file pretty much match exactly so I think the data I'm grabbing is "good enough" right now.

“As for graphics chugging, the whole graphics system is configurable. It'll run at 640x480 with no realtime shadowmapping, no antialiasing, etc at 400fps on my machine, or, as in my screenshots, you can crank it up to 1080p with 4x AA and it goes 40fps. All depends on what your PC can do and how much you care about graphics. On PC and MAC, I use OpenGL for graphics. On PC I use XAudio for 5.1 surround sound generation, and on MAC I use OpenAL (which *should* give me 5.1, but I can only get 2ch audio out of it right now. *shrug*).
“There is no more ‘controller’ or custom circuitry for anything ANT+. The joystick I built uses a USB chip that makes it super easy to create a fully MAC/PC compatible joystick, so I went with that. I think it updates at 30hz or so. I doubt I'll want to get into the custom joystick manufacturing biz, and steering is 100% non-essential (it's neat for 'game' type stuff, but for workouts its just not needed) so I may just keep that stuff to myself.

“There is one last party trick this thing does, which will never see the light of day...when I do plug my old obsoleted Arduino microcontroller board in, it has an X-10 chip in it and will control an X-10 dimmer switch anywhere in your house. Plug a fan into that X-10 dimmer, and voila....the fan speeds up and slows down with your speed on the trainer. Full blast is hit around 18mph. Again, this will fry half the fans on the market (the motors don't like the type of dimming the X-10 switch does...it’s really meant for incandescent bulbs), so it's a "me only" kinda thing. Still fun to see it work.

“I should probably turn this thing into a product, but for now, it's just used by me.
“Lemme know what you guys think, and suggestions for things you'd like to see would be interesting to hear too.”
Yes, Jon, I think you should probably turn this thing into a product!

Tweet