A take on Conway's Game of Life
Galaxies is not your typical Game of Life software. While in most programms of that sort you can draw your own configurations and try them out, this application is more for observation, thought and aesthetic pleasure.
Basically, you get to lean back and watch a peculiar 2D universe evolve, live its busy life and die, listening to a droning ambient soundtrack, a distant signal from depths of space. Apart from watching, the program does allow you to interfere, plus there are several curious modes which go beyond usual Game of Life simulations.
- "Space" - start/pause process
- "z" - clear space
- "Z" - kill purple life (but it will not remove it)
- "1" - "5" - fill the universe randomly with varying density, from low to high
- "6" - "8" - erase cells randomly with varying density, from low to high
- "9", "0", "-", "+" - set speed from slow to fast; default speed is at "-"
- "p" - toggle Pulse of Life mode
- "g" - toggle 100 Gliders mode
- "g" - place Gosper Glider Gun in the center
- "v" - place Gosper Glider Gun at cursor location
- "m" - create middleweight spaceship in random location
- "o" - place an oscillator at cursor location
- "r" - place an R-pentomino at cursor location
- "l" - place a line of random length in random location
- "K" - create kaleidoscope-like pattern
- "UP", "DOWN" - control music volume
- "RIGHT" - switch to next track in playlist
- "LEFT" - pause/unpause; a bit counter-intuitive, but I did not want to use another key for this
- "/" - set background to black
- "?" - set random background picture, currently choosing out of 4
- "Esc" - quit program
Apart from Kaleidoscope and buttons "1"-"5", all pattern creation buttons will place a purple cell pattern if you press Shift+Button. For instance, SHIFT+v will place a Gosper Glider Gun at cursor location. Same works for Pulse of Life and 100 Gliders mode.
Left click erases cells which are within the cursor, right click hides/unhides cursor.
Orange color denotes new cells, blue color - stable cells and two-phase oscillators. Oscillators which have more than two phases will have orange cells showing up. At highest speed orange color seems more like red.
Pressing "z" not only clears all cells, but also turns off all modes. Pressing "Z" will kill purple life, without removing purple cells.
Purple cells work same way as all other cells, but they color any other cells they touch. This allows you to watch how a pattern you place evolves, since all of its contact with the rest of the cells in the universe is seen.
An important feature of purple cells is that the moment no new purple cells are created, purple life dies and will no longer color other cells. So if a standard blue pattern, like a glider, bumps into a living purple cell, during the course of interaction with it it will get colored into purple. If it bumps into a dead purple cell, it will instead color it into blue. By placing a pattern that produces live purple cells anywhere in the universe, all previously dead purple cells come back to life. Thus, purple life not only has a beginning, but also an end.
Pulse of Life mode
This mode creates a burst of cells in the center of a 2d universe at a regular inteval of 5 seconds. This feature makes a significant step away from the usual workings of Game of Life, which in most simulations depends on initial configurations and nothing else. Pulse of Life mode gives the universe an external igniter, a continuous source of life, while rules of the game govern what happens to life once it is born.
100 Gliders mode
Similar to an idea of Pulse of Life, 100 Gliders mode also provides a continuous igniter in form of gliders, which are propelled across the universe in four distances from the center. A glider appears every second and then chooses the direction it wants to travel in. The initial birth point of gliders randomly shifts 1 pixel in all directions, otherwise gliders would just destroy each other on direct collision. And, as the name suggests, the number of gliders is limited to 100. By toggling the process off and on, you reset the number of gliders back to the original hundred.
Mode best when initiated after clearing the universe with "z".
Kaleidoscope button simply creates a line of random length in the horizontal center of the universe. The property of any line in Game of Life is that it produces symmetrical patterns. By creating several lines you can get many beautiful results. See picture below.
Kaleidoscope pattern in Galaxies.
Just a simpliest two-phase oscillator, mostly to be used as an "egg" for purple life. Note that in Galaxies a two-phase oscillator is not considered to be a producer of new cells and thus placing a purple oscillator without any other active purple pattern will only result in dead cells which would not ignite purple life.
By pressing "r", you create an R-pentomino, a famous shape in Game of Life, discovered in 1970 by John Conway when there were no computers around. It is by far the most active polyomino with less than six cells; all of the others stabilize in at most 10 generations, but the R-pentomino does not do so until generation 1103, by which time it has a population of 116. The glider it releases in generation 69 was the first glider ever observed.
Pressing "l" gives you lines of small random lengths at random locations throughout the universe. Similar to Kaleidoscope, it creates small symmetric patterns all around.
Pressing "m" gives you the famous middleweight spaceship, in four random directions at random coordinates. If you create several of those, they usually end up creating a stable net of spaceships flying all around. Looks very neat.
For purposes of minimizing filesize, all mp3s are encoded in 56k. Due to the nature of music it sounds fine, but if I get enough requests, I will compile a version with a high quality soundtrack. Note that currently 15Mb of the application is music.
Galaxies is made with Processing. I based my code on Conway's Game of Life example at Processing.org, although obviously the programm becomes more and more sophisticated with every new version and the code is already several times larger than the original. Source code of Galaxies is included in the download.
The only confirmed problem with current version of Galaxies is that on Windows the square cursor is about 4 times larger than it is in the original Linux version. Looks ugly too. Probably, Windows expects some other image format.
Current version is 1.3. Pulse of life timing changed from 1 second to 5 seconds; R-pentomino now created at current cursor location as opposed to random location; purple life added, all pattern creation functions updated to support it; added Oscillator shape, mostly to be used for purple life.
Additionally, there is a "Galaxies Mini" available, with a smaller screen. It might be preferable to some who would like the program to be above all windows while they do something else and occasionally observe life in Galaxies without the program window taking up half of the screen. Also, because of a smaller size, the program works faster and the inclusion of purple life does not slow it (in the bigger version addition of purple life does slow down the speed of processing a bit).
Galaxies uses Java VM and thus is available for GNU/Linux, MacOS and Windows. Chances are, your machine already has Java VM installed. If you do not want to install Java VM, you can download a package provided below and unpack it into the folder with the application.