Game physics

This project is two-fold. First, we implement basic physics in an existing framework based on the graphics engine Ogre3D1 and the physics engine ODE2, encompassing collisions based on physical properties of objects and contacts, such as bounciness and slipperiness.

Wind, air friction and spin effects are all simulated as follows. Wind is represented by applying a force on all objects in the scene according to a vector defining the wind direction and speed. Air friction on the other hand is implemented by considering both laminar flow for slow-moving objects and turbulent flow for fast-moving objects as per 3. Finally, we simulated spin effects by implementing the Magnus effect, a phenomenon which causes spinning objects in a fluid to experience a force perpendicular to linear motion. This can create a lift force.3

In the second part of this project, we implement client-server model in the same framework. By letting a server perform the computationally heavy physics simulation, we only send update packages to the client at set times. To fill the gap between packages, we perform dead reckoning on the client, i.e., we attempt to predict the motion of objects based on their current speed and acceleration. This prediction can be linear (first-order), taking into account linear and angular velocities, or even second-order, which also uses the acceleration for predicting object movements. Furthermore, wind and spin effects are also predicted using simple physics.

To prevent snapping - i.e., jerky object movement - every time an update package is sent, we use convergence, which interpolates between predictions made on previous and current update package information to smoothly perform this transition.

The amount of data the server has to send is significantly reduced using the prediction algorithms, while still maintaining an acceptable level of accurate physics. This approach is therefore especially well-suited for online games, where servers need to send large amounts of data to the clients. This way, the number of updates regarding the physics simulation can be drastically reduced.

This project was implemented using C++ and OpenGL.

[1] OGRE - Open Source 3D Graphics Engine (2012).

[2] Open Dynamics Engine (, 2007). R Smith.

[3] Physics for Game Developers (2002). I Matthews, S Baker.

This project was finished on the 29th of June, 2012