实体限制

From Valve Developer Community
< Zh
Revision as of 11:18, 3 October 2022 by 1416006136 (talk | contribs) (Created page with "{{lang|Entity limit|title=实体限制}} {{:User:1416006136/Signature|time=2022年10月3日|in progress=1}} 出于内存分配的原因,Source 可以一次管理的entity|...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
English (en)Esperanto (eo)Русский (ru)中文 (zh)Translate (Translate)

This page is being translated by DaKang233. The create time of the page is Error: Invalid time. (UTC+8). Anyone is welcome to add new content or fix errors.


出于内存分配的原因,Source 可以一次管理的实体数量存在限制。


还应考虑地图实体数据的组合大小(以字节为单位),即使实体数量在安全限制范围内也是如此。大量 entdata 可能需要相当长的时间才能从服务器传输到客户端,并可能导致崩溃。

Template:Tip:zh-cn

引擎限制

最多有 4096 个实体。总数分为两组,每组 2048 个。

Template:Note:zh-cn

  1. 仅存在于客户端或服务器上的非网络实体(例如,客户端上的死亡布娃娃,服务器上的逻辑规则)。
  2. 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.

Tip.png提示:Temporary entities and static, sprite_clientside, or detail props do not count toward either limit.
Tip.png提示:If you're creating lots of individual objects all the time, consider rolling them all into a single manager entity.
Tip.png提示:In-game, use console commands like report_entities and cl_showents to get an idea of how many entities are present at that current state.
Tip.png提示:Prop entities that use a model with $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 异形丛生 异形丛生, 2048 in 反恐精英:全球攻势 反恐精英:全球攻势).

Note.png注意:This is a soft limit; a modded VBSP is capable of adding as many entities as memory allows.

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 Template:Game name, networked entity limit is 16384.

There appears to be no limit for map compiles, or it is tied to the networked entity limit.

另见

External links