Entity limit

For reasons of memory allocation, there is a limit to the number of entities // 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.
== limits ==
The default edict limit is 1200, but this can be raised to 2048 by editing the mod's liblist.gam to include .This can safely be done for singleplayer mods, but should not be relied upon for multiplayer maps for existing games, as the server and all clients must agree upon the edict limit.
In , the limit has been raised to 8192.
Prior to 's 25th-anniversary update, aswell as some standalone GoldSrc games, the default edict limit was 900.
All entities on the server are edicts, and are networked to clients. Intangible entities can be made clientside-only using , but they will be removed upon loading a saved game.
== limits ==
There is 2 groups of entities:
# Non-networked entities are entities which exist only on the client or server (e.g. death ragdolls on client, logicals on server). There can be 2048 of these in pre-VScript branches, 6144 otherwise (, , , )
# Networked entities are associated edicts, which can cross the client/server divide. There can be 2048 of these.
* In , there can be up 8192 networked entities, and 8192 non-networked entities.
* In , there can be up to 16384 "clientside renderable" entities. (Internal point entities, like 's) 
If the game tries to assign an edict past the limit it will exit with an error message, but if it tries to create a non-networked entity past the limit it will merely refuse and print a warning to the console. The logic behind this may be that an entity spawned dynamically (i.e. not present in the map) but not assigned an edict probably isn't too important.
The two entity lists are created by CBaseEntityList::CBaseEntityList() using NUM_ENT_ENTRIES and MAX_EDICTS. Neither of those values can be changed without breaking compatibility with the engine.
In VScript games, non-networked entities have 2 extra bits reserved compared to edicts. Since the pool of entities is shared between entities and non-entities, this is why non-networked entities have a higher limit.
=== VMF Limits ===
Hammer itself has no entity limit, but 's is dependent on the game: 
* 8192 in /
* 16384 in / 
* 20480 in 
* 65536 in /, since March 2024.
 
This is double the combined total accepted by the engine, which may be because it at first treats internal entities (such as and ) like normal entities, or perhaps because it generates a lot of detail props.
VBSP also recommends an entdata size limit of 384KB, but this is in no way enforced.
== limits ==
In , specifically , the networked entity limit is 16384 edicts.
There appears to be no limit for map compiles, or it is tied to the networked entity limit.
== See also ==
* Internal entity
* 
== External links ==
* mapping tricks to get around the Entity limit
== References ==
 Mapbase 3.1 Release Notes https://www.moddb.com/mods/mapbase/news/mapbase-v3-1-released ModDB Retrieved Wednesday, March 6, 2024
Category:GoldSrc
Category:Source
Category:Source 2
Category:Level Design
Category:Programming