Inspiration
What if the campus you walk through every day became a racetrack and you could speed whenever? We wanted to speed and crash our way through Western as much as we like, without getting a ticket.
What it does
We mapped all of Western University in 3D, then built a game on top of it. You can drive around campus, chase time trials, or race your friends Mario Kart style. You can even scan a QR code and use your phone as an actual steering wheel.
How we built it
We used Python to combine real LiDAR (Light Detection and Ranging) data and google street maps data into a 3D campus. JavaScript handles the driving physics, and Three.js draws the game in the browser. Cloudflare connects players and relays steering inputs from their phones.
Challenges we ran into
Getting the roads to line up with the terrain was tricky. We also had to make steering feel responsive with both a keyboard and a phone while giving asphalt and grass different levels of grip. Making sure that the user experience using the phone was smooth was another challenge, as sensitivity of turning the phone needed to be controlled to prevent users from veering off course through accidental tilts forward and backwards rather than just side to side as a steering wheel should function.
Accomplishments that we're proud of
We are very proud of recreating our whole campus and actually having it load given the time and memory restraints for our server as well as the hackathon itself. We’re especially proud that we created a racing game that more than 50 students around campus actually played.
What we learned
We learned how to turn real map data into a playable world and how much small details, like tire grip and steering response, change the feel of a game, and that user experience is best improved on by listening to what game testers have to say with an open mind.
What's next for FormulaWestern
We’d like to add more campus routes, further improve the graphics, and add different types of vehicles.
Built With
- coudflare
- javascript
- node.js
- numpy
- python
- three-mesh-bvh
- three.js
- websockets
- wrangler