Posts

Showing posts with the label Conway's Game Of Life

Game Of Life Render

Image
Having completed my game of life script I wanted to get a nice render of it, which I've finally gotten around too. I wanted to make a grid of marbles, each different colours, however having around 2000 in total in the scene that was not gonna happen by assigning them manually. After a lot of trial and error I found a way to get what I wanted. First I created a procedural texture of squares, each different colours from the 6 base colours I chose. I then positioned this under the spheres. I gave every sphere a completely see through glass material, and disabled primary viability of the plane. This meant the refracted colour of the plane could be seen in the marbles but not the marbles themselves. I think this worked pretty well, definitely more efficient than  assigning  all the objects a material.

Conway's Game Of Life (FINISHED!)

Image
It finally happened! Definable number of lives, can easily scale or shrink and the edges are fully wrapped around. Here I've got a grid of 14*14, looping 100 times, which is why it cuts off towards the end. After thinking through and working out on paper how to wrap the edges, the easiest way I found was to create a buffer edge around the matrix, which is never displayed in 3D, and copy values from the edge of the 3D matrix into the buffer, this allowed all the code I had written before to still work, and I just had to work in the new parts to get it wrapping round. So happy with the result! I want to work now on rendering it nicely, changing the cubes for something else perhaps, and getting something lit and rendered to have a nice version to show, coding wise in future I may look into creating starting cubes, to define certain patterns that will create specific results, such as this from the wiki page.

Conway's Game Of Life V1

Image
After several different attempts here is my first working Game of Life running in Maya, scripted in MEL! I'm so pleased that I finally got it working! All the rules are working properly, the size of the grid can be changed easily, as well as the number of lives. I wont call it 100% finished quite yet as at the moment the edges and corners are not included, for the moment they are stationary but I would like to get it finished off by looping the sides around. The whole thing involved a crazy amount of problem solving and thinking around different issues,  I went through several iterations,  optimizing and  cutting it down, or improving parts of it, before I got to this stage.