| 12 | |
| 13 | == Randomness == |
| 14 | |
| 15 | To allow some visual variety between otherwise-identical units, actors can contain 'random' elements. (They are not strictly random - a designer can choose a particular variation of the actor.) |
| 16 | |
| 17 | To achieve this, the actor is split into a set of ''groups'', each of which contains several ''variants''. |
| 18 | |
| 19 | The ''frequency'' of each variant controls how likely it is to be chosen. If a variant's frequency is set to 0, it will never be chosen by the randomiser. A zero-frequency variant can still be selected by the game - for example, actors could have 'Summer' and 'Winter' variants, with the default always being Summer, and then the game could change the whole world to Winter. |
| 20 | |
| 21 | For example here is how an actor might appear in actor editor:[[BR]] |
| 22 | |
| 23 | [[Image(actoreditor.png, 50%)]] |
| 24 | |
| 25 | This female citizen has 3 groups: one with a single variant called "Base", a second with variants for model and texture, and a third group for prop variants. |
| 26 | |
| 27 | * In the first group, the "Base" variant will always be chosen as there is no other variant and its frequency is 1. This variant defines props and animations common to all the other groups. Note that a prop is also an actor and may be randomized in its own file, as in this case. We only need to reference a single "dudette_head" prop actor which can vary in texture, shape, and other qualities. |
| 28 | * The second group contains different body models and textures. This flexibility means we can have a single mesh with altered appearance due to random texture variants. |
| 29 | * The last group contains prop variants which differ based on the actor's current behavior. If the female is idle, her hands will be empty; if she's woodcutting, she will have an axe in her left hand, etc. She will be idle by default, since that's the only variant in this group with a non-zero frequency. The game's logic will select other variants when appropriate. |