Hacker News new | past | comments | ask | show | jobs | submit login
Strategic Game of Life (thomashunter.name)
158 points by basicallydan on Dec 13, 2013 | hide | past | favorite | 66 comments



I love it!

Please create more puzzles/levels.

And please please try to improve the UI:

- I find "click to toggle" somewhat annoying. Maybe try "click to set", "ctrl-click to unset"?

- A light-grey grid background would make it easier to align shapes.

- Similarly, showing the changing coordinates on mousemove would also help with alignment.

- Highlighting the current grid square under the cursor allows for more confident placement of cells.

- It'd be nice if the canvas was centred on the page.

- Adjustable speed of the simulation. Just a "slow/medium/fast/ultra" selector would be fine IMO.

BTW, do you know about the Hashlife optimization/memoization technique? You probably won't need it to speed up this 64x64 simulation, but in case you hadn't heard about it, check it out because it's a fairly amazing trick (IMHO) and also results in ridiculous speed-ups. See https://en.wikipedia.org/wiki/Hashlife and (from external links) I remember this explanation to be fairly clear: http://www.ddj.com/dept/ai/184406478


As much as I love Conway's Life, I always find it frustrating to play games based upon it since it depends so much on single-block offsets and the grid... it's so discrete. I mean it's neat, but I don't generally find it makes for fun boardgames.

I'd love to see it adapted into a physics-driven gridless environment - some kind of fusion of Osmos and cellular automata.


Something like SmoothLife sounds like it would be a good match for what you're thinking about:

http://www.youtube.com/watch?v=KJe9H6qS82I


Sweet merciful crap that's beautiful. Holy poop!


You can run a port of SmoothLife in Chrome (via PNaCl) here: http://gonativeclient.appspot.com/demo/smoothlife


Never heard of this, but that's absolutely mesmerising!


Osmos looks awesome! I totally get what you mean Pxtl, I reckon that there might be some very cool things you could do using reaction-diffusion systems in a game scenario.

Here's something I made/discovered that's a little like Tron: http://www.youtube.com/watch?v=VTcH08UgcAE

One that's a little bit life-like: http://www.youtube.com/watch?v=W6sO8ZkgU9s

And this which is kinda strange, but very interesting (vibrating moving solitons/gliders with oscillating worms that emit glider-streams): http://www.youtube.com/watch?v=kKHddTQA7wM

Example pattern files for the latter two of these are distributed in the Ready-0.6 release.


I have similar feelings to you about the fiddliness of games based on life. A few years back, it inspired me to build this as an experiment in unfiddly GoL play: https://github.com/lharding/The-Automataic-Gardner

(warning: Processing. Been meaning to port it to JS forever now.)


I find it difficult because so many normal concepts like momemtum, conservation of mass, etc don't seem to apply.


I'm working on my own "shooter" based variant of Life called "Xtaloid".

http://www.genjipress.com/xtal

It's being designed as an homage to 1980s arcade games, complete with color-cycling effects.

Still in development, of course -- I'm hoping to have a fully-polished product sometime early next year for various platforms.


This game was great! I didn't read the instructions (bad user, I know) and didn't even know I could shoot for the first game. Once I learned that I had a blast.

Might want to inline those keyboard instructions on the attract screen.


Yes, I'm going to be making all that stuff easier, more approchable, etc. Glad you liked it!

Check back in the future for a greatly-expanded site.


Interesting as far as the game goes... But the tutorial made me want to take off my eyes. Seriously.


Heh, understood. I'm going to have all that stuff recapitulated as plain text for people who don't want to lunge for the Visine.

I may also add a feature to toggle color-cycling now that I think about it. Just because I like color-cycling doesn't mean everyone else will!


The colors and neon style are very neat, but it was indeed the color cycling. Glad to know you'll keep working with it ;)


I mostly just used an R pentomino[0] - solved it more quickly than fiddling about with gliders or spaceships.

Shotgun approach, rather than rapier.

[0] http://www.conwaylife.com/wiki/R-pentomino


Future levels will have more obstacles, including "dead zones" where cells can't be brought to life, which should make solutions like this harder. I'm thinking obstacles which you have to bump a glider into and get the glider to change direction.


My R pentomino initial configuration. [1]

Pieces played: 5

Game won in 499 generations.

[1] http://i.imgur.com/r2IcsRO.png


Won in 117 generations with a "lightweight spaceship"

http://imgur.com/jWziNy1


I'll still raise you a glider - http://imgur.com/GBjevny


My configuration: http://imgur.com/UvWrDNN

Won in 234 generations.


The "pink" area is indistinguishable from white on one of my monitors. I'd darken it.


Probably this monitor has bright set too high.


Default settings on my monitor made this hard to see too. It's because it is transparent. You can redefine the function that draws the screen by entering:

    function drawArena() {
    	for (var y = 0; y < CELLS_Y; y++) {
    		for (var x = 0; x < CELLS_X; x++) {
    			if (goal.x == x && goal.y == y) {
    				context.fillStyle = "rgb(0,127,255)";
    				if (arena[y][x] && !generations_until_beaten) {
    					winLevel();
    				}
    			} else if (arena[y][x]) {
    				context.fillStyle = "rgb(0,0,0)";
    			} else {
    				context.fillStyle = "rgb(255,255,255)";
    			}
    			context.fillRect(x * TILE_WIDTH, y * TILE_HEIGHT, TILE_WIDTH, TILE_HEIGHT);
    		}
    	}

    // Draw playable zone (if applicable)
    	if (playable.width && playable.height) {
    		context.fillStyle = "rgba(255,127,0, 0.3)";
    		context.fillRect(
    			playable.x * TILE_WIDTH,
    			playable.y * TILE_HEIGHT,
    			playable.width * TILE_WIDTH,
    			playable.height * TILE_HEIGHT
    		);
    	}
    }
in the javascript console (where 0.3 is the new transparency. It won't show up until you click the next level button.


I've increased the opacity in the game.


Awesome, thanks!


We made a game of life game for a game jam once. It's GoL on a diffusion process. You have to prevent the yellow (infection) spreading in the blood stream.

http://edinburghhacklab.com/GGJ2012/


Oh, that's a nice idea. I'm going to go and implement that in Ready. (https://code.google.com/p/reaction-diffusion/)



hey that's some cool software! I was actually looking for something like a that a few years ago. I might have some uses


This was a lot of fun [1]. I used two lightweight spaceships to pass the last level [2]

[1] http://i.imgur.com/LJLzOpc.png

[2] http://upload.wikimedia.org/wikipedia/commons/3/37/Game_of_l...


I used an explosion chain reaction, it was quite pretty: http://creativepark.net/img2/cwgl.png

This game should have more levels :)


There is an interesting Kaggle competition based on Conway's Game of Life going on at the moment: "Reverse the arrow of time in the Game of Life" http://www.kaggle.com/c/conway-s-reverse-game-of-life


I really like the concept, but I found it extremely frustrating to draw and undraw the squares.


This was great - I'd love to see more levels. As mentioned, the r-pentamino and other Methuselahs are over-powered. Maybe having some "friendly" cells that disqualify you if activated would make it more balanced.


The new version of the game introduces "dead zones", and future levels will require more skill than flooding the arena with chaos.


Fun! I've never got to know the Game of Life before, and I couldn't find one on the web where you could go step by step and step back, so I made this http://www2.cs.man.ac.uk/~jackmab1/life/

Sorry, its probably unusable on phones and stuff.

ps: code's here if anyone wants to fiddle with it, only 100 lines or so https://bitbucket.org/bjackman/life

yep, this is actually how I just spent about 3 hours of my friday night...


If anyone want's to simulate this on there own computer you can use this: http://golly.sourceforge.net/


When you reach the first challenging level (the one with three pulsars and you can draw at the bottom) you were supposed to be educated and ready. But the previous levels didn't do it for me. I suppose I was supposed to remember the pattern in the previous level or something. How many hacker points did I lose now?

Also it's not fun to draw in the tiny little grid. It would make life much easier if the shapes on the right was draggable to the canvas.


At the time, I didn't have a level built yet that showed you how to build a proper ship. That's been fixed now though.


cool! But why call it glider? It works like a micro-organism, a name like Amoeba would have been more suitable maybe?

the blue dot can be the "food".

Also, can the plane be made to center, instead of aligning left? I prefer the interaction area to be centered if possible.


You seem not to be familiar with Conway's Game of Life.

I think reading about it will answer several of your questions, but surely some of it is just historical (the glider was discovered 43 years ago): http://en.wikipedia.org/wiki/Glider_(Conway%27s_Life)


thanks, no I didn't think this was that old! Completely surprised.


Good observation. At some point Von Neumann became interested in modeling a self-replicating machine, and created what he called "cellular automata", and added features to the model that he assumed were necessary for self-replication. I don't know if his model assumed that raw materials were needed to reproduce, though. But in any case the biological metaphors were there from the beginning.

Von Neumann's model was complicated, and in the early 70's Conway created a simplified version, which is this "Game of Life" linked to on this page. I'm not sure where the space metaphors came from. Maybe due to the protean space games then being created. Maybe due to Star Trek or NASA's space program.


Conway's Game of Life is a long established bit of computer history. The Glider has been named and used for very many years.



All the names have a flying motif. For example, I beat the last level using three light weight space ships.


Did you try it with one first? That's what I did, but maybe I just got lucky with the positioning.


I did, but I wasn't paying attention so I was significantly off-center. I have no doubt that it could be solved with one. But, I figured, electrons are cheap.


The game if life is to stay alive the longest isn't it?

6 pieces 866 generations: http://i.imgur.com/pF5TXxR.jpg


Eventually I'll add a leaderboard and track both fastest and slowest solutions ;)


Perhaps more interesting: can you modify the rules of game of life in some small way so that it can achieve objectives on its own?


Suggestion: It would be nice if there were better drawing tools. Like making continuous strokes rather than clicking every single cell.


1393 generations using the shotgun approach.


In the future I'll keep track of highest (and lowest) scores, as the more generations it takes, the more fun it is to watch :)


"You've won the game!"

After this nothing happens on click to "Next level" except disabling this button.


There are only four levels right now... I'm going to bump it up to 20 tonight!



Very nice. I put together a little first person platformer atop a Life grid once - was fun to play with.



I don't see any pink region. Tried on an iMac with Safari and Chrome.


First level is non-interactive demo. You can proceed to the second level by letting it run to completion. Yeah, it confused me too.


I'll have to adjust the wording, thanks for pointing this out!


Would probably be a lot of fun if the interface weren't so horrible.

Fun idea, though.


You don't like Times new Roman?!

The UI is a bit better now, still not good though.


Need more levels!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: