Pattern viewer for forum threads

For discussion directly related to ConwayLife.com, such as requesting changes to how the forums or home page function.
User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 29th, 2020, 10:58 am

Something else I've noticed is that while loading in, UI elements of embedded viewers still appear cyan as in pre-2019, for some reason. Copying the example from the LifeSuper thread, which exhibits this:

Code: Select all

x = 386, y = 395, rule = SuperLH
7.O.O$8.2O$8.O2$383.O.O$383.2O$384.O$13.O.O$14.2O$14.O4$378.U.U$17.U
360.2U$11.O.O4.U360.U$12.2O2.3U$12.O6$37.M$35.M.M$36.2M2$31.S343.M$
32.S338.O2.M$30.3S336.2O3.3M$359.S10.2O$357.2S$358.2S12$58.Q.Q$59.2Q$
59.Q291.Q.Q$351.2Q$62.Q.Q287.Q$63.2Q$63.Q7$346.S$344.2S$345.2S$78.S$
79.2S$78.2S$359.Q$343.S14.Q$342.S15.3Q$342.3S4.S$348.S$348.3S4$345.S$
343.2S$344.2S$84.M.M$85.2M$85.M229.M$313.2M$314.2M2$80.M.M$81.2M$81.M
4$87.W217.S$88.W215.S$86.3W215.3S3$106.Q$107.2Q$106.2Q$305.Q$85.M218.
Q$83.M.M218.3Q$84.2M11$305.O.O$305.2O$306.O$292.S$291.S$291.3S6$296.S
$296.S.S$296.2S4$286.U$285.U$285.3U2$283.U$281.2U$282.2U5$129.Q147.Q$
127.Q.Q135.S.S9.Q.Q$128.2Q135.2S10.2Q$266.S$244.M$244.M.M$244.2M7$
257.O$256.O$256.3O45$204.2H.2H$200.H.3H3.H$200.2H4.2H$203.2H.H$204.H
3.H$200.2H2.H2.2H$200.H.H.2H$202.H2.H.2H$202.2H2.H.H29$245.2M$245.M.M
$245.M6$252.2M$251.2M$253.M4$259.3O$259.O$260.O$136.M$136.2M$135.M.M
4$145.2M$146.2M$145.M120.S$265.2S$265.S.S2.2pA$144.2S114.2S8.pA.pA$
143.S.S113.2S9.pA$145.S115.S2$150.2S$149.S.S$151.S$264.S$131.2Q130.2S
9.2Q$132.2Q3.2Q124.S.S7.2Q$131.Q4.Q.Q136.Q$138.Q2$268.2Q$268.Q.Q$268.
Q$287.U$286.2U$286.U.U$129.2Q$128.Q.Q146.3U$124.2U4.Q146.U$125.2U151.
U8.2M3.2S$124.U162.M.M.2S6.2S$287.M5.S5.S.S$299.S3$301.3O$301.O$302.O
$307.3Q$307.Q$308.Q9$90.2W$89.W.W$91.W9$77.M$77.2M$76.M.M8$81.2M$82.
2M228.2M$81.M229.2M$313.M6$347.2S$347.S.S$347.S3$342.S$341.2S$341.S.S
$74.2S$75.2S$74.S2$333.3S$333.S$334.S2$77.3S$79.S$78.S277.2Q$356.Q.Q$
51.Q304.Q$51.2Q3.Q311.3O$50.Q.Q3.2Q310.O$29.3S23.Q.Q295.3Q13.O7.2M$
31.S321.Q23.M.M$30.S323.Q22.M2$55.Q5.2Q$42.Q12.2Q5.2Q$42.2Q10.Q.Q4.Q$
41.Q.Q20$7.3O$9.O$8.O6$3O$2.O$.O!
[[ THUMBNAIL THUMBSIZE 2 HEIGHT 640 ZOOM 4 PAUSE 2 AUTOSTART LOOP 840 ]]
Haven't tested this on PC, but it's definitely easy to see on ipad if you refresh the page with the viewer in sight.

Also, SuperLH redirects to LifeSuper on the wiki, but the alias shown in the T menu is still SuperLH

hkoenig
Posts: 259
Joined: June 20th, 2009, 11:40 am

Re: Pattern viewer for forum threads

Post by hkoenig » January 29th, 2020, 1:56 pm

You need to add a way to copy the starting pattern as just a simple RLE, removing the LifeHistory, or LifeUltra extensions.

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 29th, 2020, 2:58 pm

hkoenig wrote:
January 29th, 2020, 1:56 pm
You need to add a way to copy the starting pattern as just a simple RLE, removing the LifeHistory, or LifeUltra extensions.
Something that removes all states beyond state 1 and converts it to the 2-state version?

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 29th, 2020, 4:28 pm

Back on the topic of bugs: Identify now says this has a 2x4 bounding box, which is likely incorrect as it only occupies a 2x2 space:

Code: Select all

x = 3, y = 2, rule = MargSingRot
b2o$b2o!
[[ THEME Catagolue ]]
And another touchscreen bug: quickly tapping on the zoom bar causes the slider to make the area behind it completely transparent and reveals the background. Especially visible with Catagolue/Inverse/etc theme.

Closing the viewer popup in this state and reopening it will have that effect still be visible on the slider.
Last edited by muzik on January 29th, 2020, 4:32 pm, edited 1 time in total.

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

Re: Pattern viewer for forum threads

Post by dvgrn » January 29th, 2020, 4:31 pm

muzik wrote:
January 29th, 2020, 2:58 pm
hkoenig wrote:
January 29th, 2020, 1:56 pm
You need to add a way to copy the starting pattern as just a simple RLE, removing the LifeHistory, or LifeUltra extensions.
Something that removes all states beyond state 1 and converts it to the 2-state version?
Not exactly, because in LifeSuper at least, all the odd states are ON states, so the correct conversion is similar to what's in toLife.lua in Golly (Alt+J is the default keyboard shortcut).

The Golly 3.3 toLife.lua only works applies the odd-states-are-ON rule up to a seven-state rule like LifeHistory, though. Here's an updated toLife.lua that should work for LifeHistory or LifeSuper.

Code: Select all

-- Fast LifeHistory/LifeSuper/LifeUltra to Life converter by Michael Simkin,
--   intended to be mapped to a keyboard shortcut, e.g., Alt+J
-- Sanity checks, Lua translation, and Super/Ultra updates by Dave Greene, January 2020
-- Creates special rule and runs it for one generation, then switches to Life 
-- Replace 2k + 1-> 1 and 2k -> 0
-- Preserves step and generation count

local g = golly()

local rule = g.getrule()
-- No effect if already in B3/S23 rule
if g.getrule()=="B3/S23" or string.sub(g.getrule(),1,7)=="B3/S23:" then g.exit() end

-- If not in LifeHistory, assume that it's a similar rule with even-numbered OFF states
-- (Edit > Undo will be available to return to the original rule if needed)
if string.sub(g.getrule(),1,11)~="LifeHistory" 
   and string.sub(g.getrule(),1,9)~="LifeSuper"
   and string.sub(g.getrule(),1,9)~="LifeUtra" then g.setrule("LifeHistory") end

ruletext = [[@RULE LifeSuperToLife
@TABLE
n_states:35
neighborhood:oneDimensional
symmetries:none
var a={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34}
var b={a}
var c={2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34}
var d={3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33}
c,a,b,0
d,a,b,1]]
   
local function CreateRule()
    local fname = g.getdir("rules").."LifeSuperToLife.rule"
    local f=io.open(fname,"r")
    if f~=nil then
        io.close(f)  -- rule already exists
    else 
        local f = io.open(fname, "w")
        if f then
            f:write(ruletext)
            f:close()
        else
            g.warn("Can't save LifeSuperToLife rule in filename:\n"..filename)
        end
    end
end
      
CreateRule()
g.setrule("LifeSuperToLife")
g.run(1)
step = g.getstep()
g.setrule("Life")
g.setalgo("HashLife")
g.setstep(step)
g.setgen("-1")
It will try something for LifeUltra, but it probably won't do the right things for all the states above 25 at the moment. I'm hoping those states can get sorted around so that the odd states are ON and the even states are OFF.

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 29th, 2020, 5:23 pm

muzik wrote:
January 29th, 2020, 10:58 am
Something else I've noticed is that while loading in, UI elements of embedded viewers still appear cyan as in pre-2019, for some reason.
It's because cyan is the default Theme in the UI library and this doesn't get overridden until the pattern loads. For repository rules this can take a couple of seconds.

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 29th, 2020, 5:58 pm

rowett wrote:
January 27th, 2020, 2:59 pm
muzik wrote:
January 26th, 2020, 4:48 pm
PCA cells change colour when the theme is changed to one outside of the PCA theme, which I don't find is helpful, as the colours don't end up making much sense.
I don't mind the different colours but I'm happy for you to provide some better Themes if you wish.
A suggestion for PCA colours for the Blues theme:

Code: Select all

x = 14, y = 2, rule = PCA_4
ABCDEFGHIJKLMN$ABCDEFGHIJKLMN!
[[ COLOR BACKGROUND 0 0 0 COLOR DEAD 0 0 127 COLOR DEADRAMP 0 0 47
COLOR N 96 0 128
COLOR E 0 104 128
COLOR S 0 0 255
COLOR W 128 128 192
COLOR NE 64 64 128
COLOR ES 0 64 192
COLOR SW 72 72 200
COLOR NW 96 64 128
COLOR NS 64 0 192
COLOR EW 64 104 128
COLOR ESW 43 64 149
COLOR NSW 85 43 170
COLOR NEW 85 85 128
COLOR NES 48 48 176
COLOR NESW 64 64 160 ]]
If this one doesn't look too bad I'll work on PCA colour ideas for the remaining themes over the next few weeks.

Also, when will the UI themes be added?

hkoenig
Posts: 259
Joined: June 20th, 2009, 11:40 am

Re: Pattern viewer for forum threads

Post by hkoenig » January 29th, 2020, 6:10 pm

muzik wrote:Something that removes all states beyond state 1 and converts it to the 2-state version?
Correct. RIght now I have to open up Golly, paste it, reselect it, find and run the conversion script, and then I finally have something that can be read by older programs.

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 29th, 2020, 6:19 pm

I'd prefer a "only copy states 1 and 2" button, personally, since it fits in with my Evil Plan, but a dedicated clear selection button would also work just as well.

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

Re: Pattern viewer for forum threads

Post by dvgrn » January 29th, 2020, 7:02 pm

hkoenig wrote:
January 29th, 2020, 6:10 pm
muzik wrote:Something that removes all states beyond state 1 and converts it to the 2-state version?
Correct. RIght now I have to open up Golly, paste it, reselect it, find and run the conversion script, and then I finally have something that can be read by older programs.
For LifeHistory patterns there's a somewhat better method. Here's a sample pattern:

Code: Select all

x = 37, y = 30, rule = LifeHistory
37F$F35.F$F8.2A4.2D3.2D4.2A8.F$F9.A3.D2.D.D2.D3.A9.F$F7.A8.D4.D5.A7.F
$F7.5A3.D3.2D2.5A7.F$F11.A2.D6.D.A11.F$F5.4AB3.D4.D2.D3.B4A5.F$F5.A2.
A2B2.4D2.2D3.2BA2.A5.F$F6.7B9.7B6.F$F7.7B.B3.B.7B7.F$F7.6B.B2A.2AB.B
3A2B7.F$F8.B2E4B2A.2A2BA2BAB8.F$F7.6B.2B3.2B.A3BAB7.F$F7.6B9.B4AB7.F$
F7.2B3AB2.5B2.3BA2B7.F$F4.2A2.BA2BA3B2C9B2.2A4.F$F4.A3.5BA.C2BCB.6B3.
A4.F$F.2A.A.B3A2BA3B2C11B.A.2A.F$F.A.2A.6AB2.5B2.5B2A.2A.A.F$F6.A2.3B
11.3B2.A6.F$F6.A.AB15.BA.A6.F$F7.2AB15.B2A7.F$F11.A11.A11.F$F7.5A11.
5A7.F$F7.A19.A7.F$F9.A15.A9.F$F8.2A15.2A8.F$F35.F$37F!
Ctrl+Delete removes all the extraneous history cells, and also marked (white or red or yellow) cells and gray boundary cells.

However, when you do a copy it will still copy the remaining state-1 cells in multistate format, because the rule is still set to LifeHistory. So a copied pattern still wouldn't drop cleanly into an older program. To fix that you would then have to hit Alt+R and change the rule to B3/S23 before copying.

Currently you can't do Alt+R and change directly from LifeHistory to Life if the pattern has marked ON cells, because a direct conversion simply drops all the higher cell states (i.e., they get turned off). If a pattern is just states 1 and 2 it will work fine, though. Maybe this can be improved, especially if specific LifeViewer support is added for LifeSuper and/or LifeUltra.

EDIT: Ah, right, there's a much quicker conversion method than that: just hit Alt+J to turn off the display of the extra LifeHistory states. Then Ctrl+C to copy. LifeViewer still remembers the extra states, but when they're not being displayed, the copy sent to the clipboard will be in the old standard two-state format.

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 29th, 2020, 7:12 pm

Can LifeViewer have the ability to convert TriLife patterns into its own native triangular format?

This spaceship (bundled with TriLife.zip):

Code: Select all

x = 5, y = 3, rule = TriLife-B45S34
2.2A$CABC$BC.BA!
would be turned into this:

Code: Select all

x = 8, y = 3, rule = B45/S34L
5bobo$3o2b3o$3o3b2o!

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 29th, 2020, 8:02 pm

Triangular rule aliases:

Code: Select all

Life 4644 : B4/S456L
Life 3445 : B45/S34L
Life 4546 : B456/S45L
Life 2346 : B456/S23L
Life 3446 : B456/S34L
Life 2345 : B45/S23L
Rule 1246 : B456/S12L
Life 2333 : B3/S23L
Rule 3544 : B4/S345L
from the following paper: https://wpmedia.wolfram.com/uploads/sit ... 08-2-4.pdf

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 30th, 2020, 9:22 am

I'm not sure if lifeviewer is calculating mods for PCA patterns correctly anymore. This should have a mod a quarter of its period but does not:

Code: Select all

 x = 4, y = 3, rule = PCA_4
A.B$3.B$2.F!

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 30th, 2020, 9:49 am

muzik wrote:
January 28th, 2020, 5:58 pm
The following four patterns return different values for Mod.
Fixed, thanks!

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 30th, 2020, 9:49 am

muzik wrote:
January 30th, 2020, 9:22 am
I'm not sure if lifeviewer is calculating mods for PCA patterns correctly anymore.
Fixed, thanks!

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 30th, 2020, 9:50 am

muzik wrote:
January 28th, 2020, 8:31 pm
This appears to rotate, not flip, and has a mod a quarter of its period, so FlipXY doesnt seem correct.
Fixed, thanks!

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 30th, 2020, 9:51 am

muzik wrote:
January 29th, 2020, 10:44 am
Script commands for defining cell colours for ruletable rules only seem to work on the very last cell state
Fixed, thanks!
muzik wrote:
January 29th, 2020, 10:44 am
Also can we have the ability to specify colours for dying generations states by name since we can do so for [R]History and PCA?
I've put it on the backlog.

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 30th, 2020, 11:57 am

Cheers again!

Can you add the triangular aliases from the post a few posts above yours, as well as the remaining aliases from this commit?

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 30th, 2020, 12:15 pm

muzik wrote:
January 30th, 2020, 11:57 am
Can you add the triangular aliases from the post a few posts above yours, as well as the remaining aliases from this commit?
Already done it will be in the next build. Most of the aliases from the commit were already there.

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 30th, 2020, 12:17 pm

muzik wrote:
January 29th, 2020, 7:12 pm
Can LifeViewer have the ability to convert TriLife patterns into its own native triangular format?
Maybe. What's the conversion?

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 30th, 2020, 12:20 pm

muzik wrote:
January 29th, 2020, 10:58 am
Also, SuperLH redirects to LifeSuper on the wiki, but the alias shown in the T menu is still SuperLH
Well SuperLH was what was asked for in the pattern.

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 30th, 2020, 12:25 pm

rowett wrote:
January 30th, 2020, 12:17 pm
muzik wrote:
January 29th, 2020, 7:12 pm
Can LifeViewer have the ability to convert TriLife patterns into its own native triangular format?
Maybe. What's the conversion?
Not sure exactly what you mean, but each cell is divided diagonally into two triangles (best seen with icons):

State 1: Upwards-pointing triangle
State 2: Downwards-pointing triangle
State 3: Both types of triangle in one cell

So an area filled with state 1 cells would be converted a checkerboard of up pointing triangles.

The TriLife implementation has roughly the same symmetries as natively supported golly hexagonal rules, unlike with lifeviewer's, so there might need to be a bit of weird rotation done to make patterns work.

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 30th, 2020, 1:45 pm

muzik wrote:
January 30th, 2020, 12:25 pm
Not sure exactly what you mean...

The TriLife implementation has roughly the same symmetries as natively supported golly hexagonal rules, unlike with lifeviewer's, so there might need to be a bit of weird rotation done to make patterns work.
I guess what I'm saying is it's not a priority to me so I'm not going to work it out but if some kind soul wants to detail the conversion steps then I'll probably implement it.

User avatar
rowett
Moderator
Posts: 3821
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » January 30th, 2020, 4:54 pm

muzik wrote:
January 29th, 2020, 4:28 pm
Identify now says this has a 2x4 bounding box, which is likely incorrect as it only occupies a 2x2 space
Fixed, thanks!
muzik wrote:
January 29th, 2020, 4:28 pm
And another touchscreen bug: quickly tapping on the zoom bar causes the slider to make the area behind it completely transparent and reveals the background.
I can't reproduce this. Has anyone else seen it?

User avatar
muzik
Posts: 5650
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Pattern viewer for forum threads

Post by muzik » January 30th, 2020, 5:32 pm

Can the triangular aliases be moved up as to be closer to the other range-1 outer-totalistic families? (Also the aliases themselves don't seem to be ordered alphabetically)

Also, it might be a better idea to have the outer totalistic alias categories ordered by number of cells in neighbourhood, something like the following:

(OT Triangular Edges (3))
OT von Neumann (4)
OT Hexagonal (6)
OT Moore (8)
(OT Triangular Vertices (9))
OT Triangular (12)

Isotropic non-totalistic and HROT could also follow this order where applicable.

What rulespace do you plan on adding support for next?

Post Reply