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

Entity (GoldSrc): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{LanguageBar}} {{Source topicon}} {{TabsBar|main=gs2|base=Entity}} {{cleanup|Keep only goldsrc info}} An object defined within {{gldsrc|4}}, {{src|4}} or {{source2|4}} as having characteristics which differentiate it from "the world" (world brushes). == 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:...")
 
No edit summary
 
(15 intermediate revisions by 2 users not shown)
Line 2: Line 2:
{{TabsBar|main=gs2|base=Entity}}
{{TabsBar|main=gs2|base=Entity}}


{{cleanup|Keep only goldsrc info}}
{{draft}}


An object defined within {{gldsrc|4}}, {{src|4}} or {{source2|4}} as having characteristics which differentiate it from "the [[worldspawn|world]]" (world brushes).
An object defined within {{gldsrc|4}} as having characteristics which differentiate it from "the [[worldspawn (GoldSrc)|world]]" (world brushes).


== Types of entities ==
== Types of entities ==
Line 11: Line 11:
|-
|-
!Types
!Types
!available in
!Info
!Info
|-
|-
Line 17: Line 16:
|-
|-
|align="center"|[[Brush entity]]
|align="center"|[[Brush entity]]
|align="center"|{{src|4}} and earlier
|A '''Brush Entity''' is an '''entity''' type created by ''tying'' an entity to a BSP geometry [[brush]] ([[bmodel]]) in the map, giving the brush a specific effect or ability defined by the entity ''tied'' to it.<br>(The default shortcut in {{hammer3}}{{jack}} is {{Key|Ctrl}} + {{Key|T}} after selecting a brush)
|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)
|-
|-
|align="center"|[[Point entity]]
|align="center"|[[Point entity]]
|align="center"|All engines
|'''Point Entities''' are '''entities''' created at a specific position point on the [[coordinates|grid]]. Some require a model ([[MDL (GoldSrc)|MDL]], [[BSP30|BSP]], or [[SPR]]) to be selected for them in order to function fully.
|'''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.
|-
|align="center"|[[Mesh entity]]
|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]]
|'''Path entities''' are a type of entity recently added to the tools. They can be created with the currently hidden Path Tool (Shift + P).
|-
|-
! colspan="3" | By Internality
! colspan="3" | By Internality
|-
|-
|align="center"|[[Internal entity]]
|align="center"|[[Internal entity]]
|rowspan="2" align="center"| In all Engines
|'''Internal entities''' are those which are processed by compilers 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 get removed from the final product, usually stored in a special chunk.<br>Examples of internal entities: {{ent|func_group|engine=goldsrc}}, {{ent|func_detail|engine=goldsrc}}, {{ent|light_surface|engine=goldsrc}}
|'''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.
{{clarify|Some internal entities, such as {{ent|info_texlights}}, remain in the entity lump, but are unrecognized by the game.}}
|-
|-
|align="center"|[[:Category:Non-internal entity|Non-Internal entity]]
|align="center"|[[:Category:Non-internal entity|Non-Internal 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}}.
|'''non-internal entities''' are not processed by the compilers 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|func_wall|engine=goldsrc}}, {{ent|trigger_relay|engine=goldsrc}}, {{ent|light|engine=goldsrc}}, {{ent|monster_scientist|engine=goldsrc}}.
|}
|}
=== By how it's used ===
* [[NPC]]/[[Monster]] entities - A non-player character. These usually inherit [[CBaseMonster (GoldSrc)|CBaseMonster]].
* [[3D model|Model]] entities - An entity which displays an [[MDL (GoldSrc)|MDL]], [[SPR]], or external [[BSP30|BSP]] model. If an entity is specifically designed to display an MDL, it will usually (but not always) inherit [[CBaseAnimating (GoldSrc)|CBaseAnimating]], allowing the mapper to set bodygroups and skins. Any entity which allows the mapper to chose an arbitrary MDL, SPR, or BSP to display will support displaying any of the three formats, even if the entity is geared specifically for one.
* [[triggers|Trigger]] entities - An entity which is invisible to players, but detects if a player enters it.
* Logic entities - An entity which is invisible to players and is only used by the server to handle entity "logic". Despite being useless to clients, it still is networked, as GoldSrc does not have the concept of a server-side entity.


== 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''' {{gldsrc|4}} can manage at once. This will usually vary between 900 to 2048, depending upon the engine version and contents of liblist.gam.


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 55: Line 51:
* [[List of Entities]]
* [[List of Entities]]
* Coding [[Your First Entity]]
* Coding [[Your First Entity]]
* Console command {{ent|dump_entity_sizes}}
* [[Constraint]]
* [[S_PreserveEnts|preserved entity]]
* [[Void]]


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

Latest revision as of 04:09, 24 April 2025

English (en)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.

An object defined within GoldSrc GoldSrc as having characteristics which differentiate it from "the world" (world brushes).

Types of entities

Note.pngNote:These types are only from perspective of map editors and are based on FGD definitions or how map compilers deal with them [confirm]
Types Info
By Form
Brush entity A Brush Entity is an entity type created by tying an entity to a BSP geometry brush (bmodel) in the map, giving the brush a specific effect or ability defined by the entity tied to it.
(The default shortcut in Hammer 3.xJ.A.C.K. is Ctrl + T after selecting a brush)
Point entity Point Entities are entities created at a specific position point on the grid. Some require a model (MDL, BSP, or SPR) to be selected for them in order to function fully.
By Internality
Internal entity Internal entities are those which are processed by compilers 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 get removed from the final product, usually stored in a special chunk.
Examples of internal entities: func_group, func_detail, light_surface
Clarify: Some internal entities, such as info_texlights, remain in the entity lump, but are unrecognized by the game.
Non-Internal entity non-internal entities are not processed by the compilers and remains as a separate entity.
These are typically interactive objects or characters that the player can interact with or that affect gameplay.
Examples of non-internal entities: func_wall, trigger_relay, light, monster_scientist.

By how it's used

  • NPC/Monster entities - A non-player character. These usually inherit CBaseMonster.
  • Model entities - An entity which displays an MDL, SPR, or external BSP model. If an entity is specifically designed to display an MDL, it will usually (but not always) inherit CBaseAnimating, allowing the mapper to set bodygroups and skins. Any entity which allows the mapper to chose an arbitrary MDL, SPR, or BSP to display will support displaying any of the three formats, even if the entity is geared specifically for one.
  • Trigger entities - An entity which is invisible to players, but detects if a player enters it.
  • Logic entities - An entity which is invisible to players and is only used by the server to handle entity "logic". Despite being useless to clients, it still is networked, as GoldSrc does not have the concept of a server-side entity.

Limitations

Main article: Entity limit

For reasons of memory allocation, there is a limit to the number of entities GoldSrc GoldSrc can manage at once. This will usually vary between 900 to 2048, depending upon the engine version and contents of liblist.gam.

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