实体限制
本页面由大康正在翻译中。页面创建时间为2022年10月3日。欢迎任何人补充新内容或者修改其中的错误。
出于内存分配的原因,Source 可以一次管理的实体数量存在限制。
还应考虑地图实体数据的组合大小(以字节为单位),即使实体数量在安全限制范围内也是如此。大量 entdata 可能需要相当长的时间才能从服务器传输到客户端,并可能导致崩溃。

Contents
引擎限制
最多有 4096 个实体。总数分为两组,每组 2048 个。



- 仅存在于客户端或服务器上的非网络实体(例如,客户端上的死亡布娃娃,服务器上的逻辑规则)。
- Entities with associated edicts, which can cross the client/server divide.
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 CBaseEntityList::CBaseEntityList()
using NUM_ENT_ENTRIES
and MAX_EDICTS
. Neither of those values can be changed without breaking compatibility with the engine.

sprite_clientside
, or detail props do not count toward either limit.

report_entities
and cl_showents
to get an idea of how many entities are present at that current state.
$collisionjoints
will generate one phys_bone_follower
for every convex piece of their collision model. These can quickly eat up the edict count! Enabling the "Disable Bone Followers" keyvalue on the prop will disable bone followers, although the prop will no longer have a functioning collision model, and the model will not be able to ragdoll.VMF 限制
Hammer itself has no entity limit, but VBSP's is 8192 (16384 in Alien Swarm, 2048 in
Counter-Strike: Global Offensive).

This is double the combined total accepted by the engine, which may be because it at first treats internal entities (such as prop_static
and 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.
起源 2
In Source 2, specifically S&box, networked entity limit is 16384.
There appears to be no limit for map compiles, or it is tied to the networked entity limit.