SEED - Cloning: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Tels (talk | contribs)
add
 
No edit summary
Line 3: Line 3:
== Regular vs. Random layouts ==
== Regular vs. Random layouts ==


The current [[LODE]] 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.
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.  
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 similiar) group a few times.
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.


<!-- TODO: Insert screenshots of these scenarios -->
<!-- TODO: Insert screenshots of these scenarios -->


== LODE "clone" ==
== SEED "clone" ==


The spawnargs starting with '''clone''' (or '''lode_clone''' if set on a target entity) will achieve the desired effects. In the following we only describe the "lode_xxx" variants that are set on a target entity or target class. If you set the same spawnarg without the "lode_" prefix on the LODE entity itself, it will affect all target entities in the same manner, unless overridden by the target class' spawnargs:
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:


=== lode_clone_strategy ===
=== seed_clone_strategy ===


String, one of the following:
String, one of the following:


* '''none''' (the default) - entities of this class will not be cloned after placement
* '''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 '''[[#lode_clone_ofs|lode_clone_ofs]]
* '''regular''' - a single row, a 2D array or a 3D array of entities, see '''[[#seed_clone_ofs|seed_clone_ofs]]
* '''random''' - randomly offset clones
* '''random''' - randomly offset clones


=== lode_clone_count_min/lode_clone_count_max ===
=== 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 choosen 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.
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 '''lode_clone_strategy''' is "regular", you can also give two or three numbers:
If '''seed_clone_strategy''' is "regular", you can also give two or three numbers:


This will generate 5x3 entities:
This will generate 5x3 entities:


<pre>
<pre>
"lode_clone_count_min" "5,3"
"seed_clone_count_min" "5,3"
"lode_clone_count_max" "5,3"
"seed_clone_count_max" "5,3"
</pre>
</pre>


Line 39: Line 39:


<pre>
<pre>
"lode_clone_count_min" "2,3,4"
"seed_clone_count_min" "2,3,4"
"lode_clone_count_max" "2,3,4"
"seed_clone_count_max" "2,3,4"
</pre>
</pre>


=== lode_clone_ofs_min/lode_clone_ofs_max ===
=== seed_clone_ofs_min/seed_clone_ofs_max ===


Either:
Either:


* One integer, defaults 16. Used when "lode_clone_strategy" is "random".
* One integer, defaults 16. Used when "seed_clone_strategy" is "random".
* Three integers, defaults to "16,16,16". Used when "lode_clone_strategy" is "regular", then it will offset each entity by the amount given in each axis, depending on what '''lode_clone_count_min''' is.
* 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:
Full example:


<pre>
<pre>
"lode_clone_count_min" "2,3,4"
"seed_clone_count_min" "2,3,4"
"lode_clone_count_max" "2,3,4"
"seed_clone_count_max" "2,3,4"
"lode_clone_ofs_min" "4,4,4"
"seed_clone_ofs_min" "4,4,4"
"lode_clone_ofs_max" "8,8,8"
"seed_clone_ofs_max" "8,8,8"
</pre>
</pre>


Line 64: Line 64:
== See also ==
== See also ==


* [[LODE]]
* [[SEED]]


{{editing}}
{{editing}}

Revision as of 21:34, 13 April 2011

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