AADRL Game of Life - Workshop II

Page 1

CELLULAR AUTOMATA

CONTINUOUS PATH GENERATION

INSTRUCTED BY

MUSTAFA EL SAYED OCTAVIAN GHEORGHIU

TEAM

CALEB BALDWIN DIDEM SAHIN SIEJHIH CHEN TAEYOON KIM


DEFINITIONS GAME OF LIFE

The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive or dead, or “populated” or “unpopulated”. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur: 1.

Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.

2.

Any live cell with two or three live neighbours lives on to the next generation.

3.

Any live cell with more than three live neighbours dies, as if by overpopulation.

4.

Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

The result is a pattern that emerges automatically based on the rules and the seed image.


DEFINITIONS SEED

Seeds are a black and white grid of pixels, at a variety of resolutions, that are used to start the Game of Life. The black pixels interact with their surroundings according to the rules of the game.

resolution I 15 x 15

resolution I 100 x 100

VOXEL

A voxel is a three-dimensional pixel. It is used to build the cellular automata in a three-dimensional way in response to the seed image.


GAME OF LIFE / EXPERIMENTING WITH SEEDS Scripting through Unity with C#


OUTCOME OF THE SEEDS


B/W CELTIC Game Inspiration 3 Elements: • The first player (Orange) owns the 10 tiles with or ange background • Blue owns the 10 tiles with blue background • both players share the 5 neutral tiles with white background

The neutral tile with the most crossings is placed in the middle of the playing area to start the game. Players then take turns adding either a tile of their colour or a neutral tile to extend at least one path end on the main group.

•Background color does not have to match. •The connection must be maintained as tiles are added

The growing design must fit within an imaginary 5x5 grid at all times, and moves that would let it extend beyond this limit are not allowed. Players who cannot make a move must pass that turn. The game is won by the player with the highest knot score, which is given by number of tiles of their colour visited by a single knot. The maximum number of cubes required for a given board size is given by the tetrahedral number Tn = n (n + 1) (n + 2) / 6


CONCEPT / CONTINUOUS PATH


NEIGHBOURHOOD CONNECTIONS / TYPES OF VOXELS a

d

b

c

Direction direction 0 0

Direction direction 1 1

Direction direction 2 2

Direction direction 33

DECIDING VOXEL

Deciding Voxel

Direction direction 4 4

Direction direction 5 5

Direction direction 6 6


HOW CONNECTIONS ARE MADE

A

D

(T/F)

D

A

A

B B A (T/F) (T/F) C

C

D

(0,1) (0,1) B(T/F) B(T/F) D(T/F) C(T/F) C(T/F)

D

A

A

C A

C A

A

B BD (0,1) DB (0,1) D (1,1) C A

(0,0) DB (0,0) D (1,0) B B D C C

C


CONNECT 2D EXPERIMENT 1

CALCULATE CA

CONNECT 2D

KILL FUNCTION


INITIAL OBSERVATION


CONNECT 2D EXPERIMENT 1

resolution I 15 x 15


CONNECT 2D EXPERIMENT 2

resolution I 15 x 15


CONNECT 2D EXPERIMENT 3

resolution I 100 x 100


CONNECT 2D EXPERIMENT 3


CONNECT 2D

resolution I 15 x 15

resolution I 15 x 15

resolution I 50 x 50


PROBLEM SOLVING / IMPROVING CONTINUITY


2D CONNECTION RULES - Giving priority to the straight line types to gain straight, continous path. - Loops (Block stabilisers) introduce discontinuity - Life & death rule can be controlled to manipulate the progressÄąon of the paths - Initial death rule we had (Three-side connection = Death) creates loops


ISSUES WITHIN PRELIMINARY CODE

ISSUE OF CROSSES

ISSUE OF LOOPS (STABILISER)

- Initiatıng point/End Point - Limiting the number of each type - Random shuffle to eliminate the crosses (type0).

- Limiting the number of each type - Define loops and make exceptions. - Introducıng ‘T’ types.


INTRODUCING T TYPES TO ENHANCE CONTINUITY T types also introduce

a new way to evade fragmenting, and embed them wıthin the path


OPTIMISATION / EXPERIMENTING WITH INPUT


ORIGINAL CA RULES APPLIED

NUMBER OF

0

217 8 2 0

1

death rules

1

live rules

death voxels: alive voxels: paths: loops:

resolution I 15 x 15

0

NUMBER OF

resolution I 15 x 15

death voxels: alive voxels: paths: loops:

207 18 7 0


WHEN ALL VOXELS DIE OUT

NUMBER OF

0

0 0 0 0

1

death rules

1

live rules

death voxels: alive voxels: paths: loops:

resolution I 15 x 15

0

NUMBER OF

resolution I 15 x 15

death voxels: alive voxels: paths: loops:

0 0 0 0


FRAGMENTED PATH

NUMBER OF

0

159 66 0 0

1

death rules

1

live rules

death voxels: alive voxels: paths: loops:

resolution I 15 x 15

0

NUMBER OF

resolution I 15 x 15

death voxels: alive voxels: paths: loops:

159 66 0 0


LOW CONNECTIVITY

NUMBER OF

0

137 88 15 0

1

death rules

1

live rules

death voxels: alive voxels: paths: loops:

resolution I 15 x 15

0

NUMBER OF

resolution I 15 x 15

death voxels: alive voxels: paths: loops:

129 96 16 0


ENHANCED CONTINUITY AND CONNECTIVITY

NUMBER OF

0

109 116 11 0

1

death rules

1

live rules

death voxels: alive voxels: paths: loops:

resolution I 15 x 15

0

NUMBER OF

resolution I 15 x 15

death voxels: alive voxels: paths: loops:

150 75 7 0


HIGH CONTINUITY WITH LOW CONTUNUITY

NUMBER OF

0

84 141 19 0

1

death rules

1

live rules

death voxels: alive voxels: paths: loops:

resolution I 15 x 15

0

NUMBER OF

resolution I 15 x 15

death voxels: alive voxels: paths: loops:

86 139 19 0


HIGH CONTINUITY WITH LOCAL DISCENNECTIONS

NUMBER OF

0

83 142 12 0

1

death rules

1

live rules

death voxels: alive voxels: paths: loops:

resolution I 15 x 15

1

NUMBER OF

resolution I 15 x 15

death voxels: alive voxels: paths: loops:

83 142 9 0


HIGH CONTINUITY WITH LOCAL DISCENNECTIONS

NUMBER OF

0

81 144 12 0

1

death rules

1

live rules

death voxels: alive voxels: paths: loops:

resolution I 15 x 15

1

NUMBER OF

resolution I 15 x 15

death voxels: alive voxels: paths: loops:

77 148 8 0


OVER POPULATED

NUMBER OF

1

188 37 2 1

1

death rules

1

live rules

death voxels: alive voxels: paths: loops:

resolution I 15 x 15

1

NUMBER OF

resolution I 15 x 15

death voxels: alive voxels: paths: loops:

44 181 2 0


CONCLUSION ORIGINAL CA

DIE OUT

LOW CONNECTIVITY

NUMBER OF

NUMBER OF

NUMBER OF

NUMBER OF

NUMBER OF

NUMBER OF

death voxels: 217 alive voxels: 8 paths: 2 loops: 0

death voxels: alive voxels: paths: loops:

death voxels: 159 alive voxels: 66 paths: 0 loops: 0

death voxels: 83 alive voxels: 142 paths: 9 loops: 0

death voxels: 150 alive voxels: 75 paths: 7 loops: 0

death voxels: 44 alive voxels: 181 paths: 2 loops: 0

SEED

0 0 0 0

SEED

SEED

FAILURE

FAILURE

FAILURE

THE ORIGINAL CA RULE GIVES A RESULT WHERE WE GET BLOCK STABILISERS.

ALL THE VOXELS HAVE DIED OUT IN THE PROCESS

THECONNECTIONS ARE FRAGMENTED AND DISCONTINUED.

HIGH CONNECTIVITY

SEED

OVER POPULATED

SEED

SUCCESS THE RESULT START TO RESEMBLE A CONTINOUS PATH AND WE START TO SEE LINES WHICH CONNECT WITHOUT BRANCHING OUT ALL SIDES OR DISCONNECTING - CLOSER TO OUR CODE.

FAILURE THE GRID IS OVERPOPULATED AND THE CONNECTIONS ARE FORMING LOOPS, RATHER THAN A CONTINUOUS PATH


CA GRID

CA GRID

Definitions of Variables

Width, Length, and Height GameObject[ , , ] voxelGrid;

CalculateCA ( )

Get State & Set Future State

Time Spacing Start ( )

Width & Length according to Seed Height = Time CreateGrid ( )

Update ( )

Life & Death Rule (2,4,3,4)

Connect 2D ( )

For each voxel, check surrounding 4 neighbors to determine which side it can connect to - bool Up / Down / Left / Right Set type according to neighbor conditions

CalculateCA ( ) UpdateVoxel( ) SaveCA( ) + Save type Connect2D( ) UpdateVoxel( ) DisplayVoxel( ) CurrentFrame ++

CreateGrid ( )

VoxelGrid[i,j,k] Define Voxel (Object, Position, Rotation) Read input pixels of the seed Set state + Set type

Define environment E as the number of living neighbors required to prevent a currently living cell from expiring, with El ≤ E ≤ Eu Fertility F is the number of neighbors required to create a new living cell, Fl ≤ F ≤ Fu . Define the transition rule R as the 4-tuple (ElEuFlFu). For Conway's Life, R = (2333).


CA GRID

VOXEL

Definitions of Variables

State / Future State

State = _State

Type / Future Type Bool A / B / C / D

UpdateVoxel ( )

Set State ( )

Set Future State ( )

Future State = _Future State

GetState ( )

Returns state value ( 0 or 1 )

SetType ( )

Type = _Type

State → Future State Type → Future Type SetupVoxelType(futureType)

Set Up Voxel Type ( )

Type → _Type Assign voxel type according to the boolean values of the four sides.

Set Future Type ( ) Display Voxel ( )

If dead ( state == 0 ) renderer is set to false ( invisible ). If alive ( state == 1 ) renderer is set to true ( Visible ).

Get Type ( )

Future Type = _Future Type

Returns type value ( 0 to 10 )


SUMMARY Having learned from our research, we were able to optimise our code to achive this type of result. All of the lines are continious and there is only one loop within the whole grid. A maze like pattern emerges as a result..




APPLYING HEIGHT 3D VISUALISATION


ur-way

CONNECTION IN 3D

two-way five-way 6-WAY

one-way four-way four-waythree-way 5-WAYfive-way 4-WAY

one-way one-way four-way two-way 3-WAY

two-way one-way three-way two-way 2-WAY


CONNECTION IN HEIGHT

LAYER n+1

LAYER n

Checking the layer below, if there is a voxel present, the bottom connection is set to true.


LEARNING FROM THE 3D MODEL

- The types of voxels that are needed ın our game of connectıvıty - Vertıcal connectıons ıntroduce new possibilitıes


3D VOXEL TYPES

TYPE 0

TYPE 1

TYPE 2

TYPE 3

TYPE 4

TYPE 5

TYPE 6

TYPE 7


XXX


XXX


XXX


XXX XXXXXX


MODEL / TOP VIEW OF THE FIRST LAYER


MODEL / TOP VIEW OF THE SECOND LAYER


MODEL / TOP VIEW OF THE THIRD LAYER


MODEL / TOP VIEW OF THE FOURTH LAYER


MODEL / TOP VIEW OF THE FIFTH LAYER


SUMMARY


xxxx

start

end

Like the swarm intelligence of the ants, the code will trace back the paths created, counting the number of voxels in each path to locate the shortest, most efficient path possible. Same principle can be extended to create a branching structure following the rules of lindenmeyer system, which self-generates and regulates.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.