Recursive Game of Life

3 years ago (oimo.io)

At a certain draw distance (probably/hopefully depending on framerate and other specs), the platform replaces the individual cells with the OTCA metapixel, effectively giving the illusion that it is GoL all the way down.

Neat, even when you know the trick.

https://conwaylife.com/wiki/OTCA_metapixel

  • The other trick is that the simulation speed scales with draw distance, such that once you've zoomed out a full cycle the simulation has gotten exactly 35328x faster, which is the period of the OTCA metapixel.

    There's some lovely "engineering diagrams" of the OTCA metapixel on this (sparse) blog: http://otcametapixel.blogspot.com/2006/05/how-does-it-work.h.... It's fun to zoom in on the posted site and identify all the features, like the rule table near the bottom left.

    For context, the OTCA metapixel is a large pattern (2048x2048) which is capable of simulating Conway's Game of Life rules (or, indeed, any rule set consisting of neighbour-counting birth/death conditions); it does this by having adjacent pixels coordinate sharing of state (whether they're on or off) and then looking up what to do via a (programmable) lookup table. Based on the current state (on or off), a series of "glider guns" will be conditionally activated, which creates the appearance of a filled center (filled with moving gliders).

    • It also appears to retain the current state of arbitrarily higher recursive instances, not that they move much when you're zoomed in. Makes me wonder, how do you code for the current 'position' in the whole stack in a way that remains consistent? Conceptually the space is very big. If you zoom/recurse in to a random metapixel 13 times in a row, you're almost certainly looking at a pixel that no other human has or ever will see, and you have scaled from the width of the observable universe to the width of a proton.

      5 replies →

  • That's purely an optimization, though. Meaning, it would look just like this if it really was "GoL all the way down".

Wow! At the speed of around 0.15 you can see all the relevant computations: Every few seconds three glider triples get sent out, obviously directly representing the 9 neighboring cells. These interact with some lane shifting and 90 degree reflections. In the process these "byte" may lose a glider or two, representing the result of the game of life computation. Then you can see a fuse burn down, then a single glider makes a round and suddenly the whole cell switches state by an army of gliders gently touching the producing border.

Who else had this experience.

Cool - Game Of Life on my phone. Some pretty cool patterns. Recursion? Don't see it. But look - I can zoom out. Wow, that's a pretty large pattern. Oh shit!

I've not delved into the code. But I am assuming that this is a static model and not actually doing the GOL calculations. Is that correct?

  • FYI it looks fine on my laptop (a Mac running Chrome). But it looked messed up on my phone (a Pixel 2), kind of like random static.

First off, this is one of the coolest things I've ever seen.

Second, judging from the author's github [0], I'm guessing this was made in Haxe [1], which is a language often used to make games. I'd looked at Haxe before, but I hadn't realized that it has a lot of Ocaml-like features. I think I need to give it a try on my next prototype project!

[0] https://github.com/saharan

[1] https://haxe.org/

I LOVE how you can set it to scroll forever by itself. This website is a true work of art.

I can wrap my head around zooming in - conceptually you run any life simulation you want, i.e. a base level game of life, and then recursively decompose each cell into the 2²² cells of a OTCA metapixel.

Zooming out I find much harder to make sense of. What does it look like if you zoom out infinitely often? Is there some limit? If you take an empty universe with all cells dead there seems to be nothing at first, but at closer inspection there is of course still a lot of stuff going on in all the dead metapixels making up the empty universe. After zooming in a couple of times it would be hard to tell that zooming out a bit would leave you with an empty universe. And it would not have to be an empty universe, it could be anything.

  • > What does it look like if you zoom out infinitely often?

    Make a sharp backwards roll of your mouse wheel and see for yourself - it'll turn on the autopilot mode.

    • I am really enjoying this full screen with auto-zoom-out at the slowest speed setting. If the controls faded like media player controls do in full screen, I would be perfectly satisfied.

      This inspired a bit of awe in me, especially after I learned from another comment here that each game is unique.

      edit: Oh wow, of course it's last month's Bubbles creator.

      https://news.ycombinator.com/item?id=33566924

I'm never going to stare at TV static and see deeper meaning in random noise, and while this is almost the opposite of that, I'm surprised by how I felt watching this.

Awe and mild discomfort aren't the usual feelings I get watching information being processed.

Very smooth. Wonder if there are any optimizations like Hashlife going on? There’s a lot of spatial redundancy to exploit.

https://en.wikipedia.org/wiki/Hashlife

  • It need not do any simulation at all. Representing this as an animation should be very doable. Probably 2^4 animations (1 for each potential state of a cell) then you just need to tile the animations and replace sub pixels as needed. So you start out showing a zoomed in view of the animation. As you zoom out you tile based on the animation shown one layer up. The exact tiling is probably tough, but easier than actually simulating and keeping tons of state

    • I've also heard that Game of Life can be implemented as a pixel shader, so your browser gets to use all that dank GPU available.

      But a looping animation makes sense too.

    • The OTCA metapixel has 2048x2048 cells and a period of 35328. That's a total of 18.5 GB. And that's not counting the different states depending on neighbors and on-off-transitioning state.

      Even with compression that's a lot of data.

While an interesting effect, this recursive nature of this game can not be seen unless one has a mouse scroll wheel. I think it would be good to allow zoom in/zoom out to be done a different way (such as page up/page down or +/-). Not everyone has a mouse scroll wheel.

  • While this may not work for tablets (?), the vast majority of laptops have a setting called two-finger scrolling that lets you use two fingers on a trackpad to give scroll wheel inputs.

It looks quite different on mobile here (both Chrome and Firefox) than on desktop. It's way better on desktop, on mobile quite chaotic and doesn't seem to follow the actual Game of Life rules.

Really cool on desktop here!

  • Yeah, on mobile even if I turn the speed way down, it skips over many steps making everything unrecognizable. It lowers the FPS but still skips just as much between rendered frames. Seems like a programming error.

Doesn't work in Firefox

Uncaught Object { message: "assertion error", stack: "C@https://oimo.io/works/life/main.js:31:459\nze@https://oimo.i..., g: {…}, value: "assertion error" } main.js:37:66

This is awesome. How would one describe this formal system? There are no cells essentially

  • That's what's really awesome about it. In essence there's nothing but the rules of the game of life.

    I wonder if it's the same for reality. Everytime we've been looking at some particles we deemed fundamental they appear to be made of even smaller ones.

    • > Everytime we've been looking at some particles we deemed fundamental they appear to be made of even smaller ones.

      Not everytime. There is a list of particles that we currently deem fundamental, because no one has found any structure in them. But maybe we haven't looked closely enough yet. Some entertain the idea that they consist of vibrating strings instead of structurless, pointlike particles, but then those would be fundamental.

      1 reply →

  • There are cells, but they are not atomic but decomposeable.

    Each cell in level N is the stable pattern of gliders arranged into a square shape in the lower level N-1. If you think about it, this is how "objects" in the real world exist - not as an essence of the object, but as a pattern of simpler elements arranged in space-time that we recognize as an object.

That is so cool! This person really is a freak, in good way. They also created their own physics engine, which was featured here a while ago: https://github.com/saharan/OimoPhysics

But it would be cool if we could change the GoL parameters and see how that affects the infinite fractal recursion!

If you zoom in, you get lower and lower level OTCA metapixels forever, very straightforward.

But if you zoom out, at any time it could be possible for them to compute a different pattern. But it's OTCA metapixel all the way up. What is being computed, other than more OTCA metapixels? What is being computed after infinite zoom out steps?

Makes me question the meaning of existence!

I am enjoying this. Is there a way to pause? I have to verify each cell just to boggle my mind at the fact that everything is adhering to GOL rules.

It is interesting to observe that the perception of time changes with zooming in/out. I know the actual speed of the gliders remains the same, but it seems to my eye that they speed up if you zoom out and slow down if you zoom in.

I wonder if this perception has an analogue in the physical world that has relativity as a consequence.

This is really great. I would like to use it as a visual backdrop on a big screen when playing DJ sets. I see that it enters a permanently zooming out mode when I zoom out fast, would be awesome if the zoom control disappears when it enters that mode so that it just displays the game of life itself and no UI elements.

i can't possibly be the only one who didn't get what this is

  • It's a game of life simulation that is -itself- running a game of life simulation that is running a game of life simulation that is ...

    https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

    Game of Life is Turing-complete, and has all sorts of other weird and interesting implications in chaos theory and philosophy of maths.

    You can write a game of life implementation on a rainy sunday afternoon, and be stuck playing with it for weeks.

    This guy took it to another level though.

Mesmerizing, I am interested for the code and how is this built. When I said build the entire fractal concept is it emergent or deliberate? Who did author envisioned this>

I wonder what the smallest molecules/things are that could be used to make a real game of life? Could you do it with bacteria? Surely not viruses or amino acids?

No matter what speed/zoom I set it to, it skips steps like crazy and no simulation can be seen.

It wasn't immediately obvious to me: you need to scroll to see the recursive aspect.

(This is really amazing)

How is this even possible?

  • As you zoom out, the simulation of the underlying cells is swapped for a higher level simulation of the cells at the next higher level. Watch how the simulation of the cells from the level down speeds up as you transition to the next level.

Has anyone tried this in a 3D cell distribution instead of 2D arrangement of cells with similar rules?

Does it simulate life or universe at any scale?