A new physics simulation engine Box3D has been introduced

Erin Catto, the creator of the Box2D project, announced the creation of a new physics simulation engine Box3D, which is a fork of Box2D with an identical architecture, but redesigned and expanded for use in 3D games. The project's code is written in C and is distributed under the MIT license. Builds for Linux, Windows, and macOS are supported.

The Box3D engine was developed by the studio Kintsugiyama for the new 3D shooter The Legend of California, in which Erin is involved. The game uses the Unreal Engine, but the developers were not satisfied with the built-in physics engine Chaos. Issues arose with the lack of accounting for gyroscopic torque (thin objects rotated unnaturally long), continuous collision detection (unrealistic behavior of falling trees), and low performance when processing hundreds of thousands of objects.

Initially, the plan was to solve the problems by creating a fork of the Jolt physics engine, but then, at the suggestion of the creator of the Rubikon engine, involved in Half-Life, a simplified version of Rubikon-Lite was taken as the basis, which was reworked using code and optimizations from Box2D to combine the existing 3D capabilities with the developments from the Box2D engine. As a result, almost all APIs, data structures, and algorithms in Rubikon-Lite were replaced with code from Box2D, and only the algorithms for constructing convex hulls and processing 3D collisions remained from Rubikon-Lite. The resulting engine was decided to be published as a separate open project Box3D with the consent of the author of Rubikon-Lite and Kintsugiyama.

Currently, the first release of Box3D 0.1 has been published, marked as having alpha-quality. The main planned functionality has been implemented, but documentation refinement and testing are required. In addition to the game The Legend of California, the new engine is already utilized in the gaming platform s&box, the open game engine Esoterica, and a multiplayer space game Space Game, designed for 1000 players.

For 3D games in the new engine, features have been added such as collision calculations with polygonal meshes and height maps used for terrain generation, enabling realistic effects of falling trees on voxel surfaces in the game The Legend of California. Support for pre-calculated (baked) composite collisions, composed of several simple shapes, has significantly reduced resource consumption when simulating collisions of a vast number of typical small objects.

Among the features transferred to Box3D that were previously available in Box2D:

  • Continuous collision detection (handling the object's movement as a continuous trajectory), collision filtering, and event generation upon object contact. Support for spherical, capsule, and convex hull shapes for collision detection. An optimized collision processing system using SIMD instructions.
  • Sub-stepping Solver to enhance simulation accuracy by dividing simulation stages into several smaller steps.
  • Utilization of graph coloring methods for processing large groups of interconnected objects.
  • Character controller responsible for handling movement, collisions, and the character's interactions with surrounding objects.
  • Support for ray tracing, shape tracing, and intersection checks when scanning the surrounding space. A sensor system for detecting objects in space.
  • Soft Step Solver for calculating rigid body physics during complex interactions.
  • Support for freezing the state of groups of inactive or static objects to save resources.
  • Support for various connections and types of relationships between objects, including hinges, springs, motors, welding, and wheels, with the ability to flexibly adjust each connection. Calculation of compressive and tensile forces with which objects affect each other.
  • The ability to generate events at the start of motion, stopping, or stabilizing an object.
  • Hooks for multithreaded processing with an optional internal scheduler.
  • Use of double type coordinates, allowing for the creation of enormous worlds.
  • Cross-platform determinism that ensures consistent results across different hardware platforms.
  • Support for recording and playing back simulations.
  • C API and C code compliant with the C17 standard.

Future plans mention expanding capabilities related to character movements, improving mechanisms to prevent 'ghost collisions', optimizing, and enhancing joint solver processing. The repository intends to provide the ability for community members to submit pull requests with changes after signing a Contributor License Agreement (CLA).

Play video


Source: opennet.ru
Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster