Tiled CA

For discussion of other cellular automata.
Post Reply
bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Tiled CA

Post by bprentice » January 28th, 2013, 3:01 pm

Those of you who run Windows XP or Windows 7 may enjoy this program:

http://bprentice.webenet.net/TiledCA/TiledCA.html

The pattern editing capability is weak compared to my Java CA simulators, but it does demonstrate that the Generations rule can magically create ships on even the most complex tiling of the world.

Brian Prentice

EricG
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: Tiled CA

Post by EricG » June 12th, 2013, 4:03 am

I'm very impressed with Tiled CA. It almost makes me want to buy a Windows machine. But fortunately, this evening I found a Java program which is designed to be compatible with Tiled CA:

http://www.pecanbread.com/tinycat2001/p ... ecellauto/

Unfortunately, it doesn't allow the user to create new tilesets, but it can load Tiled CA tilesets and run Tiled CA patterns, and that's a boon for non-Windows users.

Also:
In my "Tiling in Golly" postings, I talk about using Tiled CA to run CAs on 16 uniform and dual-uniform tilings (see http://en.wikipedia.org/wiki/List_of_co ... rm_tilings) Cairo Pentagonal Tiling is P1.til, which is included with Tiled CA, so that's 1 down.

I did get one session with the original Tiled CA, and I came up with this TriHexagonal (or "Kagome") tileset, which is another one of the 16, so that's 2 down!

Save this as "Kagome.til"

Code: Select all

AutomaticTiling = 1
NeighbourPoints = 1
WrapEdges = 1
GridSize = 2
Tile 1
NumPoints = 7
GridLocX = 0
GridLocY = 3
TileType = 14
Point1
X = 0
Y = 0
Point2
X = 1
Y = -1
Point3
X = 2
Y = 0
Point4
X = 2
Y = 2
Point5
X = 1
Y = 3
Point6
X = 0
Y = 2
Point7
X = 0
Y = 0
Tile 2
NumPoints = 7
GridLocX = 2
GridLocY = 5
TileType = 14
Point1
X = 0
Y = 0
Point2
X = 1
Y = -1
Point3
X = 2
Y = 0
Point4
X = 2
Y = 2
Point5
X = 1
Y = 3
Point6
X = 0
Y = 2
Point7
X = 0
Y = 0
Tile 3
NumPoints = 7
GridLocX = 0
GridLocY = 7
TileType = 14
Point1
X = 0
Y = 0
Point2
X = 1
Y = -1
Point3
X = 2
Y = 0
Point4
X = 2
Y = 2
Point5
X = 1
Y = 3
Point6
X = 0
Y = 2
Point7
X = 0
Y = 0
Tile 4
NumPoints = 4
GridLocX = 0
GridLocY = 1
TileType = 2
Point1
X = 0
Y = 0
Point2
X = 1
Y = 1
Point3
X = 0
Y = 2
Point4
X = 0
Y = 0
Tile 5
NumPoints = 4
GridLocX = 2
GridLocY = 3
TileType = 2
Point1
X = 0
Y = 0
Point2
X = 1
Y = 1
Point3
X = 0
Y = 2
Point4
X = 0
Y = 0
Tile 6
NumPoints = 4
GridLocX = 4
GridLocY = 3
TileType = 4
Point1
X = 0
Y = 0
Point2
X = 0
Y = 2
Point3
X = -1
Y = 1
Point4
X = 0
Y = 0
Tile 7
NumPoints = 4
GridLocX = 2
GridLocY = 1
TileType = 4
Point1
X = 0
Y = 0
Point2
X = 0
Y = 2
Point3
X = -1
Y = 1
Point4
X = 0
Y = 0
Tile 8
NumPoints = 7
GridLocX = 2
GridLocY = 9
TileType = 14
Point1
X = 0
Y = 0
Point2
X = 1
Y = -1
Point3
X = 2
Y = 0
Point4
X = 2
Y = 2
Point5
X = 1
Y = 3
Point6
X = 0
Y = 2
Point7
X = 0
Y = 0
Tile 9
NumPoints = 7
GridLocX = 2
GridLocY = 1
TileType = 14
Point1
X = 0
Y = 0
Point2
X = 1
Y = -1
Point3
X = 2
Y = 0
Point4
X = 2
Y = 2
Point5
X = 1
Y = 3
Point6
X = 0
Y = 2
Point7
X = 0
Y = 0
Tile 10
NumPoints = 4
GridLocX = 0
GridLocY = 5
TileType = 2
Point1
X = 0
Y = 0
Point2
X = 1
Y = 1
Point3
X = 0
Y = 2
Point4
X = 0
Y = 0
Tile 11
NumPoints = 4
GridLocX = 2
GridLocY = 7
TileType = 2
Point1
X = 0
Y = 0
Point2
X = 1
Y = 1
Point3
X = 0
Y = 2
Point4
X = 0
Y = 0
Tile 12
NumPoints = 4
GridLocX = 2
GridLocY = 5
TileType = 4
Point1
X = 0
Y = 0
Point2
X = 0
Y = 2
Point3
X = -1
Y = 1
Point4
X = 0
Y = 0
Tile 13
NumPoints = 4
GridLocX = 4
GridLocY = 7
TileType = 4
Point1
X = 0
Y = 0
Point2
X = 0
Y = 2
Point3
X = -1
Y = 1
Point4
X = 0
Y = 0
Tile 14
NumPoints = 7
GridLocX = 0
GridLocY = 11
TileType = 14
Point1
X = 0
Y = 0
Point2
X = 1
Y = -1
Point3
X = 2
Y = 0
Point4
X = 2
Y = 2
Point5
X = 1
Y = 3
Point6
X = 0
Y = 2
Point7
X = 0
Y = 0
Tile 15
NumPoints = 4
GridLocX = 0
GridLocY = 9
TileType = 2
Point1
X = 0
Y = 0
Point2
X = 1
Y = 1
Point3
X = 0
Y = 2
Point4
X = 0
Y = 0
Tile 16
NumPoints = 4
GridLocX = 2
GridLocY = 9
TileType = 4
Point1
X = 0
Y = 0
Point2
X = 0
Y = 2
Point3
X = -1
Y = 1
Point4
X = 0
Y = 0
Tile 17
NumPoints = 4
GridLocX = 2
GridLocY = 11
TileType = 2
Point1
X = 0
Y = 0
Point2
X = 1
Y = 1
Point3
X = 0
Y = 2
Point4
X = 0
Y = 0
Tile 18
NumPoints = 4
GridLocX = 4
GridLocY = 11
TileType = 4
Point1
X = 0
Y = 0
Point2
X = 0
Y = 2
Point3
X = -1
Y = 1
Point4
X = 0
Y = 0
B3/S23 is a good rule in Kagome, so here it is in Tiled CA format. Save this rule as "Kagome-B3_S23.rul"

Code: Select all

Triangle
Survival = 2,3
Birth = 3
States = 2
Square
Survival = 
Birth = 
States = 2
Parallelogram
Survival = 
Birth = 
States = 2
Pentagon
Survival = 
Birth = 
States = 2
Hexagon
Survival = 2,3
Birth = 3
States = 2
Octagon
Survival = 
Birth = 
States = 2

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Tiled CA

Post by bprentice » June 13th, 2013, 8:40 am

Eric,

The Generations rule B23/S34/4 played on P1.til would be a good example to run on Golly. Please provide simple step by step instructions on how to do it.

Brian

EricG
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: Tiled CA

Post by EricG » June 13th, 2013, 11:33 am

Hi Brian!

No problem!

Short version: Run the PentaCairo5.py script, type in "B23/S34/C4", and you're done!

But here's a more complete answer:

1) Be sure Python is installed on your machine. See "Installing Python" in the "Python Scripting" section of Golly's built-in "Help" menu.

2) Visit my Golly Tiling thread: viewtopic.php?f=11&t=1123 and follow the link there to download "Tiling Project for Golly"

3) Move the contents of "Icons and Example Rules" to Golly's Rules folder.

4) Move the folder naned "Tiling Project Scripts" to within Golly's Scripts folder. The Tiling Project Scripts folder used to be called "Scripts for Generating Rules", which I realized wasn't a good choice. If your downloaded version is called that, just rename the folder.

Alternatively: Andrew suggested a better way to use Golly. He suggested using the "Set Pattern Folder" command under Golly's "File" menu, and setting your "pattern folder" to actually be your topmost Golly folder. See the last item in "Some useful hints and tips" in Golly 2.5 Help section, or see the discussion here: viewtopic.php?f=7&t=1080#p7907 (and search on the phrase "Patterns panel").

If you follow Andrew's advice, you can just move the entire Tiling Project folder to your Golly folder.

5) Run Golly, click on the scripts button (or the patterns button if you follow Andrew's advice), and navigate to the "PentaCairo5.py" script. Click on it.

6) PentaCairo5.py will prompt you to enter a new rule. Enter "B23/S34/C4". Wait a few minutes while the new rule file is created. When the rule is ready, Golly will switch to PentaCairo5-B23_S34_C4.

7) Note that PentaCairo5 rules have "alternating Golly cells" in the sense that I explained in the Golly Tiling thread, so you'll want a valid seed. The easiest way to do this is to switch to an exploding rule like PentaCairo_B1_S, draw one cell, allow the pattern to explode, and then switch back to PentaCairo5-B23_S34_C4 and see what develops.

I see lots of triangle-shaped rakes, and triangle-shaped spaceships like this one:

Code: Select all

x = 52, y = 30, rule = PentaCairo5-B23_S34_C4
2$27.FEC$26.EFADA$24.F.BEFCBC$24.EF.DEFADA$22.F.BEF.BEFCBC$22.EF.DEF.
DEFADA$20.F.BEF.BEF.BEFCBC$20.EF.DEF.DEF.DEFADA$18.F.BEF.BEF.BEF.BEFC
BC$18.EF.DEF.DEF.DEF.DEFADA$16.F.BEF.BEF.BEF.BEF.BEFCBC$16.EF.DEF.DEF
.DEF.DEF.DEFADA$14.F.BEF.BEF.BEF.BEF.BEF.BEFCBC$14.EF.DEF.DEF.DEF.DEF
.DEF.DEFADA$12.F.BEF.BEF.BEF.BEF.BEF.BEF.BEFCBC$12.EF.DEF.DEF.DEF.DEF
.DEF.DEF.DEFADA$10.F.BEF.BEF.BEF.BEF.BEF.BEF.BEF.BEFCBC$10.EF.DEF.DEF
.DEF.DEF.DEF.DEF.DEF.DEFADA$8.F.BEF.BEF.BEF.BEF.BEF.BEF.BEF.BEF.B2FCB
C$28.FEA12.EFDAD$27.FEC15.FEC$25.FED!

PentaCairo5 and PentaCairo5-VN are currently the only scripts in the Tiling Project which support Generations rules. The rest of the scripts are for two state rules only. However... ...it would be easy to modify the Truncated Square tiling script - that's Squares and Octogons, which, in Tiled CA, is the SO1.til tileset. If you have any interest in Generations for Squares and Octogons, just let me know, and I'd be happy to update the script.

Getting back to what I originally posted about: Other tilesets included in Tiled CA which are on the list of 16 Uniform and Dual-Uniform tilngs are Prismatic Pentagonal tilng (the P2.til tileset) and Tetrakis Square tiling (the T2.til tileset). So that's P1.til, P2.til, T2.til, SO1.til, and Kagome.til -- that's at least 5 of the 16 so far!

-- Eric


PS I will get back to our Knightlife conversation too.

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Tiled CA

Post by bprentice » June 13th, 2013, 11:15 pm

Eric,

I've successfully explored Kagome-B3_S23 and PentaCairo5-B23_S34_C4 using Golly 2.5, but I'm having trouble selecting rules. This is what I'd like to do:

Place all of your new tiling rules in a sub_directory of my Golly rule directory. Select a rule using a dialog that allows me to browse through my rule directory and its sub_directories. Select an area of the world and set it to random states. Explore the selected rule.

Sadly, Golly's Control/Set Rule... dialog does not do that.

Any comment?

Brian

EricG
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: Tiled CA

Post by EricG » June 14th, 2013, 12:40 am

Your comment illustrates why I was so exuberant about what I referred to above as "Andrew's advice" (the bit about going to viewtopic.php?f=7&t=1080#p7907 and searching for the phrase "Pattern panel").

Here's how to do what you want to do:

If you follow Andrew's advice, and use File->Set Pattern Folder to set your patterns folder to Golly's top level directory, and if you move all the .rule files from my Tiling Project into your Rules folder, then you can do this:
1) Start Golly 2.5,
2) Open up your Rules folder in the "Pattern panel", and switch from rule to another by simply clicking on the rule's name,
3) Use the select tool to draw a green translucent rectangle
4) Use Edit->Random Fill to randomly fill that selected rectangle with cells. You'll probably want to use the keyboard shortcut for the random-fill, which is either control-5 or command-5 (see Golly's Edit menu).

A few more comments. You might already know some of the following, but just in case you don't:


1) At a bare minimum, instead of doing all of the above, you could just copy all the .rule files into Golly's Rules folder, and then click directly on my example patterns. You can click on the patterns directly from the OS (in Windows and Mac at least, and I presume you can in Linux too) or from within Golly using the Patterns panel. The patterns themselves might be of interest, but the more important thing is that when you click on a pattern file, Golly will switch to the pattern's rule, and then you can do a random-fill.

2) For my Tiling Project rules, be sure to set View->Show Cell Icons to checked. The icons are what makes this fun! (Admittedly, not as fun as in TiledCA, where you always get to see the correct icons, but it is still fun!)

3) In Golly's Preferences, in the Edit section, you can pick what percentage of random fill you'd like. I always leave it set at 33%.

4) I think I've already explained at length that you'll get great results if you're working with rules which have "Non-alternating Golly cells" and you'll get risky results when working with rules which have "Alternating Golly cells". If, as I suspect, you're just trying to get a feel for the rule, then the "risk" is rather over-stated. The problem only comes up when you're trying to engineer a gun or some other complex pattern - that's when you want to be sure that all the cells have the proper parity. If anyone reading this is still confused about this "parity" issue, please ask. I'll try to do a better job of explaining it.

5) TruncatedHex is the best tiling! Try my example patterns!

EricG
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: Tiled CA

Post by EricG » June 14th, 2013, 1:02 am

Oh, I just remembered that you wanted to categorize the rules in folders. Yes, I'd like that too. As far as I can tell, Golly needs all of its rules in one flat directory. I've thought about how Golly might work differently, so that rules could be put into subfolders, but I've never thought of a scheme that I thought Andrew wouldn't immediately shoot down. :D

In the Patterns panel, you'll see the rules in alphabetical order. Golly encourages the user to name rules in the same rule family with the same prefix, because of the way icons are shared (once with .icons files, and now with *-shared.rule files). So, TruncatedHex-B26_S3569 will be listed right next to TruncatedHex-B26_S3569ab in the patterns panel, and you'll never have to use the Set Rule dialog, so cheer up, it's not so bad.

User avatar
Andrew
Moderator
Posts: 928
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Tiled CA

Post by Andrew » June 14th, 2013, 9:29 am

EricG wrote:... At a bare minimum, instead of doing all of the above, you could just copy all the .rule files into Golly's Rules folder...
That is definitely NOT a good idea. In 2.5 I've added the following item in Help > Hints and Tips describing what I think is the best way to organize your Golly folder:

Avoid the temptation to put your own patterns, scripts or rules inside Golly's supplied folders — it will make it difficult to upgrade to a future version. A much better idea is to create separate folders for your own files and put those folders alongside the supplied folders, so your Golly folder looks something like this:

Code: Select all

Golly
    Golly.exe     (Golly.app on Mac, golly on Linux)
    Help
    Patterns
    Rules
    Scripts
    My-downloads  (contains all your downloaded files; select in Preferences > File)
    My-patterns   (contains all your pattern files)
    My-rules      (contains all your .rule files; select in Preferences > Control)
    My-scripts    (contains all your .pl/.py files)
Use File > Set Patterns Folder and select the Golly folder. Now all your folders (and the supplied folders) are visible in the patterns panel, so with just a few clicks you can load any pattern, run any script, or switch to any .rule file. Or you can right-click (or control-click) on any of those files to open them in your preferred text editor. When upgrading to a new version of Golly, simply drag all the distributed files and folders into your Golly folder and replace the old versions.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

EricG
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: Tiled CA

Post by EricG » June 14th, 2013, 10:29 am

I didn't want to make this tread even more complicated by disambiguating between the user's "Rules" folder and the distributed "Rules" folder. Andrew, why not make this distinction built-in? Call one folder "Distributed Rules" and supply another folder, an empty one, called "My Rules" (or whatever - I'm suggesting an idea, not particular folder names). You could supply two folders for scripts as well - Distributed and My Scripts.

Edit: And you could replace either the "Patterns" button or the "Scripts" button or both with a button called "Files" which just does the right thing and shows the file tree starting at the top Golly directory.
Last edited by EricG on June 14th, 2013, 10:34 am, edited 1 time in total.

User avatar
Andrew
Moderator
Posts: 928
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Tiled CA

Post by Andrew » June 14th, 2013, 10:33 am

bprentice wrote:Place all of your new tiling rules in a sub_directory of my Golly rule directory. Select a rule using a dialog that allows me to browse through my rule directory and its sub_directories. Select an area of the world and set it to random states. Explore the selected rule.
Here are 2 ideas that should help:

1. Save the following script as test-rule.py and run it in Golly (from File > Run Script, or click on it in the left panel, or drop it onto the Golly window, or use Prefs > Keyboard to create a keyboard shortcut to run it):

Code: Select all

# Prompt user for a .rule file, load it and create a test pattern.
# Author: Andrew Trevorrow (andrew@trevorrow.com), June 2013.

import golly as g
import os.path

rulefile = g.opendialog("Select a .rule file",
                        "Rule files (*.rule)|*.rule",
                        g.getdir("rules"))
if len(rulefile) == 0: g.exit()
rulename = os.path.basename(rulefile).rsplit(".rule")[0]
g.new("testing rule")
g.setrule(rulename)
g.select([0,0,100,100])
g.randfill(33)
g.select([])
g.fit()
2. Put your desired .rule files and pattern files in a .zip file which you can open in Golly and then click on the various links to switch to a rule or load a pattern. Eric's Tiling .zip file is an excellent example of what you can do.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Tiled CA

Post by bprentice » June 14th, 2013, 2:33 pm

Thank you for all the suggestions guys. This is what I have done. I've organized all of my rules in sub-directories of directory golly-2.5-mac/My Rules. Now all I have to do to use them is point to the sub-directory that I want using menu Preferences.Control.Your Rules...

Administrator, this last set of posts should probably be moved to a new appropriately named thread.

Brian Prentice

User avatar
Andrew
Moderator
Posts: 928
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Tiled CA

Post by Andrew » June 14th, 2013, 7:32 pm

EricG wrote:Andrew, why not make this distinction built-in? Call one folder "Distributed Rules" and supply another folder, an empty one, called "My Rules" (or whatever - I'm suggesting an idea, not particular folder names). You could supply two folders for scripts as well - Distributed and My Scripts.
Not a bad idea, but I'm a little worried that it makes it easier to accidentally clobber your files when upgrading. At the moment, to upgrade to a new version you simply drag everything from the new folder into your Golly folder. In your scheme people would have to remember not to drag the empty "My *" folders.
Edit: And you could replace either the "Patterns" button or the "Scripts" button or both with a button called "Files" which just does the right thing and shows the file tree starting at the top Golly directory.
Yep, good idea. I'll probably do this in the next version (remind me next year!).
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

Post Reply