<- Back to projects
ID: 5 // STATUS: COMPLETED

Browser Flight Simulator

Physics-accurate Cessna 172 with live multiplayer, running in WebAssembly

01. Live Demo

Click inside the frame to capture input. Controls: Arrow keys: pitch/roll  |  A/D: rudder  |  =/-: throttle  |  I: engine starter  |  F3: debug panel  |  F: camera

02. System Overview

A full aerodynamic simulation of a Cessna 172, ported from an academic flight model (Khan & Nahon 2015) and running entirely in the browser via WebAssembly, with live multiplayer. Built on Bevy's ECS architecture, the simulator models each control surface independently, generates an infinite procedural world with biome-aware terrain and streamed LOD chunks, and syncs players in real time through a Rust server built on Tokio and Axum.

03. Engineering Challenges

Obstacle_01

Implementing a per-surface aerodynamic model with ground effect, servo lag, and a full engine state machine in a real-time ECS architecture

Obstacle_02

Designing a client-authoritative netcode model over WebSocket, since browsers can't open raw TCP/UDP sockets from WASM, and smoothing remote players through jitter with a delayed interpolation buffer instead of assuming fixed-interval delivery

Obstacle_03

Streaming infinite procedural terrain on the WASM main thread without stalls: rate-limited chunk generation and async mesh baking on AsyncComputeTaskPool

Obstacle_04

Multiplexing multiple concurrent game worlds in a single server process, with a lightweight directory service for server discovery and hosting

04. System Outcomes

  • Shipped a client-authoritative multiplayer system with sub-200ms perceived latency for remote aircraft on a public deployment
  • Built a Rust server (Tokio + Axum + WebSocket) that multiplexes many concurrent worlds in one process, keyed by server ID, with automatic idle-world cleanup
  • Kept the server nearly stateless by making world generation fully deterministic from a seed, eliminating heightmap network traffic entirely
  • Achieved stable fixed-timestep physics with smooth visual interpolation in a WASM environment