This article's documentation is for anything that uses the Source engine. Click here for more information.

Entity

From Valve Developer Community
Jump to navigation Jump to search
English (en)Deutsch (de)Español (es)Hrvatski (hr)Português (pt)Русский (ru)中文 (zh)Translate (Translate)

Entity is an object defined within Source Source usually for the purpose of being interact-able by players or by other entities via I/O system. The world, which is a combination of all world brushes, func_detail and prop_static entities, is represented by an entity called worldspawn.

Types of entities

Entities can be separated into few different type. From the perspective of Hammer editor they can be separated based on how they are created in the editor which is determined by their FGD definition.

By map editor
Types Info
Brush entity A Brush entity is created by tying an entity to a BSP geometry brush in the map, giving the brush a specific effect or ability defined by the entity tied to it. When compiled the tied brushes are turned into brush model used by this entity.
Point entity Point entities are entities created at a specific position point on the grid. Some require a model to be selected for them in order to function fully.
By how it's processed
Types Info
Internal entity Internal entities are those which are processed by VBSP then either deleted or merged into another entity. They do not exist when the map is running, so they won't count to the entity limit.
Internal entities get special treatment by the map compile tools and are removed from the final product, usually stored in a special chunk.
Semi‑internal entity Semi-internal entities are those entities which remain as an entity in the map and the compiler also does something special based on their classname in the same way as with internal entities.

For example func_areaportal brush model is moved to world by VBSP leaving the entity without any brush in a map file. Or func_detail_blocker which blocks creation of detail sprites during compile and remains in a map possibly just as an information for decompilers. Or even the light related entities which are processed by VRAD to compute lighting.

Non‑Internal entity Non-internal entities are not processed by VBSP (other than in case of brush entities converting the associated brushes into bmodels) and remain as a separate entity.
These are typically interactive objects or characters that the player can interact with or that affect gameplay.
General separation from the game's perspective based on intended use
Types Info
Brush entity Entities that use a brush model.
Model entity Entities that use a studio model. For example prop_static, prop_physics, prop_dynamic, player, npc_alyx. (they are almost always subclasses of CBaseAnimating)
Point entity Entities whose position is relevant for its functionality and don't use 3D model, most often no visual representation with exception of particles, sprites, decals. For example info_target, env_sprite, infodecal, info_particle_system (often derived from CPointEntity but it's not the rule)
Logical entity Entities whose position is irrelevant to its functionality. For example logic_auto, logic_relay, math_counter, info_director (often derived from CLogicalEntity but it's not the rule as even logic_auto isn't)
Wiki Note:Entity pages on this wiki should use the "in-game" separation to classify them

Limitations

Main article:  Entity limit

For reasons of memory allocation, there is a limit to the number of entities Source Source can manage at once.

The combined size (in bytes) of a map's entity data should also be considered, even if the number of entities is within safe limits. Large amounts of entdata can take a noticeably long time to transmit from server to client, and may lead to crashes.

See also