ferravex
GitHub

Architecture

Ferravex separates simulation, data and platform presentation. Every package depends only on other workspace packages and Rust std. The dependency policy applies to all features and targets. The iteration series records merged improvements and available local validation.

Engine modules

CrateResponsibility
ferravex-mathScalar vectors, matrices, quaternions, colors and bounds
ferravex-ecsGenerational entities and typed component stores
ferravex-coreFixed clock, frame statistics, collision and entity helpers
ferravex-dynamicsShared 2D/3D translational contacts, queries, CCD and character helpers
ferravex-physicsOriginal rotational rigid-body API used by the restored physics games
ferravex-graphicsMesh generation/cooking, clipping, software rasterization and PNG export
ferravex-renderImmediate drawing, procedural meshes, CPU vertex lighting, input, frame scheduling and native/browser presentation ABI
ferravex-playScenes, camera rigs, animation, navigation, steering, particles and UI data
ferravex-netBounded packet/delta/clock/reliable protocols, native UDP and original WebSocket gateway
ferravex-engineFacade over engine modules plus input, audio, assets, replay and profiling
ferravex-fpsAuthoritative shooter simulation, prediction, interpolation and rewind
ferravexPublic convenience facade
ferravex-benchReproducible simulation benchmarks using the same first-party systems

Rendering and hosts

The thirteen restored games/labs use ferravex-render. Immediate primitives and bitmap text become CPU-transformed clip-space triangles; retained meshes keep geometry in GPU buffers and stream transforms, normal matrices and skin palettes. Ordered commands combine both paths, custom material hooks, directional shadows, point lights, vertex AO and instanced effects. The browser binds WebGL2 directly. Native GPU submission is shared by original X11/GLX, Win32/WGL, AppKit/NSOpenGL and UIKit/EAGL hosts. Logical input/UI coordinates are separate from physical framebuffer/readback dimensions. See platform verification for source versus runtime status.

Courtyard retains a separate browser renderer using persistent meshes, instanced objects, Rust visibility tests and a directional shadow map. Browser input, audio and peer sessions use browser APIs. Its native host runs the same simulation and exports a software-rendered frame.

Orbit Breaker runs a 120 Hz arcade simulation and an original Rust RGBA rasterizer. The browser forwards input and presents the framebuffer with Canvas2D. Its native host runs autoplay and exports a PNG. All fifteen examples are listed in examples/catalog.json; the catalog drives local web staging and documentation.

Physics

Two original solvers serve different examples. ferravex-dynamics handles circles/spheres and axis-aligned boxes, translational contact impulses, friction, restitution, sensors, filtered queries, bounded ball CCD and a sphere slide/step/snap helper. It has no angular dynamics and remains the solver used by the older headless examples.

ferravex-physics provides dynamic circles/spheres and oriented boxes with angular impulses, world inertia, clipped box contact manifolds, friction and restitution. Dynamic/fixed/kinematic 2D capsules and 3D cylinders collide with balls. Bodies may own locally transformed primitive parts, with analytical mass centers and full inertia tensors. Fixed, hinge, distance and spring joints share contact solver iterations and connected sleep islands; hinge motors support torque caps and angle limits. The API includes generational handles, removal, sensors, contact start/stop events, layers, current-pose rays and conservative sphere sweeps with at most eight substeps. Sweeps freeze target orientation within a substep and have a forty-iteration bound.

Capsule/cylinder-versus-box contacts, mesh collisions and swept box time-of-impact are unsupported. Consult the crate README for exact limits. This is an original bounded implementation, not production-engine feature parity. Recovery validation must exercise pinball flippers, rolling marbles, stacks and high-speed cannonballs in addition to compile checks.

Netcode

The native server runs a 64 Hz authoritative simulation for up to sixteen players. It owns movement, wall-occluded hitscan, health, ammo, reloads and respawns. Clients predict local input, reconcile/replay unacknowledged inputs and interpolate remote players. Redundant inputs, bounded queues, session checks and reliable event acknowledgements constrain work and recover loss.

Protocol v5 integrates correlated clock probes, client view-tick shot claims, authority rewind, acknowledged snapshot deltas/full recovery and reliable tactical commands/results. Strike's browser client runs the same Rust session as native UDP through a first-party WebSocket gateway. Native UDP/plain WebSocket remain development/LAN transports without accounts, native TLS, congestion control or Internet abuse mitigation. Courtyard retains a separate two-peer WebRTC adapter with explicit offer/answer pairing and browser DTLS/SCTP, with no hosted signaling or STUN/TURN relay. See the networking guide for bounds and setup.

Platform boundary

Hosts own OS/browser events, drawables and lifecycle; Rust owns game futures, simulation, input journals, asset descriptors and mixing. Desktop native hosts drive one shared runner; UIKit schedules it through its scene/display-link callbacks. Suspension releases input and output queues; reconstruction rebuilds GPU caches while preserving CPU ownership. Browser loss/restoration cancels/resumes one render loop without restarting Wasm. Linux/web runtime checks and Windows/macOS cross-checks are distinct from Apple/Windows device validation; see platform status.

Presentation cameras

Shared camera rigs live in ferravex-play, with a current rigid-world obstruction adapter in ferravex-engine::camera. Their bounded state/queries are independent of renderers and simulation clocks. Seven examples now exercise 2D framing, orbit, first-person, follow and chase, including cuts and impact shake.