My New Project: Conway’s Game of Life
Sometime around the start of December I was reminded of Conway’s Game of Life – a mathematical “game” that I was first introduced to in my grade 12 programming class. Unfortunately for me and my research, I found the game much more interesting this time around and have proceeded to spend almost the entire last month dedicated to it.
It started out innocently enough; I thought that a webpage that uses the canvas tag to run the Game of Life would be the perfect way to hammer home what I was talking about in this post. It turns out that the game gets quite computationally intensive for even moderately-sized patterns however, so although the tool was functional, it chugged. What would be the solution to this problem? Write the tool in a pre-compiled programming language like Java, of course.
There are several Java implementations of the game freely available on the internet, but at this point I wanted to make an online tool that does a bit more than just evolve patterns; I wanted also to be able to upload, save, and download pattern files from the tool, something that is quite impossible from a Java applet. Also, because building interfaces for Java applets is a bit of a chore, most of the pre-existing Java applets implementing the game are a bit hard to look at. All of these problems can be solved via a bit of server-side ASP and some Java-to-javascript communication, fortunately (something I will post about separately later).
The end result? Well, I don’t really know yet, but here’s the beta 0.2.0 result:
The Java applet that runs the game itself is based on Alan Hensel’s brilliantly fast Java staggerstep algorithm, with some added file manipulation functionality and a dynamic online database of patterns. The applet is still very much a work in progress and there are quite a few known bugs, but it works well enough for now.
The real star of the website for now is the LifeWiki, which I’m hoping will fill a huge gap on the internet that I was rather shocked to find – even though there are many great homepages with bits and pieces of information about the game scattered across the internet, there really is no central resource that catalogues everything about the game; LifeWiki will hopefully fill that gap. I have started it off with some 150 articles and uploaded as many images, but I’m hoping that I can draw a few other Life enthusiasts to the wiki to help expand it so as to ease some of the burden.
Anyway, that’s about all I have to say for now about the website; I’ll likely make another post or two in the reasonably near future with coding tips/tricks based on my experience making the tool and site in general. Until then, I present to you my favourite pattern for the Game of Life, the Canada goose:
PS. Happy birthday to me!
So that’s where you’ve disappeared to recently! There, I made some hopefully vaguely helpful contributions. Now finish up and then sneakily edit a link to your version into the wikipedia article to generate some actual attention (plus, your version is actually nice and pretty and stuff).
Also, on a random note, I’ve actually been to a few Conway lectures, some 5.5 years ago now, albeit more about Knot theory and some games and some general things about dealing with infinity, and not about Life. He’s fun to listen to, and quite cool, anyway.
Yeah, silly me always getting sidetracked with new projects :$
I have a few things I wanna fix up with the tool itself and a few more pages I wanna fix up/add to the LifeWiki before I advertise it around too much, but it’s coming along pretty nicely. And thanks for signing up at the wiki, I got way too excited when I saw that someone else finally added a page 😉
It seems quite nice and very useful but It’s not working with my browser, all the menus and controls except for the slider on the left hand side are visible for just enough of a second to catch the flash of them existing before being over written with the field. I was really hoping to get to look at long term patterns since this has the ability to be the largest grid I could find on the internet.
I forgot to say that my browser is safari which strikes me as rather ironic in some way.
@anders
Strange, I use Chrome which also uses Webkit, so I assumed it would behave the same as Safari. Until I get this fixed, you could try using it in Firefox, since that for sure works. Alternatively, Alan Hensel’s applet at http://www.ibiblio.org/lifepatterns/ can be scaled to be a large as you want, though I’m not sure if you can load in external pattern files or not.
Thanks for letting me know.
Upon looking into this deeper, it looks like there genuinely isn’t a solution to the problem for Safari (Safari just doesn’t play nicely with drawing stuff over top of Java applets — see http://discussions.apple.com/thread.jspa?threadID=1936634&tstart=135)
Anyways, I’ve added a “compatability mode” to the site that at least makes the webpage usable for Safari users. If you access the website via Safari, the controls now appear at the top-right corner of the page rather than the bottom-right. Let me know how that works for you.
thank you
well, I tried fire fox and it has the exact same problem for me, so I don’t know where the problem is coming from.
Hi I’m making a Game of life implementation for C++ at my University. And I wish to add your online database to my app. Is this possible ? Ok I know that if I ask Your database will let me see any pattern I know. But the problem is that I need to discover names of patterns first. Is this possible with your database.
(Simple string with names will be enough).
And can you tell me how often new patterns are added to database ? (To avoid querying database every start looking for new ones).
@przemo_li – New patterns aren’t added terribly frequently (basically just as they are discovered at this point). Certainly no more than one or two are added a week nowadays.
As for the accessing the pattern database itself, you could have your program access the following HTML file, which auto-updates itself on my server:
http://www.conwaylife.com/gollycomplete.html
Note though that the links on that page are not normal HTML links (for example, the link for the first file is “get:pattern.asp?p=101.rle”), so you will have to alter the link a bit to access the actual RLE file on my server (for example, the correct link would be “http://www.conwaylife.com/pattern.asp?p=101.rle”).
Alternatively, if you just want to download the entire pattern collection to have an offline version of it, here is a reasonably up-to-date .zip file of it:
http://www.conwaylife.com/forums/download/file.php?id=32
All the best!
Thank You. I think downloading .zip and checking for new not listed in zip file would be the best.
And I’ll add links to your wiki as your applet do.
Your project seems to be very nice and ambitious. I think your site will be the best Conway’s Game of Life site when you get your applet to work. As it is now, it makes my firefox browser to crash and it doesn’t work at all in Chrome.
I have started a similar project for similar reasons. At the time I started, I was looking at Google Web Toolkit (compiles Java code into JavaScript) and did some searched on Google for Game of Life and found that the top results where not so very impressing. I thought I could do something better with GWT with the additional benefit that no Java plug-in would be necessary.
The result can be found on:
http://www.conwaysgameoflife.net
I also plan to add a pattern archive and maybe possibility to save patterns. I would like to spend more time on it but to get that time is a problem for me. I will probably make it open source soon so other people can add futures to it.
BOO
I have not seen any new material in your LIFEWIKI in a good while. I found this link while seeing if any new LIFE website has arisen. Today I extirpated 6 websites from my favorites links ,two were app. abandoned by their managers and I was tired of waiting, two were schlubby cartoon sites, and two were unwanted BINGs. I schelduled their deletion today, having given their managers more than enough time to quit their games and revitalize their websites.
Hopefully I won’t have to delete YOU and Lifenews(Pentadecathlon.com – laptop just sits on its hands if I try to log on).
I have ~365 oscillators (I can’t get an exact count),~136 spaceships (again unable to get an exact count), 14 puffer trains, 5 guns, 1 factory, 3 Rakes, 6 stretchers *, 1 Space-Filler. I can’t manage the HUGE patterns that calculate prime numbers, etc. My highest oscillator is P256, but I have schematics for a P598 system (needs finer resolution graph paper).
I hope this is not a deadened website,that my comment won’t be just spit back with a ADDRESS NOT FOUND message.
I also have many,many ancestors to still-lifes AND to common patterns. Both long-term and not so long-term
* Stretchers include 2 Growing Spaceships, 1 wick-stretcher …
@Paul Wilson – LifeWiki is, as its name suggests, a wiki. You’re very welcome to start/refine articles on it if you think it is missing important/new information. Myself and other editors try to keep it up-to-date as new important patterns are discovered (e.g., Gemini), but we can’t just make up new information to add to it if we’re not made aware of it.
Post your patterns on the ConwayLife forums (www.conwaylife.com/forums) if you want other people to see them.