A Physics Engine with Incremental Rollback for Multiplayer Games
Easel has developed a custom physics engine that uses incremental rollback, a significant technical achievement for multiplayer game development. This innovation allows for large, dynamic online worlds by only snapshotting and rolling back changed physics states, dramatically improving performance over traditional full-state methods. Hacker News finds this fascinating because it tackles a core technical challenge in game engineering with a clever, performance-focused solution, generating a robust discussion among developers.
The Lowdown
The article introduces Easel's new custom-built physics engine, a significant leap for multiplayer game development. Traditionally, creating large game worlds with rollback netcode was infeasible due to the necessity of snapshotting and rolling back the entire physics state every frame. Easel's innovative solution focuses on incrementally processing only the parts of the world that change, drastically improving performance and enabling creators to build much larger, more dynamic online experiences.
- Incremental Rollback: The core innovation allows the engine to only snapshot and roll back objects that have changed, a major departure from existing off-the-shelf engines. This reduces the processing load by 30-50x for typical scenarios where most objects are static.
- Intelligent "Sleep" System: Bodies are put to sleep instantly when their velocity approaches zero, preventing unnecessary calculations. The system also intelligently handles gravity, ensuring entire stacks of objects remain awake only until they reach true equilibrium.
- Optimized Spatial Indexing: Uses a Bounding Volume Hierarchy (BVH) for broad-phase collision detection, optimized for incremental rebalancing and minimizing rollback. It also leverages "Categories" within the BVH to speed up specific queries.
- Advanced Stepping Mechanics: Addresses the common "bouncy character" problem by integrating non-bouncy stepping directly into the solver. It treats stepping similarly to position correction, preventing lasting ejection velocities that cause unwanted bounce.
- Robust Continuous Collision Detection (CCD): Implements CCD to accurately detect collisions between fast-moving objects, avoiding missed impacts. The article highlights how Easel's approach improves upon Rapier and Box2D by integrating position integration after determining the time of impact.
- Flexible Body Movement: Unlike some physics engines, Easel allows bodies with velocity or turnRate to move even without colliders, catering to common game development needs like moving billboards or purely visual elements.
- Foundation: The engine is built upon the collision detection algorithms of the open-source Parry library.
By intelligently focusing on changed states and implementing sophisticated physics handling, Easel aims to empower game developers to create expansive, low-latency multiplayer games that were previously technically challenging or impossible, opening new possibilities for interactive online experiences.
The Gossip
Game Dev's Grand Gauntlet
Commenters express admiration for the complexity involved in game development, especially when combining player control, multiplayer, and physics. Many relate to the challenges of solving these 'big league' software engineering problems without readily available solutions, underscoring the perceived difficulty and unique demands of the field. The author's post itself highlights the problem they set out to solve: the lack of incremental rollback support in existing physics engines.
Rollback's Refined Rationale
The discussion delves into the core innovation of incremental rollback for physics. Commenters clarify the distinction between snapshotting 'changes' for local CPU optimization during rollback versus delta compression for network bandwidth reduction. There is praise for the author's approach of integrating this complex feature directly into the physics engine, sparing game developers from implementing custom workarounds. An interesting aside notes how rollback concepts could also apply to input fusion with diverse device latencies.
Easel's Engine Elaborations
Users inquired about the practical aspects and capabilities of the Easel engine. Specific questions included deployment options, such as uploading games to platforms like itch.io, and comparisons to existing deterministic physics engines that are also used for multiplayer rollback. The author confirmed that Easel supports export, typically via an embedded iframe to maintain multiplayer functionality, and clarified that their rollback netcode primarily sends inputs, not state, thus minimizing bandwidth concerns.