Entity limit

From Valve Developer Community
Revision as of 14:12, 15 September 2009 by TomEdwards (talk | contribs) (Created page with 'For reasons of memory allocation, there is a limit to the number of entities the engine can manage at once. == Programming limits == There are two entity limits in the engine i…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

Programming limits

There are two entity limits in the engine itself:

  1. The maximum number of entities that can exist at the same time is 4096.
  2. The maximum number of edicts that can be assigned to entities at the same time is 2048.

If the game goes over the edict limit it will exit with an error message, whereas if it goes over the entity limit the new entity will fail to spawn and a warning will appear in the console. The logic is perhaps that an entity that is spawned dynamically but not added to the dictionary probably isn't too important.

Temporary entities do not count toward either limit.

Tip.png Tip: If you're creating lots of individual objects all the time, consider rolling them all into a single manager entity. This is how Left 4 Dead handles huge numbers of infected: they are all "finger puppets" of the director.
Tip.png Tip: The edict limit can't be changed in a mod because it must be in sync with the engine. It may be possible to increase the general entity limit, however.

Hammer limits

VBSP's entity limit is 8192, double the total accepted by the engine.

Confirm:This may be because it at first treats internal entities (such as prop_static and env_cubemap) like normal entities, and/or possibly because it generates a lot of detail props.

However, it also places a size limit of 384KB on the whole entdata block. This prevents any map from actually coming anywhere near 8192 designer-placed entities.

Tip.png Tip: Since VBSP's source is included in the SDK, it is perfectly possible to make your own build with the entdata limit increased or removed.