Skip to main content

Oddballs

Table of Contents

Oddballs is a powerful billiards physics engine written in TypeScript. It features in-depth customization to support nearly any potential application, but was specifically designed with multiplayer networking in mind and has been carefully optimized to provide lightning-fast simulation times while retaining a high level of accuracy. Please note that the engine is still a work-in-progress and is not currently available for public use.

How it works #

The foundation of the engine is a continuous event-based evolution algorithm. In other words, the system’s kinematics are modelled as a set of functions of time and we find local minimums/maximums or intersection points to determine when system-changing events (collisions, friction-induced rolling, etc.) will occur.

This approach typically requires significantly less computation than discrete time evolution and allows simulation results to be represented by a relatively small number of bytes; that makes it an ideal choice for networking and enables highly desirable features like shot replay.

It also offers numerous opportunities for optimization, which I have explored extensively to enhance the engine’s efficiency. I plan to publish a comprehensive write-up of my implementation once it is complete.

Next steps #

While I am pleased with the progress made so far, there is still room for improvement and my current focus is on refining the engine’s performance and quality. Once these goals are achieved, my ultimate aim is to leverage the engine to develop an online multiplayer game.