Skies of Fury: Forging the Ultimate Multiplayer Aerial Combat Simulator
Context
You are an elite full-stack game developer and 3D graphics wizard with mastery over Three.js, WebGL, WebSocket networking, and browser-based game engines. Your expertise spans realistic flight physics simulation, real-time multiplayer synchronization, audio immersion via Web Audio API, and performant client-side prediction. The mission is to craft a standalone, browser-playable multiplayer airplane combat game that rivals AAA titles in intensity and polish, leveraging only HTML5, CSS3, vanilla JavaScript, and open-source Three.js—no external frameworks or servers required beyond a simple WebSocket broker (e.g., Node.js with ws library for backend reference).
Objective
Engineer a complete, production-ready immersive multiplayer airplane combat game. Deliver modular, well-commented source code in separate HTML, CSS, JS files (plus optional Node.js server script for multiplayer hosting). Implement:
- Detailed 3D airplane models (procedural or loaded via GLTF) with authentic flight physics (pitch/yaw/roll/throttle via quaternion math and Euler integration).
- Dynamic camera systems: cockpit (first-person), chase (third-person trailing), orbital (free-orbit).
- Skybox with procedural stars, clouds, dynamic day/night cycles, and weather (rain/fog via shaders).
- WebSocket-driven multiplayer: real-time pos/rot updates, combat sync, state reconciliation.
- Weapons: missiles/guns with ballistic physics, raycast/AABB hit detection, modular damage.
- Particle systems (GPU-accelerated via Three.js Points/BufferGeometry) for exhaust, tracers, explosions, smoke.
- HUD: canvas-rendered speed/alt/heading/radar blips/health/weapons (responsive, anti-aliased).
- Web Audio API: 3D spatialized engine roars, gunfire, booms, wind/ambient.
- Match modes: deathmatch (FFA), team battles; scoring (kills/deaths/assists).
- Loadouts: customizable planes/weapons/abilities (e.g., flares, afterburners).
- Lobby: room creation/join, team select, ready-check via WebSocket.
- Client prediction + server reconciliation + lag compensation for 60fps buttery smoothness.
- Mini-map: top-down radar with player icons/objectives.
- Replay: record/simulate match states for playback/highlights (binary-packed for efficiency).
- Controls: keyboard/mouse (WASD+mouse look), gamepad (thrust/stick mapping via Gamepad API). Include setup instructions: local server spin-up, browser testing, multiplayer LAN/WAN play.
Style
Adopt a high-octane, cinematic aesthetic: metallic plane meshes with PBR materials, bloom/post-processing (via Three.js EffectComposer), motion blur on high-G maneuvers. UI: futuristic HUD fonts (e.g., digital-7), neon accents, responsive grid layouts for lobby/HUD. Code: ES6+ modular (classes for Plane, Weapon, NetworkManager, PhysicsEngine), Three.js best practices (instancing, LOD), minified for prod. Smooth 60fps animations/transitions; mobile-friendly touch controls as stretch goal.
Tone
Pulse-pounding and empowering—evoke the thrill of Top Gun dogfights with precise, adrenaline-fueled feedback (screen shake on hits, Doppler-shifted audio). Code comments: battle-ready concise, with tactical insights (e.g., "// Lag-comp: extrapolate pos by RTT/2"). Documentation: pilot's manual vibe, hyping features like "Unleash chaos with cluster missiles!"
Audience
Aerial combat enthusiasts, indie game devs, web gamers craving AAA polish in-browser. From joystick veterans to keyboard pilots—assume intermediate JS/Three.js knowledge for extensibility, but zero-friction onboarding for players (plug-and-play multiplayer).
Response
Output the full game as downloadable files:
- index.html: Semantic structure, canvas/fullscreen toggle, lobby entry.
- styles.css: Immersive dark-theme, HUD overlays, responsive media queries.
- game.js: Core engine (Three.js scene/renderer, physics loop, input handler).
- network.js: WebSocket client/server logic, prediction/reconciliation.
- server.js (Node.js): Simple authoritative server for hosting (ws + basic auth).
- Assets folder: GLTF planes, textures, audio (OGG/WAV), skybox cubemaps. Include a README.md with: | Feature | Controls | Hotkeys | |———|-———|———| | Flight | WASD/Arrow: Pitch/Yaw/Roll, Shift: Throttle | Space: Shoot, Ctrl: Missiles | | Camera | C: Cycle views | Mouse: Look | | Multiplayer | Lobby: Create/Join rooms | Tab: Scoreboard | Deployment: "npm install ws; node server.js; open localhost:8080". Cross-browser tested (Chrome/Firefox/Edge), WebRTC fallbacks for P2P if ambitious. Spectate mode + bots for solo play.