Jelle Vermandere enjoys cycling, but if it’s not a nice day out, what his he to do? He could play a bike racing game using a traditional joystick and buttons, or even purchase an indoor trainer. Instead, he decided to build his own simulator connected to an actual bike and DIY interface setup.
The scope of the project is really impressive, as he first created the new game in Unity, scanning himself in to act as the player. After a bit of work, he's able to turn the scans into a clean model, and added his bike in using a single photo.
From there, he employed a few tricks to make the bike look realistic in motion as well as an inverse kinematics to control the on-screen player’s body movements. There’s also a system for procedurally generating tracks each time you start a new race, along with competitors that suspiciously resemble Vermandere. The game is playable here on your browser if you want to give it a try.
To round things out, he hooked his bike up as an Arduino-based controller, with window alarm-style magnetic sensors that pick up each rotation of the wheel. A LEGO wheel potentiometer is also attached to the handlebars, allowing Vermandere to steer past his doppelgänger competitors on the way to victory. Code for the game is found on GitHub, and if this type of exploit seems vaguely familiar, you should check out his toilet paper shopping cart sim from last month.