It's a rare map that exists without any physically-simulated objects. How can we keep the performance costs of all these items under control?
It's a particular issue when we consider that we can't remove objects based on the speed of the CPU; an Intel Core 2 Duo has just as many objects to manage as an eight-core Xeon!
- Start asleep
- Suspends all physics calculations until the entity has a force of some sort exerted on it. Its primary use is to avoid the first moments of a map being a slideshow as all of the objects in it 'settle'.
- But of course you do want that settling to happen, or else objects will be suspended in the wrong position. You can escape this catch-22 with the
- Debris objects don't collide with anything but brushes, vastly reducing their cost. They can optionally be 'ploughed through' by the local player with
- Tip:It can get fiddly to set lots of tiny items as debris. Perhaps a programmer could write some code to automatically do so for models under a certain size when the map spawns?
- Motion Disabled
- Does exactly what its name suggests. Unlike sleeping, it can be (and is only) affected with the
The amount of network data physics objects create can become an issue in multiplayer. To help with this, use
prop_physics_multiplayer (In Half-Life 2: Deathmatch maps use prop_physics or prop_physics_respawnable, using prop_physics_multiplayer highly not recommended); it simplifies collision models for complex entities to reduce bandwidth, and makes everything a little bit bouncier to try and hide latency paradoxes.
It also automatically makes smaller objects client-side, which can be overridden with the 'Force server-side' spawnflag if needed.