Project SkySim, Part 2: One Physics Core, Three Ways to Run It
I argued that a drone simulator should be easy to open as a URL, without becoming a toy. This is the architectural decision that makes that possible.
Project SkySim, a physics-based drone simulation, is designed to run in a browser tab without any installation required, while also providing genuine aerodynamics and handing the vehicle over to actual flight-controller firmware. To achieve this, SkySim separates the physics core from the rendering, allowing it to run on various platforms seamlessly.
The physics core, written in C++20, handles all the essential aspects of the simulation, including rigid-body state, forces and torques, rotors, atmosphere, ground effect, vortex ring state, turbulence, and battery management. It does not have any knowledge of rendering, cameras, GPUs, game engines, or browsers. Its sole purpose is to take a state and control inputs, advance the simulation time, and return a new state.
SkySim offers three different ways to run this physics core, each tailored to a specific audience:
1. Native desktop through Godot 4: This is the most traditional simulator experience, available on Windows, Linux, and macOS, including Apple Silicon. The physics core is integrated into Godot 4 as a GDExtension, which runs in the C++ hot path without any scripting-language interference. Godot 4 handles rendering, scene management, input, and the window, while the C++ core focuses solely on flying the aircraft.
2. Browser through WebAssembly: SkySim can also be accessed through a web browser using WebAssembly (WASM) compiled from the same C++ core. The simulation runs entirely client-side, with no server involved. Users can fly the drone using the keyboard or JavaScript control functions. While the in-browser experience serves as a preview, it is not meant for heavy machine learning training or full firmware software-in-the-loop testing.
These demanding tasks are handled by native agents, keeping the browser tier focused on interactive flight and lighter classical control.
3. Headless, for testing and continuous integration (CI): The third host is the most critical one for testing and CI purposes. The physics core can run as a plain native program without any GPU or game engine, enabling rigorous testing of the simulation. This decoupled, native form allows for assertive validation of hover behavior, energy management, maneuver accuracy, and regression detection before the core is ever trusted in a browser. This host ensures that the physics core remains reliable and consistent in various environments.
By separating the physics core from the rendering and rendering platforms, SkySim achieves the seemingly contradictory goal of being both accessible and serious, offering a rich desktop experience, an interactive browser-based simulation, and a robust testing environment—all powered by the same underlying physics core.
Written by urgent.news from HackerNoon's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.