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

Entity: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Adding examples of non internal entities)
(source exclusive info, drafting)
Line 1: Line 1:
{{Source topicon}}
{{LanguageBar}} {{Source topicon}}
{{TabsBar|main=gs2|base=Entity}}
{{draft}}
Entity is an object defined within {{src|4}} usually for the purpose of being interact-able by players or by other entities via [[I/O]] system. [[worldspawn|The world]] itself is also an entity which is created as a combination of world brushes.


{{LanguageBar}}
== 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.


An object defined within {{gldsrc|4}}, {{src|4}} or {{source2|4}} as having characteristics which differentiate it from "the [[worldspawn|world]]" (world brushes).
{| class="wikitable" style="width:100%"
! colspan=2 | By map editor
|-
! Types !! Info
|-
| align="center" | [[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 [[bmodel|brush model]] used by this entity.
|-
| align="center" | [[Point entity]]
|'''Point Entities''' are '''entities''' created at a specific position point on the [[coordinates|grid]]. Some require a model to be selected for them in order to function fully.
|}


== Types of entities ==
{{note|These types are only from perspective of map editors and are based on [[FGD]] definitions or how map compilers deal with them {{confirm}}}}
{| class="wikitable" style="width:100%"
{| class="wikitable" style="width:100%"
! colspan=2 | By how it's processed
|-
|-
!Types
! Types !! Info
!available in
!Info
|-
|-
! colspan="3" | By Form
|align="center"|[[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]].<br>Internal entities get special treatment by the map compile tools and are removed from the final product, usually stored in a special chunk.
|-
|-
|align="center"|[[Brush entity]]
|align="center"|[[Semi-internal entity]]
|align="center"|{{src|4}} and earlier
|'''Semi-internal entities''' are those entities which remain as entity in the map but require big chuck of their functionality being taken care of by the compiler.
|A '''Brush Entity''' is an '''entity''' type in the {{gldsrc|2}} and {{source|2}} engines, 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.<br>(The default shortcut is {{Key|Ctrl}} + {{Key|T}} after selecting a brush)
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 require [[VRAD]] to do its job.
|-
|-
|align="center"|[[Point entity]]
|align="center"|[[:Category:Non-internal entity|Non-Internal entity]]
|align="center"|All engines
|'''non-internal entities''' are not processed by [[VBSP]] and remains as a separate entity.<br>These are typically interactive objects or characters that the player can interact with or that affect gameplay.
|'''Point Entities''' are '''entities''' created at a specific position point on the [[coordinates|grid]]. Some require a model to be selected for them in order to function fully.
|}
 
{| class="wikitable" style="width:100%"
! colspan=2 | General separation from the game's perspective based on intended use
|-
|-
|align="center"|[[Mesh entity]]
! Types !! Info
|rowspan="2" align="center"|Only in {{source2|4}}
|'''Mesh entities''' available only in {{source2|2}}.<br>'''Mesh entities''' replace the {{source|2}} [[brush entity|brush entities]]. Since {{Source2|2}} no longer uses [[BSP]] [[brushes]], '''entities''' that need to be associated with geometry are now tied to Hammer meshes instead.
|-
|-
|align="center"|[[Path entity]]
| align="center" | [[Brush&nbsp;entity]]
|'''Path entities''' are a type of entity recently added to the tools. They can be created with the currently hidden Path Tool (Shift + P).
| Entities that use a [[bmodel|brush model]].
|-
|-
! colspan="3" | By Internality
| align="center" | [[Model entity]]
| Entities that use a [[3D model|studio model]]. For example {{ent|prop_physics}}, {{ent|prop_dynamic}}, {{ent|player}}, {{ent|npc_alyx}}. (all of these are subclasses of [[CBaseAnimating]] as that's the only class by default that's meant to draw studio models)
|-
|-
|align="center"|[[Internal entity]]
| align="center" | [[Point entity]]
|rowspan="2" align="center"| In all Engines
| 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 {{ent|info_target}}, {{ent|env_sprite}}, {{ent|infodecal}}, {{ent|info_particle_system}} (usually derived from [[CPointEntity]] but it's not the rule)
|'''Internal entities''' are those which are processed by [[VBSP]] ({{gldsrc}} [[HLBSP]], or {{src2}} [[resourcecompiler]]) 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]].<br>Internal entities get special treatment by the map compile tools and are removed from the final product, usually stored in a special chunk.
|-
|-
|align="center"|[[:Category:Non-internal entity|Non-Internal entity]]
| align="center" | [[Logical entity]]
|'''non-internal entities''' are not processed by [[VBSP]] ({{gldsrc}} [[HLBSP]], or {{src2}} [[resourcecompiler]]) and remains as a separate entity.<br>These are typically interactive objects or characters that the player can interact with or that affect gameplay.<br>Examples of non-internal entities: {{ent|prop_dynamic}}, {{ent|logic_relay}}, {{ent|light}}, {{ent|npc_citizen}}.
| Entities whose position is irrelevant to its functionality. For example {{ent|logic_auto}}, {{ent|logic_relay}}, {{ent|math_counter}}, {{ent|info_director}} (usually derived from [[CLogicalEntity]] but it's not the rule as even logic_auto isn't)
|}
|}
{{wikinote|Non-Internal entity pages on this wiki should use the "in-game" separation to describe them}}


== Limitations ==
== Limitations ==
{{Main|Entity limit}}
{{Main|Entity limit}}
For reasons of memory allocation, there is a limit to the number of '''entities''' {{gldsrc|4}}/{{source|4}}/{{source2|4}} can manage at once.  
For reasons of memory allocation, there is a limit to the number of '''entities''' {{source|4}} 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 [[Source BSP File Format#Entity|entdata]] can take a noticeably long time to transmit from server to client, and may lead to crashes.
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 [[Source BSP File Format#Entity|entdata]] can take a noticeably long time to transmit from server to client, and may lead to crashes.
Line 52: Line 66:
* [[Entity creation]] (a quick reference)
* [[Entity creation]] (a quick reference)
* [[Entities in Depth]]
* [[Entities in Depth]]
* [[List of Entities]]
* [[List of entities]]
* Coding [[Your First Entity]]
* Coding [[Your First Entity]]
* Console command {{ent|dump_entity_sizes}}
* Console command {{ent|dump_entity_sizes}}
* [[Constraint]]
* [[S_PreserveEnts|preserved entity]]
* [[S_PreserveEnts|preserved entity]]
* [[Void]]


__NOTOC__
__NOTOC__
[[Category:Source]]
[[Category:Source]]
[[Category:Source 2]]

Revision as of 09:30, 22 April 2025

English (en)Deutsch (de)Español (es)Hrvatski (hr)Português (pt)Русский (ru)中文 (zh)Translate (Translate)
Icon-under construction-blue.png
This is a draft page. It is a work in progress open to editing by anyone.
Remember to check for any notes left by the tagger at this article's talk page.

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 itself is also an entity which is created as a combination of world brushes.

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 entity in the map but require big chuck of their functionality being taken care of by the compiler.

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 require VRAD to do its job.

Non-Internal entity non-internal entities are not processed by VBSP and remains 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_physics, prop_dynamic, player, npc_alyx. (all of these are subclasses of CBaseAnimating as that's the only class by default that's meant to draw studio models)
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 (usually 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 (usually derived from CLogicalEntity but it's not the rule as even logic_auto isn't)
Wiki Note:Non-Internal entity pages on this wiki should use the "in-game" separation to describe 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