Gig City

Overview

A fun project about a gig worker's shift. Pick a city, New York (Midtown) or London (Westminster), and a job: drive riders for RideNow in a sedan, or deliver food for DashEats on an e-bike. Requests arrive on your in-game phone; accept one, follow the arrows to the pickup, then to the drop-off, and get rated. The streets, one-way rules, traffic lights and buildings come from real map data, and London drives on the left. RideNow and DashEats are made-up apps.

Main Features

  • Two cities from real map data: Midtown Manhattan, and Westminster with Trafalgar Square and Piccadilly
  • Two jobs: RideNow rides in a sedan, DashEats deliveries on an e-bike
  • An in-game phone: offers with the fare, the pickup and the drop-off, Accept or Decline, and a minimap
  • Ratings: riders lose comfort when you brake hard, turn sharply, crash or run a red light; food cools down and spills
  • Earnings, tips, surge prices and a shift goal
  • A City Guide: drive past a landmark to discover it and read a short fact, 20 places in each city
  • A living city: traffic that follows lanes and lights, about 2,000 people on foot, cafés, joggers in the parks, other gig workers on the road
  • Day, sunset and night, three camera views, and lo-fi music
  • Touch controls on phones: a steering stick, GAS and BRAKE

How the game works

  • Real streets: a script turns an OpenStreetMap download into each city's roads, lanes, one-way rules, traffic signals, buildings and places. One road engine reads any city and can drive on either side.
  • Routes and traffic: the game finds routes with Dijkstra's algorithm; AI cars keep to their lanes, stop at lights, follow the car ahead and wait for people crossing.
  • Fair scoring: each job's time limit allows careful, legal driving to reach 5 stars, red lights included.
  • Tested without a browser: the roads, traffic, jobs and the autopilot use no 3D code, so tests run whole trips in Node in seconds.

Structures

  • 1 folder, no build step
    • the game: index.html, style.css and 14 JavaScript modules in src/
    • each city's data in assets/cities/
    • tools and tests in dev/ (not deployed)

Tech Stack & Libraries

LayerBuilt with
3DThree.js 0.160 (from the jsDelivr CDN) · facades drawn by shaders
GameJavaScript modules · hand-written driving physics, traffic and routing
Map dataOpenStreetMap · Python (build_city.py)
PeopleQuaternius characters and animations (CC0)
SoundWeb Audio API, no sound files
TestsNode scripts · Puppeteer (headless Chrome)

Architecture

Gig City architecture diagram

Solid arrows are calls, and the answer comes back on the same line; dashed arrows are sent on their own.

UI Interfaces

In motion