这篇条目有关 Source引擎。如需详情,点击这里。

实体系统

From Valve Developer Community
< Zh
Jump to navigation Jump to search
English (en)Deutsch (de)Español (es)Hrvatski (hr)Português (pt)Русский (ru)中文 (zh)Translate (Translate)
Info content.png
This page has not been fully translated.
You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)
This notice is put here by LanguageBar template and if you want to remove it after updating the translation you can do so on this page.


实体(Entity)起源 起源引擎中定义的可交互对象,可通过I/O(en)系统与玩家或其他实体互动。整个游戏世界(由场景笔刷、func_detailprop_static构成)本质上也是一个名为worldspawn的特殊实体。

实体类型

实体可从多个维度进行分类:

按编辑器创建方式
类型 说明
笔刷实体 将BSP几何笔刷(en)与实体绑定,编译后生成笔刷模型(en)。这类实体通过几何体实现特殊功能。
点实体 坐标网格(en)特定位置创建的无几何实体,部分需要关联模型才能完全运作。
按编译处理方式
类型 说明
内部实体 VBSP(en)处理后会删除或合并的临时实体,不计入实体数量限制(en)。其数据通常存储在特殊区块中。
半内部实体 编译后仍保留但会被特殊处理的实体,如:

func_areaportal会剥离笔刷模型 • func_detail_blocker仅阻止细节生成 • 光源实体需经VRAD(en)计算光照

常规实体 完全保留的交互实体(玩家/NPC/可互动物体),仅笔刷实体会被转换为bmodel(en)
按游戏功能分类
类型 说明
笔刷实体 使用笔刷模型(en)的功能实体
模型实体 使用工作室模型(en)的实体,如:

prop_staticnpc_alyx等(通常继承自CBaseAnimating)

点位实体 依赖坐标位置但无模型的实体,如:

info_targetenv_sprite(多继承自CPointEntity)

逻辑实体 位置无关的功能实体,如:

logic_automath_counter(可能继承自CLogicalEntity)

Wiki Note:本维基优先采用"游戏功能分类法"归类实体

重要限制

主条目:  Entity limit

1. 实体数量上限:因内存分配限制,引擎同时处理的实体数量存在硬性上限 2. 实体数据体积:即使数量合规,过大的entdata(en)数据也会导致:

  • 服务器到客户端的传输延迟
  • 潜在的崩溃风险

相关链接