SEED - Cloning

From The DarkMod Wiki
Jump to navigationJump to search
Note: This is a design document and not actually implemented or available yet!

Regular vs. Random layouts

The current SEED system lets you only generate randomly placed entity. And although the "randomness" and the placement probability can be influenced, you still cannot control entirely where (or when) entities will be generated.

However, for some applications it is important to generate regular layouts. For instance you want a row of trees, or a regular grid of grave stones, or an irregular grid of bushes, or even a 3D grid of entities.

Likewise, sometimes you want a few randomly placed entities standing net to each other, and then repeat this (or a similar) group a few times.


SEED "clone"

The spawnargs starting with clone (or seed_clone if set on a target entity) will achieve the desired effects. In the following we only describe the "seed_xxx" variants that are set on a target entity or target class. If you set the same spawnarg without the "seed_" prefix on the SEED entity itself, it will affect all target entities in the same manner, unless overridden by the target class' spawnargs:

seed_clone_strategy

String, one of the following:

  • none (the default) - entities of this class will not be cloned after placement
  • regular - a single row, a 2D array or a 3D array of entities, see seed_clone_ofs
  • random - randomly offset clones

seed_clone_count_min/seed_clone_count_max

Integer, defaults 1. Gives the minimum and maximum number of clones. For each entity position, will be randomly chosen between these values. Note that if you set minimum and maximum to different values, then the final count is subject to adjustment depending on the GUI setting Object details, where f.i. "Lowest" will bias the count to be lower, and "Highest" will bias the count to be higher.

If seed_clone_strategy is "regular", you can also give two or three numbers:

This will generate 5x3 entities:

"seed_clone_count_min" "5,3"
"seed_clone_count_max" "5,3"

This will generate a cube of 2x3x4 entities:

"seed_clone_count_min" "2,3,4"
"seed_clone_count_max" "2,3,4"

seed_clone_ofs_min/seed_clone_ofs_max

Either:

  • One integer, defaults 16. Used when "seed_clone_strategy" is "random".
  • Three integers, defaults to "16,16,16". Used when "seed_clone_strategy" is "regular", then it will offset each entity by the amount given in each axis, depending on what seed_clone_count_min is.

Full example:

"seed_clone_count_min" "2,3,4"
"seed_clone_count_max" "2,3,4"
"seed_clone_ofs_min" "4,4,4"
"seed_clone_ofs_max" "8,8,8"

This will generate a cube of 2,3,4 entities, and each entity will be offset between 4 and 8 units from the next entity.


See also