SEED - Combining entities
The SEED (System for Environmental Entity Distribution) was created by Tels in Summer 2010 and can either create entities at random places (depending on underground, height, distribution patterns and so on), or manage manually placed entities.
In both cases there are usually a lot of entities placed in a map. To improve the performance, the system can also combine entities and this page describes how that works.
Combining created entities
Whenever the SEED places entities in your map, it can also attempt to merge these entities into larger entities. This can achieve higher performance, because instead of drawing 1000 single grass-entities, only 1 entity needs to be drawn.
This system works entirely automatic, and you usually do not need to think about it.
Combining manually placed entities
If you placed a few dozend or even more models of the same type in your map (f.i. a lot of ivy pieces), then it makes sense to combine these into one entity to save on drawcalls. This technique is called "watching over entities" and is described in detail in the SEED_-_Watching_entities article.
There are a few rules and parameters which influence which entities are combined/merged. The following rules are always automatically in effect and cannot be changed:
- Merged entities will not cross visportals.
- Moveable entities, AI, func_smoke and other special entities will not be combined. Mostly only func_statics will be combined together.
- Entities can be solid or non-solid; both cases work. Solid models will also get a collision model that consists of multiple parts.
- Whether entities use a real model (something.lwo) or are made from map geometry (brushes/patches) does not make a difference, the SEED system can work with both by using some clever tricks behind the scenes to recover the map geometry of brushes/patches. This means you can have one copy of a brush in your map, and at runtime it gets duplicated into multiple render models.
- The number of maximal tris/indexes per combined entity is hardcoded into the source code and cannot be changed. (The limit was found empirically by raising it until the system crashed, then lowering it again one step.)
These parameters can be changed:
- If the "combine" spawnarg is set to 0 on the SEED entity, it will not combine entities. Warning: Using this can bring the system to its knees by spawning a couple thousand entities!
- The maximum distance for entities to be combined is 2048 units, but can be changed with the spawnarg combine_distance on the SEED entity. Raising this distance can reduce the entity count, but be warned that very large entities might take a long time to be updated, which can lead to stuttering when the player walks around.
Apparently when all your entities are combined into one, they all of them hide at once when using hide_distance.
- LOD System and SEED
- SEED - Spawnargs and SEED - Templates via Spawnargs
- SEED - Usage - Examples on how to use SEED in real-map scenarios
- SEED - Image maps - Examples and how to use image maps
- SEED - Premade entities - List of premade random entity generators
- SEED - Watching entities - Example on how to improve performance and reduce entity count
- SEED - Falloff function - How to use "falloff" "func" to get more complicated distribution patterns
- SEED - Cloning
- SEED - Known bugs
- SEED - FAQ
- SEED - Generating entities - How it generates entities (technical background information)