Sample metapatterns made of Calcyman's metacells

For discussion of specific patterns or specific families of patterns, both newly-discovered and well-known.
User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Sample metapatterns made of Calcyman's metacells

Post by dvgrn » February 1st, 2017, 10:00 am

Saka wrote:Wow. Nice article, I will put it on the wiki later. So how do I build patterns outside of golly?
You have to start with a quadtree description of one megacell -- basically megacell-OFF.mc and megacell-ON.mc -- and use the information in the .mc file to write a larger macrocell file directly. Instead of knowing anything about Golly cell lists, the script has to know all the ins and outs of macrocell format.

It's actually a little more complicated than that, because Calcyman's megacells are tilted 45 degrees. So the chunks you really have to start with are the four quarters of a megacell, bordering empty space, and the two tiles made up of NE/SW quarter and NW/SE quarter megacells. Plus a NW/SE quarter megacell with the SE quarter set to ON, and a SE quarter set to ON bordering empty space. I think that's everything, because the ON vs. OFF bits are all kept in the SE quarter of the megacell. Otherwise fourteen different tiles would be needed.

EDIT: To maybe make this a little clearer, here are diagrams of the eight tiles the script will need:

Code: Select all

x = 55, y = 25, rule = B/S012345678
10o5b10o14bo5bo$bo7bo5bo7bo14b2o5b2o$2bo6bo5bo6bo14bobo5bobo$3bo5bo5bo
5bo14bo2bo5bo2bo$4bo4bo5bo4bo14bo3bo5bo3bo$5bo3bo5bo3bo14bo4bo5bo4bo$
6bo2bo5bo2bo14bo5bo5bo5bo$7bobo5bobo14bo6bo5bo6bo$8b2o5b2o14bo7bo5bo7b
o$9bo5bo14b10o5b10o6$10o5b10o5b10o5b10o$2o7bo5bo7b2o5b10o5b9o$obo6bo5b
o6bobo5b8obo5b8o$o2bo5bo5bo5bo2bo5b7o2bo5b7o$o3bo4bo5bo4bo3bo5b6o3bo5b
6o$o4bo3bo5bo3bo4bo5b5o4bo5b5o$o5bo2bo5bo2bo5bo5b4o5bo5b4o$o6bobo5bobo
6bo5b3o6bo5b3o$o7b2o5b2o7bo5b2o7bo5b2o$10o5b10o5b10o5bo!
#C [[ THUMBNAIL THUMBSIZE 2 ]]
So each metacell will be composed of four of these smaller tiles, and each set of four tiles will also include pieces of any diagonally adjacent neighbor metacells. The SE corner of an ON metacell (the colored-in triangles) is actually in the NW corner of these smaller squares. We don't need colored versions of other three corners, because they're exactly the same for the initial ON and OFF tiles (before the first metatick is run to fill in the gliders.)

------------------------------------

A script that does things this way wouldn't be all that difficult to write, and would run much faster and consume relatively little memory. It just wouldn't be as interesting to watch, because the whole pattern would spring into existence all at once.

EDIT: To make writing the script easier, we could rebuild the megacell so it's orthogonal instead of diagonal (and probably a bit smaller), using Kazyan's new H-to-MWSS converter and lots of semi-Snarks and syringes. Then there really only would be two tiles to worry about, ON and OFF.

But on balance I think it will be a lot less work to just write a slightly more complicated script...!

User avatar
calcyman
Moderator
Posts: 2932
Joined: June 1st, 2009, 4:32 pm

Re: Sample metapatterns made of Calcyman's metacells

Post by calcyman » February 1st, 2017, 10:14 am

dvgrn wrote:It's actually a little more complicated than that,
It was also slightly more complicated for Brice Due's metacells, since they overlap (they're 2058*2058, but tiled on a 2048*2048 grid). My script split each metacell into four quarters (each of which is 1029*1029, inhabiting a 2048*2048 box). It then tensored the unmetafied pattern with each quarter-metacell, and superimposed the resulting four patterns together (using boolean OR).
What do you do with ill crystallographers? Take them to the mono-clinic!

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Sample metapatterns made of Calcyman's metacells

Post by dvgrn » February 1st, 2017, 1:05 pm

gameoflifemaniac wrote:Sorry, but I have an another problem. When I try to run the script, it shows:
...0\golly-2.8-win-32bit\Scripts\Lua\megafier-universal.lua:58:
Can't open pattern file:
megacell-OFF-unprogrammed.mc.gz
I am currently in Germany and using my grandmas laptop, so the bug might not occur on our computer at home. But what caused the bug(even when I saved the megacell file)?
I don't think there's a bug. Where did you put the megacell-OFF-unprogrammed.mc.gz file? It just has to be in the same folder as megafier-universal.lua. If it's not, you'll see the error you quoted.

It might be a good idea to get used to reading the code in the script and figure out from that what the script is looking for. A lot of these kinds of error messages really do point directly toward a solution.

(I admit, it's not obvious without experience, that a Lua script will look in its "current directory" -- the same folder where the script itself is saved -- unless a different file path is given. That's why I usually pack the pattern into the script itself -- I shouldn't have gotten lazy this time. Don't worry, it's only temporary.)

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Sample metapatterns made of Calcyman's metacells

Post by gameoflifemaniac » February 2nd, 2017, 4:13 am

Yes, I did save the pattern file in the Scripts folder. But it gives me that error.
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Sample metapatterns made of Calcyman's metacells

Post by dvgrn » February 2nd, 2017, 9:31 am

gameoflifemaniac wrote:Yes, I did save the pattern file in the Scripts folder. But it gives me that error.
Well... look at everything very carefully again. You said you saved the pattern file "in the Scripts folder". If you really saved it in Scripts, that would explain the problem. I suspect you mean that you put it in Scripts/Lua.

Also, since you say you "saved" the file rather than "copied" or "unzipped" the file, does that mean you opened it in Golly, then saved a copy? In that case Golly might have saved the file as an .mc instead of an .mc.gz, or the filename could have been changed somehow. If you look at the Scripts/Lua folder that the error message is complaining about, is there a file in there called "megacell-OFF-unprogrammed.mc.gz" -- letter for letter? And if you open that file in Golly, you see just the single OFF megacell pattern, no pop-up windows or anything?

(Another unlikely possibility is that you could have ended up with the entire ZIP file saved as megacell-OFF-unprogrammed.mc.gz.zip, and Windows is hiding the file extension, the way it does if you don't change that awful setting. But I don't quite see how you could have managed that.)

-- Really just download the ZIP file again, unpack both files into the same folder, any folder, new folder or not, doesn't have to be Scripts/Lua, just put them on the desktop or something -- and then in Golly, File > Run Script and choose the script from that new location. When I try that everything seems to work fine.

Also, I'll have it back to a single script with no supporting files in a day or three -- much simpler. Just want to get my next contest entry down to a reasonable size -- something that can fit in a code block in one of these posts, so it can be run directly from File > Run Clipboard.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Sample metapatterns made of Calcyman's metacells

Post by gameoflifemaniac » February 2nd, 2017, 12:59 pm

When I saved it as a mc.gz file, it gave me still the same error!
EDIT It was automatically saved as a .gz file. Is that the problem and how to fix that when it is?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Sample metapatterns made of Calcyman's metacells

Post by dvgrn » February 2nd, 2017, 1:59 pm

gameoflifemaniac wrote:When I saved it as a mc.gz file, it gave me still the same error!
EDIT It was automatically saved as a .gz file. Is that the problem and how to fix that when it is?
The file type doesn't really matter in this case -- could be anything that Golly can open. The only requirement is that the filename has to match the filename in the script.

In the ZIP file I posted, the included pattern file does in fact match the filename given in the script. So in theory you should be fine as long as you just decompress the ZIP file and don't do anything else.

Did you try my suggestion from my last post?
[reworded]
1) download the megafier-universal.zip file again.
2) unzip/decompress the .zip file into a folder. Doesn't matter what folder. megafier-universal.lua and megacell-OFF-unprogrammed.mc.gz just have to be sitting next to each other in the same folder.
3) In Golly, choose File > Run Script, browse to that folder, and choose the megafier-universal.lua script that you just unzipped.
Don't do any File > Save operations in Golly, just decompress the ZIP file.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Sample metapatterns made of Calcyman's metacells

Post by gameoflifemaniac » February 3rd, 2017, 4:59 am

OMG, it works!
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Sample metapatterns made of Calcyman's metacells

Post by gameoflifemaniac » February 3rd, 2017, 5:09 am

How about making the script to convert the megacell first and then tiling it? Would the script get faster?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Sample metapatterns made of Calcyman's metacells

Post by dvgrn » February 3rd, 2017, 9:52 am

gameoflifemaniac wrote:How about making the script to convert the megacell first and then tiling it? Would the script get faster?
A script that writes an .mc file directly and then opens the file, will be pretty close to instantaneous for any reasonable size megapattern -- a few seconds at most.

Of course at large enough sizes, Golly will start having more trouble with the actual simulation. But certainly much larger patterns, up to hundreds of thousands of megacells, should be within reach.

I have most of the details worked out for an .mc-writing Lua megafier script, I think. It may take a while to actually write it -- I'd like to fix the problem with escaping gliders and LWSSes around the edges, first. I _think_ it will end up being pretty easy (famous last words).

User avatar
Mr. Missed Her
Posts: 90
Joined: December 7th, 2016, 12:27 pm
Location: Somewhere within [time in years since this was entered] light-years of you.

Re: Sample metapatterns made of Calcyman's metacells

Post by Mr. Missed Her » February 5th, 2017, 4:54 pm

Cool.
It looks like the timers that run the cells use binary, in a sense; the amount of time the timer can time is doubled with each section you add. OTCAMP's timer is stretched along about 80% of the left side, but this metacell's timer (at least one of them) is squeezed into a tiny open space in the corner.
I can't really figure out how this thing works, though. It was easier to see how OTCAMP worked. Could you explain how it works on the wiki article? (When it gets added.)

PS: Don't think that the unit cell is that hard to understand, though. I mean, the waterbear is a mess of gliders and hershels and weightships and I don't know what else deleting and creating and transforming each other.
There is life on Mars. We put it there with not-completely-sterilized rovers.
And, for that matter, the Moon, Jupiter, Titan, and 67P/Churyumov–Gerasimenko.

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Sample metapatterns made of Calcyman's metacells

Post by dvgrn » February 5th, 2017, 8:15 pm

Mr. Missed Her wrote:It looks like the timers that run the cells use binary, in a sense; the amount of time the timer can time is doubled with each section you add. OTCAMP's timer is stretched along about 80% of the left side, but this metacell's timer (at least one of them) is squeezed into a tiny open space in the corner.
Everything's relative. What's kind of funny is that the "tiny open space in the corner" is about twice the diameter of a complete OTCA metapixel -- Calcyman built the whole thing a lot bigger, partly to support the row of 512 eaters along the SW edge. The rest of the circuitry could be shrunk down to a fraction of this size nowadays, but those 512 eaters can only be compressed just so far.
Mr. Missed Her wrote:I can't really figure out how this thing works, though. It was easier to see how OTCAMP worked. Could you explain how it works on the wiki article? (When it gets added.)

PS: Don't think that the unit cell is that hard to understand, though...
I don't seem to be very good at getting around to writing wiki articles. With any luck, if I just write something here, someone else will put it on the LifeWiki for me...!

-- Yes, the megacell is a very clever design, but that makes its operation really fairly simple as these things go. The key to understanding it is the locations numbered "0" through "8" in the south corner. If you look closely, you'll see directly below each number a cluster of three eaters, that might or might not have a boat in the middle of them. These three eaters are a "demultiplexer" component invented by Brice Due, used here to store one bit of information:

Code: Select all

x = 188, y = 261, rule = LifeHistory
55.2A2.2A2.2A2.2A2.2A2.2A$55.2A2.2A2.2A2.2A2.2A2.2A3$47.2A2.2A2.2A2.
2A10.2A2.2A2.2A2.2A$47.2A2.2A2.2A2.2A10.2A2.2A2.2A2.2A3$43.2A2.2A2.2A
2.2A18.2A2.2A2.2A2.2A$43.2A2.2A2.2A2.2A18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113.
2A$186.A$167.2A15.A.A$167.2A15.2A12$166.2A$165.A.A$165.A$164.2A5$55.A
126.2A$55.3A63.A60.A.A$58.A62.3A60.A$51.2A4.2A17.2A46.A59.2A$52.A4.4B
14.B2A2B3.2A38.2A$52.A.A4.3B14.4B2.B2AB$47.2A4.2A4.4B9.B.6B3.2B$48.A
11.4B6.10B2.2B36.A34.A$35.A11.A13.4B5.11B2A2B33.3A32.3A$35.3A9.2A13.
4B3.12B2A3B.B29.A34.A$38.A9.B14.4B2.18B2A28.2A33.2A20.2A$25.2A10.2A9.
3B13.4B2.15B.B2A18.2A65.2A$26.A10.5B5.6B12.19B3.B20.A56.2A$26.A.AB9.
4B3.10B10.18B24.A.A54.A2.A$12.2A13.2AB.3B4.6B2.11B3.2B2.19B26.2A4.2A
44.2A4.2A$11.B2AB14.7B.13B2A31B31.A2.A44.A20.2A$12.2B15.21B2A22B.7B
33.2A45.A.A18.A$7.B3.2B17.44B2.6B45.2A34.2A16.A.A$6.2AB.4B15.46B.7B
44.2A52.2A$6.2A8B11.49B.6B$7.B.B2A6B2.2B2.19B.B3.13B.4B7.9B$10.2A29B
7.7B.B4.4B9.8B2.D.D.D.D$10.24B.6B19.4B11.5BDBD9.D.D$6.28B2.B.5B16.4B
13.2BD4B8.A4.D$6.28B7.2A15.4B15.6B6.3A$5.2A26B8.A15.4B15.D7B4.A9.D$5.
2A14B.B.2B16.3A11.4B17.7B4.2A23.2A3.2A32.2A$6.B.11B5.3B17.A10.4B15.D
2.8B.4B10.D13.A3.A20.2A11.2A$8.10B7.A2B.2A23.4B19.11B23.3A5.3A18.A$9.
12B3.A.A2B.A22.4B16.D3.12B12.D9.A9.A15.3A35.2A$8.14B2.2AB2.A24.2B21.
12B48.A37.2A2.2A$9.13B6.A25.3B16.D4.11B12.D77.A.A$9.13B2.5A.A24.A2B.
2A20.7B68.2A23.A$11.2B.8B2.A4.2A23.A.A2B.A11.D7.8B14.D54.A23.2A$15.7B
3.3A26.2AB2.A19.11B64.3A$15.7B5.A.2A27.A13.D7.10B12.D51.A$16.6B6.A.A
23.5A.A18.11B$16.7B31.A4.2A11.D6.13B10.D$16.8B31.3A22.6B2A5B$17.8B32.
A.2A11.D5.3B.3BABA5B9.D$17.9B32.A.A17.2A2.4BA4B$16.6B.4B46.D5.A2.7B
12.D$16.7B.4B48.3A4.6B$2A15.6B2.4B44.D2.A4.5B.B13.D$.A8.B4.8B3.4B51.
2A$.A.AB3.4B.6B2AB5.4B43.D7.A17.D$2.2AB.13B2A2B5.4B47.3A$4.18B7.4B43.
D2.A18.D$4.17B9.4B$5.13B13.4B43.D17.D$7.12B13.4B44.D.D9.D.D$9.10B14.
4B47.D.D.D.D$9.11B14.4B$10.2B.7B15.4B$10.11B15.4B$9.11B17.4B$9.11B18.
4B$9.11B19.4B$9.8B2.B2A18.4B$9.7B3.BA.A18.4B$9.7B6.A19.4B$9.6B7.2A19.
4B$8.7B29.4B$7.8B30.4B$6.8B32.4B$6.8B33.4B$4.2AB2.6B33.4B$3.A.AB.7B
34.4B$3.A4.6B36.4B$2.2A4.6B37.4B9.A$8.6B38.4B6.3A$7.8B38.4B4.A$8.8B
38.4B3.2A$7.9B16.A22.8B4.A$7.9B16.3A21.5B6.3A$7.10B18.A21.4B9.A$7.5B
2A3B17.2A20.6B7.2A$7.5B2A4B16.4B17.8B6.4B6.2A$7.11B3.2A13.3B15.4B2.4B
7.2B6.A$7.12BA2.A12.4B14.4B4.4B4.5B2.BA.A$9.8B2.2A4.2A8.5B12.4B6.4B.B
.2B2AB2.B2A$3.2A4.7B9.A8.6B11.4B.3B.2B.7BA2BA4B$4.A4.6B7.BA.A8.8B2.
27B2A4B$4.A.AB.6B3.3B.B2A8.26B2A16B$5.2AB.14B11.25B2A14B$7.16B12.7B.
29B.2B$8.14B12.42B$7.16B11.19B2.2B3.2B6.9B$7.18B8.17B19.9B$8.20B2.2B.
15B21.5B.4B$9.38B23.3B3.4B$10.7B.20B.8B21.7B2.4B$10.6B2.16B2A2B3.8B
19.2A.B.2A3.4B$9.6B3.16B2A2B5.B3.2A20.A3.A5.4B$9.4B6.18B10.A18.3A5.3A
3.4B$9.2B2AB12.4B.3B.B12.3A15.A9.A4.4B$7.2AB.2A14.3B20.A31.4B$6.A.AB
18.4B51.4B$6.A23.2A52.4B$5.2A23.A54.4B$31.3A52.4B$33.A53.4B$88.4B$89.
4B$90.4B58.3A$91.4B57.A$92.B3A57.A$93.A$94.A!
#C [[ THUMBNAIL THUMBSIZE 2 ]]
[I've moved the "0" label closer here, but the E/W position is the same.]

The bit of information is the presence (boat) or absence (no boat) of an ON neighbor, according to the following diagram:
Locations and glider counts for each cell's neighbors
Locations and glider counts for each cell's neighbors
Megacell_key.png (26.96 KiB) Viewed 16071 times
So at the end of each megatick, there will be a boat below the "0" label if and only if the megacell to the east is ON. There will be a boat below the "1" label if and only if the megacell to the northeast is on... etc., etc., and there will be a boat below the "8" label if and only if the megacell itself is ON.

Binary Magic
Now, the rest of the mechanisms around the "0" through "8" labels really do something fairly simple: they send 2^N gliders, all on the same output path. So the "0" mechanism sends only one glider, the "1" mechanism sends two gliders, etc., up to the "8" mechanism sending 256 gliders -- see the right-hand diamond-shaped table above. The lower part of the circuitry just makes sure that the length-2^(N-1) salvo doesn't start getting fired until the length-2^N salvo has safely gone by.

Now, over on the southeast edge of the megacell there's a complex shotgun aimed at a single block, near the end of the chain of 512 eaters (damaged or whole) in the "rule lookup table". You can see the damaged gliders at T=0 if you reset a megafied pattern, but they're gone at T=16777216.

Each glider sent on the output path ultimately triggers a shotgun salvo that pulls that block to the southeast, in 12-cell increments, lining up with each lookup-table eater in turn. As the label near there says, an eater's presence corresponds to an ON value for the next megatick; an eater's absence means the megacell will be OFF.

Here's why: when the final clock signal is sent from the p2^24 gun (which is the tiny mostly vertical line just to the right of the "8" mechanism), a different salvo is sent instead of the usual pull-block-12-cells one. That final salvo produces a 90-degree glider at the current location of the shotgun-pulled block, while destroying the block (which then gets rebuilt at the zero position by a separate signal). That 90-degree glider tests the presence or absence of that particular eater, and if the eater is not present, the test glider crashes into another glider which would otherwise escape NW to tell the cell to turn ON.

Any Non-Totalistic, Not Just Isotropic
Thanks to the magic of binary addition of powers of two, each possible pattern of neighbors corresponds with exactly one eater position in the 512-eater lookup table. This means that if a megacell is initially OFF and has no neighbors, the block won't be moved at all. So the eater at the NW end of the lookup table means "megacell OFF, all neighbors OFF". 255 more eaters also mean "megacell OFF" with each possible combination of neighbors. The SE half of the lookup table means "megacell ON" (because the bit at the "8" label gets converted into 256 gliders), and the last eater to the SE means "megacell ON, all neighbors ON".

This size of lookup table means that the megacell can actually be programmed to handle a truly huge space of 2^512 rules -- not just isotropic rules where the rule looks the same if you rotate everything 90 or 180 degrees, but also asymmetric rules like "Conway's Life except also turn ON if the only a single neighbor to the north is ON."

There's no rule syntax that will currently allow Golly to automatically handle asymmetric non-totalistic rules. There is actually such a syntax for recent builds of LifeViewer, though, so it might be possible in Golly 2.9 to run such patterns via lifeviewer.lua. Otherwise a custom .rule file will have to be constructed for each such rule.

Questions?
That's plenty enough for a first draft, I think. Again, running let's say a 3x3 block of ON megacells for one megatick in LifeHistory will help a lot with tracing out the circuit pathways.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Sample metapatterns made of Calcyman's metacells

Post by gameoflifemaniac » February 6th, 2017, 9:25 am

But is there any notation for asymmetric rules?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: Sample metapatterns made of Calcyman's metacells

Post by Saka » February 6th, 2017, 9:36 am

gameoflifemaniac wrote:But is there any notation for asymmetric rules?
Not at the moment. Only for non totalistic rules.

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Sample metapatterns made of Calcyman's metacells

Post by dvgrn » February 6th, 2017, 10:27 am

Saka wrote:
gameoflifemaniac wrote:But is there any notation for asymmetric rules?
Not at the moment. Only for non totalistic rules.
LifeViewer has a notation, and it's possible that some variant of that notation could get included in Golly 2.9 / 3.0. Here's plain-vanilla Life re-encoded as an asymmetric rule string:

Code: Select all

#N Acorn
#O Charles Corderman
#C A methuselah with lifespan 5206.
#C www.conwaylife.com/wiki/index.php?title=Acorn
x = 7, y = 3, rule = MAPARYXfhZofugWaH7oaIDogBZofuhogOiAaIDogIAAgAAWaH7oaIDogGiA6ICAAIAAaIDogIAAgACAAIAAAAAAAA
bo5b$3bo3b$2o2b3o!
The ARYX... string is just the following binary number, basically a rearrangement of the pattern of eaters and no-eaters in the megacell's lookup table, in a standard base64 encoding --

Code: Select all

00000001000101100001011101111110000101100110100001111110111010000001011001101000011111101110100001101000100000001110100010000000000101100110100001111110111010000110100010000000111010001000000001101000100000001110100010000000100000000000000010000000000000000001011001101000011111101110100001101000100000001110100010000000011010001000000011101000100000001000000000000000100000000000000001101000100000001110100010000000100000000000000010000000000000001000000000000000100000000000000000000000000000000000000000000000
There's also an option to generate random rules by putting in a threshold value -- i.e., the likelihood that that each bit will be a 1.

EDIT: LifeViewer uses a left-to-right top-to-bottom ordering of the nine cell states. The megacell has its neighbors numbered around the outside starting from the middle of one edge, then into the center (see diagram in previous post).

Here are the minor adjustments that were needed to the code in megafier-universal.lua to generate the above bitstring. Theoretically this standalone Lua script should produce the correct LifeViewer MAP bitstring for the current rule, as long as Golly is simulating a two-state non-totalistic rule. The script won't care about whether Golly's using RuleLoader or some other algorithm -- it just runs all 512 possible combinations for one tick and compiles the results.

Code: Select all

-- make_nontotalistic_LifeViewer_rulestring_v1.0.lua

local g = golly()
local gp = require "gplus"
local split = gp.split
-- local pattern = gp.pattern

function fixrule(s)
  return (gp.split(s,":")) -- remove bounded grid spec, if any
end

g.addlayer("temp") -- keep and test the current rule
fixedrule=fixrule(g.getrule())
g.setrule(fixedrule)

bitlist={{-1,-1,256},{0,-1,128},{1,-1,64},{-1,0,32},{0,0,16},{1,0,8},{-1,1,4},{0,1,2},{1,1,1}}
for j = 1, 9 do
    x, y, bit = table.unpack(bitlist[j])
    for i=0, 511 do
        if i&bit>0 then g.setcell(i*5+x,y,1) end
    end
end

g.run(1)
bits={}
ind=1
local rulestr, invstr, revinvstr="","",""
for k=0,2555,5 do
    if g.getcell(k,0)==1 then
        rulestr=rulestr.."1"
        invstr=invstr.."0"
        revinvstr="0"..revinvstr   
    else
        rulestr=rulestr.."0"
        invstr=invstr.."1"
        revinvstr="1"..revinvstr
    end
end

-- build base64 lookup table
local lookupstr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
bdict={}
for i=1,64 do
    local w=""
    for j=0,5 do
        if (i-1)&2^j>0 then w="1"..w else w="0"..w end
    end
    bdict[w]=lookupstr:sub(i,i)
end

-- decide whether to use standard, inverted, or inverted-reversed bitstring, based on fixedrule
-- (assuming Golly is correctly simulating rules with B0, with or without S8, to avoid strobing)

-- the following won't work for anisotropic non-totalistic rules defined by MAP strings,
-- so we'll have to decode the MAP rulestring into a 512-bit string in that case, check first and last digits...
-- but in that case, we already know the string, so why are we running this script anyway?

if string.match(fixedrule,"B0") then rulestr = string.match(fixedrule,"S.*8") and revinvstr or invstr end

local s = rulestr.."0000" -- pad so that len mod 6=0
base64=""
for i=1,511,6 do base64=base64..bdict[s:sub(i,i+5)] end
    
g.setclipstr(rulestr.."\n"..base64)
g.show("Copied to clipboard: "..base64)

-- Life = 'ARYXfhZofugWaH7oaIDogBZofuhogOiAaIDogIAAgAAWaH7oaIDogGiA6ICAAIAAaIDogIAAgACAAIAAAAAAAA'
EDIT2: Fair warning: the script doesn't work correctly for B0-and-S8 or B0-but-no-S8 isotropic or Life-like rules yet, because Golly goes into simulation mode. So the script sees the simulated rule in operation rather than the "real" rule. Will edit in a version 1.0 of the script above, when I get around to sorting that out.

[Those aren't the greatest rules to simulate with megacells anyway, because you tend to get weird edge effects in any finite patch of megacells -- would have to add p16777216 guns all round the edges to get a B0-and-S8 rule working right. And the B0-no-S8 simulation would strobe ON and OFF all the time.]

EDIT3: Almost fixed now, I think -- it will work for any nontotalistic rule, isotropic or anisotropic, until Golly is updated to simulate B0 anisotropic rules natively without strobing. Then we'll have to check for whatever the native rule format is for anisotropic rules, and go to version 1.1.

Anyone see any bugs? I only did the most absolutely minimal testing, but a bounded-grid with a minimal anisotropic rule worked almost as expected... just ended up with the mirror image of what I wanted. Will correct that tomorrow.

EDIT4: Patched the mirror-image problem. Here's a simple test case:

Test rule that leaves ON cells on, and also turns on OFF cells with one neighbor in the southeaast:

Code: Select all

@RULE testNWrule

@TABLE
n_states:2
neighborhood:Moore
symmetries:none

0,0,0,0,1,0,0,0,0,1
Output from script:

Code: Select all

01000000000000001111111111111111000000000000000011111111111111110000000000000000111111111111111100000000000000001111111111111111000000000000000011111111111111110000000000000000111111111111111100000000000000001111111111111111000000000000000011111111111111110000000000000000111111111111111100000000000000001111111111111111000000000000000011111111111111110000000000000000111111111111111100000000000000001111111111111111000000000000000011111111111111110000000000000000111111111111111100000000000000001111111111111111
QAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//w
Making the same rule as a MAP rule:

Code: Select all

x = 15, y = 5, rule = MAPQAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//w
3ob3o2b2ob3o$bo2bo3bo4bo$bo2b2o3bo3bo$bo2bo5bo2bo$bo2b3ob2o3bo!

User avatar
Mr. Missed Her
Posts: 90
Joined: December 7th, 2016, 12:27 pm
Location: Somewhere within [time in years since this was entered] light-years of you.

Re: Sample metapatterns made of Calcyman's metacells

Post by Mr. Missed Her » February 8th, 2017, 10:34 am

dvgrn wrote:
Mr. Missed Her wrote:It looks like the timers that run the cells use binary, in a sense; the amount of time the timer can time is doubled with each section you add. OTCAMP's timer is stretched along about 80% of the left side, but this metacell's timer (at least one of them) is squeezed into a tiny open space in the corner.
Everything's relative. What's kind of funny is that the "tiny open space in the corner" is about twice the diameter of a complete OTCA metapixel -- Calcyman built the whole thing a lot bigger, partly to support the row of 512 eaters along the SW edge. The rest of the circuitry could be shrunk down to a fraction of this size nowadays, but those 512 eaters can only be compressed just so far.
Yeah, I kinda forgot about size making that statement. Whoops.
But it still is more dense in size/time. The size of your metacell is only about 15 times larger than OTCAMP, but the timer times about 474 times more time. I don't know how to measure the size of the timers, but I'd say that the area of this metacell's timer could be about 5-10 times of OTCAMP's timer, meaning that your timer is even more dense than if you go from the size of the whole cell.

Maybe there should be a scale of the universe for CGOL. You could get a good sense for size that way.
There is life on Mars. We put it there with not-completely-sterilized rovers.
And, for that matter, the Moon, Jupiter, Titan, and 67P/Churyumov–Gerasimenko.

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Sample metapatterns made of Calcyman's metacells

Post by dvgrn » February 8th, 2017, 10:48 pm

Mr. Missed Her wrote:Maybe there should be a scale of the universe for CGOL. You could get a good sense for size that way.
Interesting idea. A Golly 2.9 overlay script could do something like that quite nicely, with smooth zooms in and out instead of Golly's standard power-of-two jumps.

Could even have a recursive loop at the lowest level, so that whenever you think you've gotten down to a single cell and there's no point in going further, objects turn out to be made out of OTCA metapixels, so you can keep zooming in after all.

drc
Posts: 1664
Joined: December 3rd, 2015, 4:11 pm

Re: Sample metapatterns made of Calcyman's metacells

Post by drc » February 9th, 2017, 1:52 pm

Mr. Missed Her wrote: Maybe there should be a scale of the universe for CGOL. You could get a good sense for size that way.
This is an amazing idea. +1 support.

User avatar
gmc_nxtman
Posts: 1150
Joined: May 26th, 2015, 7:20 pm

Re: Sample metapatterns made of Calcyman's metacells

Post by gmc_nxtman » February 9th, 2017, 6:44 pm

Agreed!

User avatar
calcyman
Moderator
Posts: 2932
Joined: June 1st, 2009, 4:32 pm

Re: Sample metapatterns made of Calcyman's metacells

Post by calcyman » February 9th, 2017, 9:22 pm

drc wrote:
Mr. Missed Her wrote: Maybe there should be a scale of the universe for CGOL. You could get a good sense for size that way.
This is an amazing idea. +1 support.
The earlier and more dramatic version of this was Powers of Ten by the Eameses: https://www.youtube.com/watch?v=0fKBhvDjuy0
What do you do with ill crystallographers? Take them to the mono-clinic!


User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Sample metapatterns made of Calcyman's metacells

Post by blah » February 10th, 2017, 1:29 am

Would this be a script in Golly, a video, something more reminiscent of Scale of the Universe, or what? You have to decide on the medium first.
succ

User avatar
Mr. Missed Her
Posts: 90
Joined: December 7th, 2016, 12:27 pm
Location: Somewhere within [time in years since this was entered] light-years of you.

Re: Sample metapatterns made of Calcyman's metacells

Post by Mr. Missed Her » February 10th, 2017, 11:36 am

Well, it seems like this scale of the universe thing is being taken seriously. I just made a bit of a side comment, but everyone likes the idea. I'll create a "Scale of the Life Universe" topic under "General discussion."

Edit:
There is life on Mars. We put it there with not-completely-sterilized rovers.
And, for that matter, the Moon, Jupiter, Titan, and 67P/Churyumov–Gerasimenko.

User avatar
Mr. Missed Her
Posts: 90
Joined: December 7th, 2016, 12:27 pm
Location: Somewhere within [time in years since this was entered] light-years of you.

Wiki article

Post by Mr. Missed Her » March 17th, 2017, 8:18 pm

Since I FINALLY have a trusted wiki account, I'll add the article. I'll call it "Calcyman's megacell," tell me/edit the article if it should have a different name. (Sorry, but the metacell doesn't seem to have a designated name.) Also, I won't add a lot of information, because I don't know where to find all of it.

Edit: The "Categories" bar here is pretty funny.
There is life on Mars. We put it there with not-completely-sterilized rovers.
And, for that matter, the Moon, Jupiter, Titan, and 67P/Churyumov–Gerasimenko.

User avatar
calcyman
Moderator
Posts: 2932
Joined: June 1st, 2009, 4:32 pm

Re: Wiki article

Post by calcyman » March 18th, 2017, 8:31 am

Mr. Missed Her wrote:Edit: The "Categories" bar here is pretty funny.
The metacell I'm currently building (where the ground state has population 0) will have an even more ludicrous categories bar: the period is expected to be 2^34 (if I'm lucky) or 2^36 (if I'm unlucky); the grid size will be the square-root of this.
What do you do with ill crystallographers? Take them to the mono-clinic!

Post Reply