For reasons of memory allocation, there is a limit to the number of entities 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.
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.[Clarify]
Prior to Sven Co-op, the limit has been raised to 8192.'s 25th anniversary update, the default edict limit was 900. In
There can be up to 4096 entities. This total is split into two groups of 2048:
- Non-networked entities, which exist only on the client or server (e.g. death ragdolls on client, logicals on server).
- Entities with associated edicts, which can cross the client/server divide.
- In Garry's Mod, there can be up to 16384 entities, split into two groups of 8192.
If the game tries to assign a 2049th edict it will exit with an error message, but if it tries to create a 2049th non-networked entity 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
MAX_EDICTS. Neither of those values can be changed without breaking compatibility with the engine.
This is double the combined total accepted by the engine, which may be because it at first treats internal entities (such as
env_cubemap) 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.
In edicts., specifically , the networked entity limit is 16384
There appears to be no limit for map compiles, or it is tied to the networked entity limit.