Conway's Game of Life

Post pictures and videos of your factories.
If possible, please post also the blueprints/maps of your creations!
For art/design etc. you can go to Fan Art.

Post Reply
User avatar
stellatedHex
Inserter
Inserter
Posts: 27
Joined: Wed Jun 15, 2016 1:39 am
Contact:

Conway's Game of Life

Post by stellatedHex »

I recently got into Factorio for the second time. Being a fan of crazy logic stuff, after my first playthrough I tried to do what turned out to be a rather overambitious crazy logic project, and burnt myself out on the game--right before combinators were released. Ah, irony. Anyway having again gotten to the mid/late game stage where blue science is the biggest issue, I decided to return to my roots, and began a more humble crazy logic project: that old standby, Conway's Game of Life. I was surprised to find that this hadn't been done before, yet somehow also surprised to find after a more thorough search that I was wrong and it actually had, and much better (though admittedly mine is basically a prototype that I hacked together in one day). Nevertheless, I'm still proud of it.

Image
(you may notice the gif is a little janky; that's cause it's mashed together from 2 different takes)

As you can probably see, I'm still using actual analog values for the cells; that's because I'm actually messing around with combinators for the first time, and this is basically a warm-up project. If I create more crazy logic stuff it will probably be purely virtual.


Despite the hellish-looking (and admittedly, actually hellish) wiring, how it works is pretty simple. There are 4 chests in an inserter loop. Two of the chests (NW and SE) are connected to the cell; when the artifact is one of those, the cell is on. When the artifact is in one of the other 2 chests (not connected to anything), the cell is off. The 6 bajillion arithmetic combinators are all set to 0, and are really just diodes, similar to DaveMcW's. Also like his, I only needed 4 diodes per cell because I used both red and green wires. The wires then, of course, connect to the deciders. I needed three deciders because, unlike in DaveMcW's in which the "default" of each cell was "die", here the default is "don't change". Thus, the 3 deciders are [IF neighbors=3 THEN enliven], [IF neighbors<2 THEN die], and [IF neighbors>3 THEN die]. The outputs of the deciders are just connected to the smart inserters. Now that I think about it, the "die" inserters could have been on a different circuit than the "live" inserters, but i guess that doesn't really matter.
explanation with images
The logistic network which limits the size of the grid is not strictly necessary, but it's connected to an offscreen clock which makes 100% certain that everything remains in sync, and also to a very convenient little switch which allows me to turn the whole thing on or off by adding or taking a single belt* from any chest in the network. Without it I'd have to cut power to the whole thing in order to pause it and set the values. Which, I guess, is only mildly less convenient, but whatever.

*Or any odd number of belts, but each belt will causes delay because I have to convert from logistic network to a circuit network. The converter is just an inserter loop that goes
  1. Chest full of fast belts (it can be any item, of course)
  2. Fast inserter
  3. Ground
  4. Smart inserter (logistic condition: belts>fast belts?)
  5. Logistic storage chest
  6. Smart inserter (logistic condition: belts<fast belts?)
  7. Ground
  8. Inserter
  9. Back to the chest full of fast belts
The "Ground" steps are included because the stack inserter bonus was messing with the count. You could mitigate the counting delay by adding additional inserter loops, and reduce it even more by using Combinator jiggery-pokery to modify those loops so that they only triggered when the difference between the numbers were large, or so that they used different items as different digits, etc, etc, but in this case I didn't see the need since I was only ever going to be adding 1 at a time.
The Logistic storage chest is connected to a simple 4-combinator setup which outputs a signal when [x/2=(x-1)/2]--that is, whenever the number of belts is odd. That way I if I'm far away from the chest in which I originally put the belt in, I can just pop another one into the closest storage chest and the thing will turn off.
Last edited by stellatedHex on Thu Jun 16, 2016 9:31 pm, edited 9 times in total.
stellatedHexahedron wrote:I'm the kind of person who makes Conway's Game of Life in Factorio, but forgets what they are doing halfway through typing their username.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Conway's Game of Life

Post by DaveMcW »

I love that you can manually set it up without using the console. :)

User avatar
stellatedHex
Inserter
Inserter
Posts: 27
Joined: Wed Jun 15, 2016 1:39 am
Contact:

Re: Conway's Game of Life

Post by stellatedHex »

Finally done messing around with the topic post, I added an explanation of the switch.
DaveMcW wrote:I love that you can manually set it up without using the console. :)
Me too, although it's kind of a pain to open and close all those chests to add alien artifact into them : P
stellatedHexahedron wrote:I'm the kind of person who makes Conway's Game of Life in Factorio, but forgets what they are doing halfway through typing their username.

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Conway's Game of Life

Post by XKnight »

Although I've promised to not play Factorio till 0.13, I could not pass by this thread...
Build

User avatar
stellatedHex
Inserter
Inserter
Posts: 27
Joined: Wed Jun 15, 2016 1:39 am
Contact:

Re: Conway's Game of Life

Post by stellatedHex »

XKnight wrote:Although I've promised to not play Factorio till 0.13, I could not pass by this thread...
Eheheh >: ]

I mean, uh, neat! Can I ask what compression you used for the game state?
stellatedHexahedron wrote:I'm the kind of person who makes Conway's Game of Life in Factorio, but forgets what they are doing halfway through typing their username.

User avatar
DemiPixel
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Mon Mar 21, 2016 7:27 am
Contact:

Re: Conway's Game of Life

Post by DemiPixel »

XKnight wrote:Bla
Image

I'm pretty sure it works, but it's 4am and I don't want to test more than three rows until tomorrow.

Looks like I still have a bit of compacting to go. Hints?

P.S. It runs on a X tick loop, where X can be set as low as the number of rows. It supports up to 30 columns like yours, and it would only require a few extra constant combinators. Again, I'm tired...

It's my first real full combinator project, so I'd say I did fairly well :D

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Conway's Game of Life

Post by XKnight »

stellatedHex wrote:
XKnight wrote:Although I've promised to not play Factorio till 0.13, I could not pass by this thread...
Eheheh >: ]

I mean, uh, neat! Can I ask what compression you used for the game state?
Sure, details you can find here: viewtopic.php?p=136546#p136546

Post Reply

Return to “Show your Creations”