Article: Source: Belly of the Beast
Author: MrChimp Feedback: Comments/Discussion
Date Added: June 21st, 2004 Print: Printable B&W Version

Physics System
One of the first things Valve decided they needed for Half-Life 2 was a physics system that allowed the player to make a bigger impact on the world around them, and provided a wide range of game play possibilities. They were searching for a system that would allow such a level of interaction that it could form a core part of gameplay and not just another piece of eye-candy. What they eventually decided upon was the Havok physics engine.

Since they licensed and integrated it into Source, Valve have been tweaking and adding to Havok to the point it's virtually a new animal. Almost every aspect of the Source engine follows on from the physics — including the sound, graphics, AI and animation. When asked whether or not they would be upgrading to Havok 2, Valve seemed to suggest they probably wouldn't, in part because H2 wouldn't be much of a step forward from what they currently have.


Nearly every object in HL2 is subject to realistic physical interaction.
Rigid body dynamics & Constraints/Joints
As the name would suggest, a rigid body is something that cannot be crushed, bent or in anyway deformed. Rigid body dynamics are the most common application of physics in today's games — it's simply the physical simulation of non-deformable objects. It's used for simple objects like boxes, barrels and the odd plank of wood. It is also used for ragdolls, which are simply rigid body's joined together.

Joints are joints... they allow you to attach two objects together. You can give the joints constraints so they can only move in certain directions and only so far. This is how ragdolls are made and to my knowledge how the mattress in the traptown video was able to flex. Some joints can be broken and others can't, with the breakable joints there is a threshold on how much force can be applied before the joint fails.

The opposite of rigid body dynamics is soft body, it's unlikely that the Source engine supports it, but it's not something that is years away. It's roughly as costly, in terms of performance, as cloth simulation. We can only hope that it's not too long before Valve implements it into Source so the in game bouncy castle is no longer a dream but a reality.

Springs, ropes, cloth & vehicles
Springs in the Source engine are normally invisible objects that sit between two other physically simulated objects and act just like real life springs. To put it another way, these "springs" magnetize the two objects so they repel each other when they get too close and then re-polarizes one of them when they get too far apart so they attract... actually just forget the bit about magnets. However, just like joints, springs can be set to break.

Ropes are as the name suggests ropes. They can be defined in the hammer editor by simply joining two points together and specifying how many nodes there should be joining the rope or cable together. The more nodes the better the rope looks and the more realistic it is (but the bigger the hit on performance).

Cloth simulation is handled in a similar way to ropes — just lots of nodes joined together. Unlike ropes, cloth simulation takes up a lot of CPU time and has only been used in games where the CPU is free from stress (and even then, the simulation would have been highly inaccurate).

Vehicular simulation in the Source engine is basically a combination of the systems already discussed, but with some extra code and tuning. Wheeled vehicles in the Source engine are managed by a specialist part of the physics system to make them more realistic without sacrificing performance and development time. The vehicles use the same springs and rigid body dynamics as the rest of the system, but also have extra bits of code here and there to make them easier to use and more reliable (for both the player and the developer). Boats, hovercraft and air vehicles are all handled the same way as wheeled vehicles except they also use their own physics subsystems.

Water & Fire

HL2 uses fire to great effect.
Another source of confusion is water simulation. When Valve say the water is physically simulated, they mean objects have buoyancy. They don't mean the Source engine has fluid dynamics. Fluids in Source don't really exist. "Water" areas are just zones of game space that have special physical properties. When an object enters these areas, it behaves differently. It most likely slows down and begins to float upwards (unless, of course, it's denser than the fluid in question or it is a witch). Fluid dynamics is completely different - the actual fluid is simulated instead of just its effects on other objects. At this stage, Valve has indicated that fluid dynamics won't be incorporated into Source. And we wanted to throw buckets of water at the G-Man!

Fire, it seems, isn't something built into the Source engine, but rather a game specific feature (in this case Half-life 2). However, it is an interesting use of the Source engine's features - including the particle system and the material system. Fire can spread throughout the level moving from one flammable object to the next. It's not clear if Half-Life 2 will have this enabled, though.
HEADLINES
MODS HEADLINES FORUMS

Site content © 2004 Josh "Mr Bond" Klose unless otherwise noted. HL Fallout is part of Ogre's Network. | Legal Info · About Us · The Staff