You can’t have a realistic gaming experience without using the rules of physics – the calculations involved are what make the difference between stick figures that jitter across the screen and 3D characters that sweat and stumble, writes Cian Traynor
TODAY’S MOST advanced computer games are powered by software called physics engines. Loaded with a library of scientific definitions, they allow computer games to predict how an object should behave by translating what happens in the real world.
When computer games were animated manually, almost everything was pre-scripted. If your player knocked over an object, it fell the same way every time. Now predefined animations have been replaced with fluid movements, allowing for different possibilities and greater realism. If you knock into a crate from the side, it will fall properly to the left or right depending on how you knocked into it, making the scene so interactive that the characters’ actions and reactions can be different every time.
“What we’re really doing is the kind of equations people learn in fifth and sixth year physics classes,” says Dave Gargan, vice president of engineering at Havok, a Dublin-based software company whose engines are used in over 200 titles including Halo 3 and Half-Life 2 .
When Half-Life 2 was released in 2004, its pioneering use of physics helped usher in a new era of interactive gaming. The player often had to manipulate objects while accounting for factors such as gravity, mass, density and restitution – all of which needed to be computed as they happened.
“Newton’s laws of motion are exactly what we’re calculating in each frame,” says Gargan. “Every time the computer draws a new image, we have to compute all those equations about 30 times a second and solve them.The only problem is doing that computation quickly enough.”
Integration calculates the future position of an object, such as a character or a car, based on its current position, velocity and acceleration. To free up enough computation time, elements of the game that aren’t in use remain in “sleep mode”.
In a racing game, for example, a barrier only becomes “awake” when a car crashes into it. This is where collision detection comes into play: it works out when one thing hits another thing and how it hits it. Without those calculations, characters would walk through walls.
“When you see games that don’t utilise physics, your eyes can tell,” says Chris Allen, lead behaviour engineer at NaturalMotion, whose Euphoria engine is used in Grand Theft Auto IV, Red Dead Redemption and Star Wars: The Force Unleashed .
“The biggest law of physics in games is the conservation of momentum, because if a guy stops instantly, it makes things look artificial.”
If you get the building blocks of physics right – from how a shoulder joint should move to how a bullet should bounce – it doesn’t matter how complex or how big that virtual world becomes.
“If you can calculate how a bullet collides with a brick then you can make a wall, then a house and then a city,” says Allen. “The rules of collision will work in all situations, so you can build away without having to worry whether something like ballistics will still work.”
By handling all the game physics, these engines give developers more time to work on other aspects of the game, such as graphics and storylines.
This means that not only can the engine and content be designed separately but reusable engines make it easier and faster to develop sequels to games.
TODAY’S MOST advanced computer games are powered by software called physics engines. Loaded with a library of scientific definitions, they allow computer games to predict how an object should behave by translating what happens in the real world.
When computer games were animated manually, almost everything was pre-scripted. If your player knocked over an object, it fell the same way every time. Now predefined animations have been replaced with fluid movements, allowing for different possibilities and greater realism. If you knock into a crate from the side, it will fall properly to the left or right depending on how you knocked into it, making the scene so interactive that the characters’ actions and reactions can be different every time.
“What we’re really doing is the kind of equations people learn in fifth and sixth year physics classes,” says Dave Gargan, vice president of engineering at Havok, a Dublin-based software company whose engines are used in over 200 titles including Halo 3 and Half-Life 2 .
When Half-Life 2 was released in 2004, its pioneering use of physics helped usher in a new era of interactive gaming. The player often had to manipulate objects while accounting for factors such as gravity, mass, density and restitution – all of which needed to be computed as they happened.
“Newton’s laws of motion are exactly what we’re calculating in each frame,” says Gargan. “Every time the computer draws a new image, we have to compute all those equations about 30 times a second and solve them.The only problem is doing that computation quickly enough.”
Integration calculates the future position of an object, such as a character or a car, based on its current position, velocity and acceleration. To free up enough computation time, elements of the game that aren’t in use remain in “sleep mode”.
In a racing game, for example, a barrier only becomes “awake” when a car crashes into it. This is where collision detection comes into play: it works out when one thing hits another thing and how it hits it. Without those calculations, characters would walk through walls.
“When you see games that don’t utilise physics, your eyes can tell,” says Chris Allen, lead behaviour engineer at NaturalMotion, whose Euphoria engine is used in Grand Theft Auto IV, Red Dead Redemption and Star Wars: The Force Unleashed .
“The biggest law of physics in games is the conservation of momentum, because if a guy stops instantly, it makes things look artificial.”
If you get the building blocks of physics right – from how a shoulder joint should move to how a bullet should bounce – it doesn’t matter how complex or how big that virtual world becomes.
“If you can calculate how a bullet collides with a brick then you can make a wall, then a house and then a city,” says Allen. “The rules of collision will work in all situations, so you can build away without having to worry whether something like ballistics will still work.”
By handling all the game physics, these engines give developers more time to work on other aspects of the game, such as graphics and storylines.
This means that not only can the engine and content be designed separately but reusable engines make it easier and faster to develop sequels to games.