Entity limit
For reasons of memory allocation, there is a limit to the number of entities the engine can manage at once.
Engine limits
There are two entity limits that apply when the engine is running:
- The maximum number of entities that can exist at the same time is 4096.
- 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.


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

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.

entdata
limit increased or removed.