Cellular Automata Object

This object simulates what are sometimes called 'cellular automata'. You can find more information online at these Wikipedia links:

Elementary cellular automata

The Game of Life

Diffusion-Limited Aggregation

All these modes work on a virtual grid in which one grid point contains zero or one particles. New particles are produced by following rules which vary between the different modes.

Please see the section 'Notes on Use' for any issues regarding this object.

Interface

The object's interface contains the following sections:

Parameters

These can be grouped into four categories:

General quicktab

1. Parameters common to all modes

This object needs an emitter to generate particles; drag an emitter into this field. The emitter will automatically be switched into 'Controlled Only' mode, just as it would in the Spawn modifier, for example. This means that particles will only be emitted when instructed by the Cellular Automata object. You should not change this setting.

Add Emitter

Click this button to create a new emitter and add it to the 'Emitter' link field.

Mode

With this drop-down menu you can choose the mode of operation. It has three options:

Elementary

This is the simplest mode and will generate a variety of two-dimensional patterns which vary by the rule chosen in the 'Rule No.' field. These are the classic 256 different rules for elementary cellular automata and this link gives examples. Note that some rules are much more interesting than others. Rule 90 is the default, which produces the iconic Sierpinski triangle.

Game of Life

This mode implements Conway's Game of Life. See the Wikipedia link or the many references on the net for more information. This version follows the classic rules developed by John Conway.

Diffusion-Limited Aggregation (DLA)

This is the most interesting mode. It is an example of simple diffusion-limited aggregation, in which particles stick together to form aggregates or clusters. This mode is the default for the object.

Seed

This is the seed value used for the random number generator in the object. For 'Elementary' mode, it is only used if the switch 'Start in Random State' is turned on and the 'Threshold' value is less than 100%.

Start and Length

In these modes these settings control when the simulation starts and how long it is. If you need the simulation to be as long as the scene, simply set the 'Length' value to be the scene length.

Note that with 'Elementary' mode the animation may halt before the 'Length' time has elapsed, if the grid has been filled. In 'Game of Life' mode, the animation will continue to run until the 'Length' period has elapsed.

In 'DLA' mode the animation will continue to run until the time given in these values has elapsed, but no more particles will be generated even if the time has not elapsed if it is not possible to grow the particle mass any further.

'Length' also controls the colour and/or radius changes, if these are enabled (see below).

2. Parameters used in 'Elementary' and 'Game of Life' modes

In 'Elementary' and 'Game of Life' modes, the interface changes slightly (the 'Rule No.' and 'Start in Random State' settings are not available in 'Game of Life' mode):

Rule No.

The rule used for the 'Elementary' mode. It is not available in 'Game of Life' mode.

Start in Random State

Only available in 'Elementary' mode. By default this switch is unchecked, and the starting point (the 'seed') for the simulation will be one single particle in the centre of the top row of the grid. If this switch is checked, particles are randomly generated along the top row to produce multiple seed points. The number of seed particles is controlled by the 'Threshold' setting.

Threshold

This setting controls how many seed particles are produced at the start of the simulation. For 'Elementary' mode, these are generated on the top row of the grid, so that if the grid has a width of 100 cells and the threshold value is 50%, about 50 of the 100 cells will contain a particle at the start.

For 'Game of Life' the particles are randomly distributed across the 2D grid and this value controls how much of the grid is initially filled with particles when the simulation starts.

Grid Width and Grid Height

The width and height of the grid in terms of the number of cells it contains.

If the cell size changes, the number of cells will not change, therefore the grid will keep the same number of cells but will change in size, though you will not see this until the animation runs.

If you alter these values the cell size is unaffected, so the number of cells will change.

Interval Time

This is only used for 'Game of Life' and is the interval between iterations of the simulation. By default it is set to zero, so another iteration will occur on each frame, which results in a very fast simulation. If you set it to any non-zero value, that much time elapses between iterations. This lets you see more clearly what is happening to the particles.

Cell Size

The actual space in scene units between each cell. You can increase this if you want to use larger particles to avoid them overlapping, or decrease it for small particles and a higher-resolution result.

Altering this parameter will increase or decrease the size of the grid but the number of cells will remain the same. You can also alter the size of the grid by changing the 'Grid Width' and 'Grid Height' values.

3. Parameters used only in DLA mode

The following settings are used only in Diffusion-Limited Aggregation (DLA) mode. Note that in this mode the size of the area occupied by the simulation is shown by a yellow box.

Operation

In all DLA simulations, an initial seed particle (or multiple seed particles) is generated, followed by more particles which 'walk' around the grid forming a cluster. This continues until they come into contact with an existing particle. Where the initial seed(s) are located will have a significant effect on the resulting pattern. This drop-down allows the selection of different seed modes. The number of seeds generated is controlled by the 'Number of Seeds' parameter (except in 'Use Target Objects' mode)..

The available options are:

Centre

One or more seed particles are generated at the centre of the grid and new particles 'walk' in from outside the growing cluster. There is actually no point in having more than one seed in this mode, since the resulting particles will all follow the same pattern. More than one seed will simply slow the simulation down.

Top Centre

Seed particles are placed at the top of the grid in the centre. If more than one seed is generated, they will be evenly spaced along the top centre line of the grid.

Bottom Centre, Left Centre, Right Centre

These are the same as 'Top Centre' but the seeds are placed at the centre of the respective side.

Random Cell

The seed cells are generated randomly and therefore their position will change if you change the 'Seed' parameter.

Use Target Objects

This option allows you to specify the starting point by placing one or more objects inside the solver and dragging them into the 'Target Objects' list. You can use any object but the only thing that matters is its position, so a null object will work as well as any other.

The 'Number of Seeds' parameter is not used in this mode as one seed will be generated for each object in the list.

Note that the object MUST be located inside the solver; if it is outside, no particles will be generated. Also note that changing the object's position after the simulation starts will have no effect.

Determined by Emitter

In this mode the emitter itself will determine where the seed particles are located. The emitter can then be used to generate particles from any emitter shape, object, selection, etc., just as with any emitter. If the resulting particle is outside the solver it will be discarded and not used. It is up to you therefore to arrange the emitter or emitting object within the solver so that valid seed particles are produced.

The 'Number of Seeds' parameter controls how many seed particles the emitter is asked to generate. You may see fewer seeds than the requested value if some particles fall outside the solver box.

Cell Size

This is the size of the cell in screen units. If you change this the number of cells in the solver will change and the size of the solver box may change slightly to reflect this.

As a general rule, if you want to use the generated particles as the source for a Skinner object, then you should keep the solver resolution low and use a large cell size (10-20). But if you want to generate attractive patterns to be rendered with the XP material you need a high resolution with a small cell size (2-3 is recommended).

Solver Size

The size of the solver in screen units. You can also change this with the usual resizing handles on the solver box. If you change the solver size the number of cells in the solver will also change.

By default the solver is set to 400 x 400 x 10 units, which with a default cell size of 10 units gives 40 x 40 x 1 cells in the grid. In general the best results are obtained with this kind of two-dimensional grid but you can increase the Z-axis value to give three-dimensional clusters if desired.

Number of Seeds

The number of seeds to be generated. Not available in 'Use Target Objects' mode, when the number of seeds is determined by the number of objects in the 'Target Objects' list.

Seeds to Groups

If the emitter has one or more groups in its 'Groups' list it will place the generated particles into groups according to the rules in the emitter. This will mean that the groups are spread randomly over the different particle clusters in the solver.

If this switch is checked, all the particles in a cluster will be placed in the same group and different clusters will use different groups. There are some rules to follow to ensure that this works:

  1. You must have one group per cluster (the emitter can have more than that number of groups in its list but only the ones which are required will be used).
  2. The groups MUST be in the emitter's Groups list. Groups not present in that list will not be used.
  3. The cluster from the first seed will be placed in the first group, the second seed's cluster in the second group, and so on.
  4. If there aren't enough groups for all the clusters, those clusters without a group will be added to the last group in the list, but the seed particle will be placed in the first group. This may give different colours for the seed particle and other particles in the cluster, which serves as a warning that you don't have enough groups for all the clusters being generated.

Draw

By default, in DLA mode a box showing the solver size will be shown on screen, plus a grid on the 'back' wall of the solver to show the cell size. This drop-down menu allows you to turn off the grid and only show the box, or to draw nothing at all.

Walkers per Frame

A 'walker' is an invisible particle which randomly walks around the grid until it hits the growing cluster. At that point it sticks to the cluster (subject to the 'Stickiness' setting, see below) and becomes fixed and visible. A value of 1 in this setting would generate one walker per frame, which would take a long time to grow a reasonably-sized cluster! By increasing this value you can generate multiple walkers each frame but then each frame will take longer to execute and the animation of the cluster growth may appear to pop in; a lower value gives smoother growth but requires more frames for the same result.

The default value of 20 is actually quite a conservative one and you should be able to increase this to 50-100 without undue slowing down.

Walker Steps

Once a new walker has been generated it will be 'walked' in random fashion around the solver until it hits a cell which has been filled by a particle already. When it does, it will stick to that cell (subject to the 'Stickiness' setting) and a new particle is generated.

This parameter controls how many steps the walker will take before finding a filled cell to stick to. If it hasn't found a cell after this many tries it gives up and a new walker is generated, up to the limit in 'Walkers per Frame'. The higher the number of steps, the greater the chance that the walker will find a particle to stick to, so particle counts are higher and the cluster a little more dense. In general you need only increase this value if you find that few particles are being generated and the cluster is slow to grow.

Stickiness

By default, this is set to 100% which means that a particle will stick to the cluster as soon as it hits an existing particle. Most frequently the particle which is hit will be on the extremities of the cluster, leading to long, feathery clusters. Reducing this value will reduce the chance of the particle sticking on its first hit, so some will stick to existing particles deeper within the cluster, leading to a more dense, solid appearance.

Orthographic Only

If this switch is unchecked (the default state) newly generated 'walker' particles may be located at any of the cells surrounding an existing particle. This means that the network can grow diagonally as well as along the X, Y, and Z axes. If the switch is checked, the network cannot grow diagonally but only along the three axes.

This is of most use when you have multiple seeds. If this switch is unchecked, the particle clusters can intermingle, with branches of one cluster crossing over branches of another one. If checked, this cannot happen. You will see that the when checked the clusters are more solid and tend to produce a mass of particles; when unchecked, the tendency is to produce long branching chains of particles.

A list for the target objects when using 'Use Target Objects' mode.

Colour & Scale quicktab

Color by Generation

This switch is only enabled in 'Elementary' or 'Game of Life' modes.

If this switch is enabled, the particles will be coloured according to the time at which they are generated. Particles generated at the start of the animation (the 'Start' time) will receive the colour at the left of the 'Color' gradient; particles generated at or after the 'Length' time has elapsed will receive the colour at the right of the gradient.

Also note that in both 'Elementary' and 'DLA' modes the generation of new particles may cease well before the 'Length' period has elapsed, in which case you may never see colours towards the right of the gradient. If that happens you should adjust the 'Length' setting accordingly.

Color Mode

This drop-down is only used in 'DLA' mode. It controls how the particles are coloured. The options are:

Particle

The particle colour is used without changes.

Random

A random colour from the 'Color' gradient is used.

By Generation

This mode works in exactly the same way as the 'Color by Generation' switch in 'Elementary' or 'Game of Life' modes.

By Cluster

In this mode each cluster is given a different colour from the 'Color' gradient. If there is only one cluster, the colour at the right-hand end of the gradient used.

Color

The colour gradient to use if 'Color by Generation' is checked or 'By Generation' mode is selected in 'Color Mode'..

Scale Radius

As with particle colour, so too you can change the radius of the generated particles according to their time of generation. In this case a spline control is used to scale the radius up or down.

Scale Spline

The spline control to use if 'Scale Radius' is checked.

Notes on Use of the Cellular Automata object

Using modifiers with this object

You should note that the way particles are generated when using this object is slightly different from normal particle emission. Usually, the emitter will emit a particle then call any available modifiers to act on it. So for example if you use a Scale modifier to change the radius this takes place before the particle is displayed, and you see the radius you would expect.

With this object, the emitter does not emit particles until forced to do so by the Cellular Automata object. This happens outside the normal sequence, so if using a Scale modifier the particle would first appear with the radius as set by the emitter, and only in the next frame will this be changed by the modifier. This issue applies not only to the particle radius but to any modifiers which alter parameters set by the emitter (e.g colour, mass, temperature, etc., etc.).

To avoid this, simply set the initial value in the emitter to match the value expected from the modifier and you won't see a sudden change in the parameter.

Using subframes with this object

If you increase the number of subframes in the X-Particles project settings from the default of 1, this may sometimes cause a problem. Note that more subframes would not normally benefit this object at all, since the particles are stationary. But if you need them for other purposes, be aware that it will prevent the particle colour mode 'Gradient (Parameter)' from working correctly.

What you will see is that the particle will initially have the default particle colour but in the next frame it will change to the colour expected from the gradient according to the chosen parameter. The reason is exactly the same as explained in 'Using modifiers with this object' above.

The only solutions to this problem are either to choose another colour mode or to reduce the subframes to the default of 1.