Prop physics

From Valve Developer Community
Revision as of 11:07, 20 July 2009 by TomEdwards (talk | contribs)
Jump to navigation Jump to search

Template:Base point It is a generic "bucket" used to add rigid, VPhysics-simulated models to the world. Template:Wrongtitle

The only value required for prop_physics to work is a path to a model. As long as that model is physics-enabled (see #Consistency), the correct physics data will be loaded from it when the map starts.

Note.pngNote:prop_physics cannot be parented.

Additional settings include:

  • Weight multiplier
  • Impact type (sharp or blunt)
  • Motion disabled state
  • Allow or disallow Gravity Gun pickup
  • Break after taking enough damage

Alternatives

If you are creating a multiplayer map, you should instead use a prop_physics_multiplayer for most objects instead of a prop_physics. Prop_physics is ideal for single-player maps, where accuracy of interactions has no network overhead to worry about. The detail going into the interaction between objects in multiplayer results in an undesirably large network overhead and thus requires the detail of the interactive aspects of the objects be simplified.

To solve this, Valve created prop_physics_multiplayer, which uses a much simpler structure of the model to do physics interactions, resulting in much better network play. Extremely simple models (simple being anything "boxy" [computer cases, keyboards, small jars, etc.]) will not have prop_physics_multiplayer settings, but this is fine because those models are so simple that making them prop_physics will not have an adverse effect on network traffic. If you are having a problem in a multiplayer map with a small object that is behaving strangely as a prop_physics_multiplayer, try making it a prop_physics.

If you are mapping for Half-Life 2: Deathmatch and want your breakable objects to come back after a while, use a prop_physics_respawnable instead.

Consistency

Consistency becomes a large problem when dealing with the many prop models that the Source engine provides. From a player's perspective, object interactivity should remain consistent across all the levels of your game / mod. To enforce this, the game-related data of props is stored within the model itself.

Models that are meant to be physically simulated (chairs, tables, wooden planks, etc) will remove themselves if they are placed as prop_static or prop_dynamic entities. Other game-related data, such as mass, "health", gib amount & models, and so on are all stored inside the prop model as well.

The method by which they are stored, and guidelines for how to set it up, can be found in the Prop Data section of the model's QC file.

See also

  • Prop Data
  • Prop Types Overview - Description of the various model prop entities.
  • Prop Footsteps - A tutorial that provides essential code for when players walk on entities like this, it's not ignored during footstep sound computation.

Keyvalues

RenderFields:


Render Mode (rendermode) <byte choices>
Set a non-standard rendering mode on this entity.
Render Modes
  • 0: Normal
  • 1: Color
  • 2: Texture
  • 3: Glow
  • 4: Solid/Alphatest Obsolete
  • 5: Additive
  • 6: Removed, does nothing Obsolete
  • 7: Additive Fractional Frame
  • 8: Alpha Add
  • 9: World Space Glow
  • 10: Don't Render
Render FX (renderfx) <byte choices>
Various somewhat legacy alpha effects. See render effects.
Render Amount / Transparency (renderamt) <byte>
Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color tint.
Note.pngNote:Page left for viewable history, content moved to prop_physics

Flags

  • Note.pngNote:Page left for viewable history, content moved to prop_physics
Should force breakable models to have pieces break on the server?

Inputs

Ignite
Burst into flames.
IgniteLifetime <float>
Ignite, with the given lifetime.
Todo: Before the flames extinguish, or before health reaches zero?
IgniteNumHitboxFires <int>
Ignite with the given number of hitbox fires.
IgniteHitboxFireScale <float>
Ignite with the given hitbox fire scale.

RenderFields:

Alpha <integer 0–255>
Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its rendermode set to a number other than 0.
Color <color255RedirectInput/color32>
Sets an RGB color for the entity.
Note.pngNote:Page left for viewable history, content moved to prop_physics

Outputs

Note.pngNote:Page left for viewable history, content moved to prop_physics