Лимит (предельное количество) объектов

From Valve Developer Community
< Ru
Jump to navigation Jump to search
English (en)Esperanto (eo)Русский (ru)中文 (zh)Translate (Translate)

Из соображений распределения памяти, существует ограничение на количество объектов, которыми GoldSrc GoldSrc/Source Source/Source 2 Source 2 может управлять одновременно.

Также следует учитывать общий размер (в байтах) данных об объектах в файле карты, даже если количество объектов находится в указанных пределах. Передача большого объёма данных об объектах(en) от сервера к клиенту может занять значительное время и привести к сбоям.

Tip.pngСовет:При создании очень больших или подробных карт помните, что во время выполнения будет существовать больше объектов, чем было скомпилировано. Такие объекты, как оружие, которым владеют персонажи, снаряды и куклы трупов, тоже являются объектами. Если появляется ошибка "no free edicts", то придётся начать сокращать количество объектов!

Ограничения GoldSrc GoldSrc

Неполная

Эта статья(раздел) является наброском. Вы можете помочь, дополнив её.

По умолчанию лимит составляет 1'200 записей edict_t, но его можно увеличить до 2'048, отредактировав файл liblist.gam модификации, добавив в него edicts "2048".
Этот способ можно использовать для однопользовательских модификаций, но не следует применять для многопользовательских карт существующих игр, поскольку сервер и все клиенты должны иметь одинаковые ограничения.

В Sven Co-op Sven Co-op лимит был увеличен до 8'192.

До выхода обновления в честь 25-летия Half-Life Half-Life, а также в некоторых отдельных играх GoldSrc, лимит по умолчанию составлял 900 записей edict_t.

All entities on the server are edicts, and are networked to clients. Intangible entities can be made clientside-only using MAKE_STATIC, but they will be removed upon loading a saved game.

Ограничения Source Source

Существует 2 группы объектов:

  1. Несетевые объекты, которые существуют только на клиенте или на сервере (например, куклы трупов на клиенте, класс CLogicalEntity(en) на сервере). В предшествующих VScript версиях платформы и в Left 4 Dead 2 их может быть до 2'048, а в Ветвь Team Fortress 2, Alien Swarm, Portal 2, Counter-Strike: Global Offensive до 6144 штук.
  2. Сетевые объекты, ассоциированые с записями edict_t, которые передаются между клиентом и сервером. Всего их может быть до 2'048 штук.
  • В Garry's Mod Garry's Mod доступно до 8'192 сетевых объектов, и до 8'192 несетевых объектов.
  • В Mapbase Mapbase доступно до 16'384 объектов "отображаемых на стороне клиента". (Внутренние точечные объекты, такие как prop_static) [1]

If the game tries to assign an edict past the limit it will exit with an error message, but if it tries to create a non-networked entity past the limit 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. In VScript games, non-networked entities have 2 extra bits reserved compared to edicts. Since the pool of entities is shared between entities and non-entities, this is why non-networked entities have a higher limit.

Tip.pngСовет:
  • Temporary entities and prop_static's, env_sprite_clientside(en), or prop_detail(en) props do not count toward either limit. VBSP enforces limits for these, but these can be raised with a modified VBSP.
  • If you're creating lots of individual objects all the time, consider rolling them all into a single manager entity.
  • 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.
  • Prop entities that use a model with $collisionjoints(en) will generate one phys_bone_follower(en) 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(en) нет ограничений на количество объектов, однако лимит компилятора VBSP VBSP зависит от игры:

Note.pngПримечание:Лимит задаётся переменной MAX_MAP_ENTITIES в файле 🖿public/bspfile.h. Это программное ограничение, модифицированный компилятор VBSP способен компилировать столько объектов, сколько позволяет память.

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.

Ограничения Source 2 Source 2

В Source 2 Source 2, а именно в S&box S&box, количество сетевых объектов ограничено 16'384 записями edict_t.

Counter-Strike 2 Counter-Strike 2 - максимум до 16'384 записей edict_t и до 16'384 серверных объектов.

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

Смотреть также

Внешние ссылки

Ссылки

  1. Mapbase 3.1 Release Notes https://www.moddb.com/mods/mapbase/news/mapbase-v3-1-released ModDB Retrieved Wednesday, March 6, 2024

Category:Level Design(en) Category:Programming(en)