Life tag testing

For scripts to aid with computation or simulation in cellular automata.
Locked
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:
rowett wrote:Which browser are you using?
It was Chrome, Version 72.0.3626.119 (Official Build) (64-bit). Relaunched with Chrome Version 72.0.3626.121. The same misdrawn arrow still appears in LifeViewer
Same version here. I presume in that case it's your graphics card driver.
dvgrn wrote:In fact, that's the only browser I have installed that is allowing LifeViewer to do its "Show in Viewer" trick on the forums.
I've put a fix in build 306 for IE and Edge that should help.
User avatar
dvgrn
Moderator
Posts: 12053
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:
dvgrn wrote:In fact, that's the only browser I have installed that is allowing LifeViewer to do its "Show in Viewer" trick on the forums.
I've put a fix in build 306 for IE and Edge that should help.
Hmm, not sure what's going on here. I've rolled out Build 306, and have done a hard refresh and can see that it's build 306 in Internet Explorer (if I go to the LifeWiki or one of your test pages -- can't get LifeViewer to show up at all on the forums using IE, with either a [code​] tag or a [viewe​r] tag.)

But [code​] tags still aren't getting modified to add the "Show in Viewer" link in Internet Explorer or Edge, though they show up fine in Chrome. (EDIT: Right, no, it's only IE misbehaving in this case, Edge is fine now.)

Putting a copy of the arrow test pattern here just so it's on this new page of the thread:

Code: Select all

x = 9, y = 5, rule = B3/S23
$bo3b3o$b3o2bo$2bo!
#C [[ X -2 Y 14 ZOOM 13.6 ANGLE 0 ]]
#C [[ THEME Blues WIDTH 480 HEIGHT 480 ]]
#C Compass direction arrows
#C [[ ARROW 0 0 0 5 8 ]]
#C [[ ARROW 0 0 3.53 3.53 8 ]]
#C [[ ARROW 0 0 5 0 8 ]]
#C [[ ARROW 0 0 3.53 -3.53 8 ]]
#C [[ ARROW 0 0 -5 0 8 ]]
#C [[ ARROW 0 0 -3.53 3.53 8 ]]
#C [[ ARROW 0 0 -3.53 -3.53 8 ]]
#C [[ ARROW 0 0 0 -5 8 ]]
#C Colours
#C [[ COLOR ARROW Red ]]
#C [[ ARROW 6 0 6 7 8 ]]
#C [[ COLOR ARROW Green ]]
#C [[ ARROW 6 0 6 -7 8 ]]
#C [[ COLOR ARROW Blue ]]
#C [[ ARROW 6 0 13 0 8 ]]
#C [[ COLOR ARROW Cyan ]]
#C Sizes
#C [[ ARROWSIZE 1 0.2 ]]
#C [[ ARROW 0 10 6 10 8 ]]
#C [[ ARROWSIZE 2 0.2 ]]
#C [[ ARROW 0 14 6 14 8 ]]
#C [[ ARROWSIZE 3 0.2 ]]
#C [[ ARROW 0 18 6 18 8 ]]
#C [[ ARROWSIZE 4 0.2 ]]
#C [[ ARROW 0 22 6 22 8 ]]
#C [[ ARROWSIZE 1 0.4 ]]
#C [[ ARROW 10 10 16 10 8 ]]
#C [[ ARROWSIZE 2 0.4 ]]
#C [[ ARROW 10 14 16 14 8 ]]
#C [[ ARROWSIZE 3 0.4 ]]
#C [[ ARROW 10 18 16 18 8 ]]
#C [[ ARROWSIZE 4 0.4 ]]
#C [[ ARROW 10 22 16 22 8 ]]
#C [[ ARROWSIZE 3 0.2 ]]
#C Angles
#C [[ ARROWANGLE 30 ]]
#C [[ ARROW 15 0 24 0 8 ]]
#C [[ ARROWANGLE 60 ]]
#C [[ ARROW 15 0 24 0 8 ]]
#C The yellow arrow has a fixed angle
#C [[ ARROWANGLE 90 FIXED COLOR ARROW Yellow ]]
#C [[ ARROW 15 0 24 0 8 ]]
#C [[ ARROWANGLE 0 COLOR ARROW 240 255 255 ]]
#C Tracking
#C [[ ARROWTRACK -0.25 -0.25 ]]
#C [[ ARROW 43.5 36 39.5 32 8 ]]
#C [[ ARROWTRACK FIXED ]]
#C Lines
#C Draw square
#C [[ ARROWSIZE 3 0 ]]
#C [[ ARROW 0 -10 5 -10 8 ]]
#C [[ ARROW 5 -10 5 -15 8 ]]
#C [[ ARROW 5 -15 0 -15 8 ]]
#C [[ ARROW 0 -15 0 -10 8 ]]
# Draw green triangle
#C [[ COLOR ARROW Green ]]
#C [[ ARROW 10 -10 15 -10 8 ]]
#C [[ ARROW 15 -10 12.5 -15 8 ]]
#C [[ ARROW 12.5 -15 10 -10 8 ]]
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:(... can't get LifeViewer to show up at all on the forums using IE, with either a [code​] tag or a [viewe​r] tag.)
This is because the forum pages have the following line in them:

Code: Select all

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
This forces IE to emulate IE7 which doesn't have support for the Canvas features that LifeViewer uses so it's silently (and correctly) failing. Probably worth asking Nathaniel why it's there and if no longer needed then change it to:

Code: Select all

<meta http-equiv="X-UA-Compatible" content="IE=EDGE />
... which is what the Wiki uses.
dvgrn wrote: But [code​] tags still aren't getting modified to add the "Show in Viewer" link in Internet Explorer or Edge, though they show up fine in Chrome.
On my machine they work fine in Edge and Chrome, and fail as expected in IE.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:... making it possible to draw (for example) translucent polygons around regions, and label things that way.
If polygons are useful then it might be worth adding a [[ POLYLINE ]] family of commands since whilst you can specify them with ARROW commands it's a very long-winded way of doing so. I'm imagining:
[[ POLYLINE x1 y1 x2 y2 ... xn yn zoom ]]
Thoughts?
User avatar
dvgrn
Moderator
Posts: 12053
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:
dvgrn wrote:... making it possible to draw (for example) translucent polygons around regions, and label things that way.
If polygons are useful then it might be worth adding a [[ POLYLINE ]] family of commands since whilst you can specify them with ARROW commands it's a very long-winded way of doing so. I'm imagining:
[[ POLYLINE x1 y1 x2 y2 ... xn yn zoom ]]
Thoughts?
Well, polylines would definitely be nice for outlining sections of a larger pattern. Was thinking yesterday about possibilities with closed polygons with a fill color. But then it might be good if they had the option of being drawn behind the cell layer, instead of in front with an alpha below 1, the way labels and arrows are now.

-- But then it might be fun to have that "background" option for labels and arrows as well, so that gliders could run right over the top of a label. I don't know why this would be useful, really, but I like the idea of being able to put stuff on a background layer... either above or below the gridlines, I guess, but definitely in front of the stars.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:Well, polylines would definitely be nice for outlining sections of a larger pattern. Was thinking yesterday about possibilities with closed polygons with a fill color.
Outline and filled polygons are simple so I'll add those.
dvgrn wrote:But then it might be good if they had the option of being drawn behind the cell layer
This is much harder based on how LifeViewer renders today. The cells are drawn first. The stars are drawn over them but only over background colour pixels. The gridlines are then rendered on top.
Rendering poly{line|gon}s the same way that stars are drawn would be prohibitively slow I feel. I'll give it some thought...
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 307 is now available on the lazyslug server

Enhancements in this build:
  • Rules
    • added more flexibility to rule decoder for B/S style rules
    • added support for #P|#R x,y in RLE to set pattern top left position
    • added support for h = nnn, v = nnn in rule header
      • if the position is outside the maximum grid then it will be moved inside
  • new annotation polygons - test:
    • new script command [[ POLYLINE X1 Y1 X2 Y2 .. ZOOM ]]
      • draw polyline from supplied coordinates at zoom ZOOM
    • new script command [[ POLYFILL X1 Y1 X2 Y2 .. ZOOM ]]
      • draw filled polygon from supplied coordinates at zoom ZOOM
    • new script command [[ POLYALPHA <0.0..1.0> ]]
      • set alpha value for subsequent polygon definitions
    • new script command [[ POLYSIZE <1..> ]]
      • set line width for subsequent polygon definitions
    • new script command [[ POLYT <t1> <t2> <fade> ]]
      • sets a range of generations from <t1> to <t2> for subsequent polygons to be visible
      • <fade> specifies generations to fade polygon in/out
      • use [[ POLYT ALL ]] to specify all generations
    • new script command [[ POLYANGLE <0..359> (FIXED) ]]
      • sets the angle for subsequent polygon definitions
      • optional keyword FIXED means polygon will not rotate when camera rotates
    • new script command [[ COLOR POLY R G B|<name>]]
      • set colour for subsequent polygon definitions
    • new script command [[ POLYTARGET X Y D|OFF ]]
      • sets the target point and distance for subsequent polygon definitions
      • the viewpoint must be within the distance of the target point for the polygon to be displayed
      • [[ POLYTARGET OFF ]] turns off the target for subsequent polygon definitions
    • new script command [[ POLYTRACK DX DY|FIXED ]]
      • sets movement vector for subsequent polygon definitions
      • [[ POLYTRACK FIXED ]] turns off movement for subsequent polygon definitions
This build is a Release Candidate.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

I'm thinking the POLYTRACK / ARROWTRACK / LABELTRACK commands should take "OFF" to turn off tracking rather than "FIXED". OK?
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Using the new power granted to me by Nathaniel I released 307!

I think I'll go and sit down for a while...
User avatar
dvgrn
Moderator
Posts: 12053
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Using the new power granted to me by Nathaniel I released 307!

I think I'll go and sit down for a while...
Hey, look at that -- Build 307! Time for me to dust off some of my aperiodic-tile-generating code and build some LifeViewer animations with piles of polygons that fade in and out at different zoom levels... completely unrelated to Conway's Life, but lots of fun anyway.

Meanwhile, I've been spending some lunch-hour time sorting out what needs to be done to replace Paul Callahan's Java applet with LifeViewer, in his Illustrated Life Pattern Catalog. I tried this for acorn.html:

Code: Select all

<html>
	<head>
		<meta charset="UTF-8">
		<meta name="LifeViewer" content="viewer textarea 60 hide">
		<script src="lv-plugin.js"></script>
		<title>acorn.lif</title>
	</head>
	<body>
		<div class="viewer">
			<a href="" onclick="updateViewer(this); return false;">View Standalone</a><br>
			<textarea rows=4 cols=75>
			#Life 1.05
			#D Acorn
			#D The most vigorously growing 7-cell
			#D "methuselah" pattern.  See also RABBITS.
			#N
			#P -3 -1
			.*
			...*
			**..***
			#C [[ ZOOM 5 THUMBNAIL THUMBSIZE 3 ]]
			</textarea>
			<br>
			<canvas width="1024" height="640"></canvas>
		</div>
<applet code="LifeApp" width=500 height=300>
<param name=pattern value=acorn>
</applet>
<H1>Comments for <A HREF="acorn.lif">acorn.lif</A></H1>
<PRE>
Acorn
The most vigorously growing 7-cell
"methuselah" pattern.  See also RABBITS.
</PRE>
Xref:
<A HREF="rabbits.html">rabbits</A>
<BR>
<HR><A HREF="contents.html">Table of Contents</A>
</body>
... and when I tried Ctrl+Alt+C after running the pattern a while and changing the theme, just to see if I'd get the new theme information back, here's what showed up:

Code: Select all

#C Acorn
#C The most vigorously growing 7-cell
#C "methuselah" pattern.  See also RABBITS.
#C [[ ZOOM 5 THUMBNAIL THUMBSIZE 3 ]]x = 34, y = 19, rule = B3/S23
27b2o$27b2o6$7bob2o$5bobob2ob2o17b2o$4bo7b2o16bo2bo$4bo2b2ob2o17bo3bo
$bo7b2o9bo8bob2o$o6b2o11bo7bo3bo$o2bobobo21bob2o$2ob2obo26bo$b2o30bo$
2bo11bo12bob2ob2o$14bo5bo6bob3o$14bo5bo8bo!
Pretty good comment conversion there! But it looks like there's a newline missing at the end.

Code: Select all

#C test RLE pattern with test comment
x = 3, y = 3, rule = B3/S23
bo$2bo$3o!

Code: Select all

#Life 1.05
#D test Life 1.05 pattern #1 with test comment
#P 0 0
.*
..*
***

Code: Select all

#Life 1.05
#D test Life 1.05 pattern #2 with test comment
#C [[ ZOOM 5 THUMBNAIL THUMBSIZE 3 ]]
#N
#P 0 0
.*
..*
***
The RLE and Life 1.05 test patterns all come back fine with their comments, no newline problems. Seems like it's only getting a chunk of text from a <textarea> that causes trouble? I tried adding a <BR /> at the end of the comments in acorn.html, but it didn't seem to make any difference. Did I do anything else obviously wrong, or where is the lack-of-newline creeping in?

EDIT: Ah, found it. Comments after the pattern, amazingly, seem to get recognized as such even in Life 1.05 patterns.

Code: Select all

#Life 1.05
#D test Life 1.05 pattern #2 with test comment
#N
#P 0 0
.*
..*
***
#C [[ ZOOM 5 THUMBNAIL THUMBSIZE 3 ]]
produces

Code: Select all

#C test Life 1.05 pattern #2 with test comment
#C [[ ZOOM 5 THUMBNAIL THUMBSIZE 3 ]]x = 3, y = 3, rule = B3/S23
bo$2bo$3o!
whereas

Code: Select all

#C test RLE pattern with test comment
x = 3, y = 3, rule = B3/S23
bo$2bo$3o!
#C [[ ZOOM 5 THUMBNAIL THUMBSIZE 3 ]]
produces

Code: Select all

#C test RLE pattern with test comment
#C [[ ZOOM 5 THUMBNAIL THUMBSIZE 3 ]]
x = 3, y = 3, rule = B3/S23
bo$2bo$3o!
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:... and when I tried Ctrl+Alt+C after running the pattern a while and changing the theme
You won't get the new THEME since Ctrl+Alt+C just returns the original pattern comments (but in RLE format).

You could use hotkey Shift-K which will copy the current view settings to the Clipboard including the THEME.
dvgrn wrote:... it looks like there's a newline missing at the end.
Fixed in Build 308.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 308 is now available on the lazyslug server

Fixes in this build:
  • ensure copied RLE comments end with newline
  • comments found after RLE now get copied after RLE
This build is a Release Candidate.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 309 is now available on the lazyslug server

Enhancements in this build:
  • in hex display mode cells are now drawn as hexagons at zoom >= 4 - test
    • currently the gridlines are still alternating lines of squares offset by half a cell and display behind the cells
    • performance needs some improvement
Fixes in this build:
  • annotation positions were not correct in hex display mode
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 310 is now available on the lazyslug server

Enhancements in this build:
  • made hexagons more regular shaped
  • hotkey Alt+"/" to toggle hexagonal/square cells for hex display
  • new script command [[ SQUARECELLS ]] to set square cells for hex display
  • new script command [[ HEXCELLS ]] to set hexagonal cells for hex display (the default)
  • new bottom right menu button Hexagon to toggle hexagonal/square cells
User avatar
Andrew
Moderator
Posts: 1073
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Life tag testing

Post by Andrew »

rowett wrote:made hexagons more regular shaped
Not all that critical but might be nicer if the hexagons were drawn with flat tops to match the hexagons drawn by hexgrid.lua.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife, HatLife, SpectreLife
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Andrew wrote:
rowett wrote:made hexagons more regular shaped
Not all that critical but might be nicer if the hexagons were drawn with flat tops to match the hexagons drawn by hexgrid.lua.
I remember discussing changing the hexagons in hexgrid.lua to have a pointy top :)

Unfortunately in LifeViewer they need to be pointy since the offset square lattice they sit on is aligned that way.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 311 is now available on the lazyslug server

Enhancements in this build:
  • added hexagonal grid lines
  • drawing hexagonal cells is a bit faster
  • hex or von Neumann rule letter can be before Generations postfix e.g.: B23/S1H/G3
This build is a Release Candidate.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 312 is now available on the lazyslug server

Enhancements in this build:
  • improved hexagon cell drawing speed
  • grid icon now has hexagonal grid when hexagons selected
Fixes in this build:
  • ensure hexagonal grid lines are integer thickness (for speed)
  • fixed an issue with pattern comments on invalid patterns causing a crash
  • fixed an issue with pattern specified width and height not being ignored
This build is a Release Candidate.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 313 is now available on the lazyslug server

Enhancements in this build:
  • added Paul Callahan's isotropic non-totalistic hex rule format - test
  • created annotations topic in help
Fixes in this build:
  • only allocate hex buffers on first use
This build is a Release Candidate.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 314 is now available on the lazyslug server

Enhancements in this build:
  • addded isotropic non-totalistic hexagonal aliases
Fixes in this build:
  • fixed hexagonal grid colours
This build is a Release Candidate.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 315 is now available on the lazyslug server

Enhancements in this build:
  • improved hexagonal grid lines drawing speed
Fixes in this build:
  • could not edit patterns which had cylindrical bounded grids
  • hex patterns would not display cylindrical bounded grid borders when using hexagons
This build is a Release Candidate.
User avatar
dvgrn
Moderator
Posts: 12053
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Build 315 is now available...
Found a bug that I seem to remember showed up a while ago and got fixed: run this pattern at let's say step 50 to T=1200, then switch back to step 1 and hit B to back up to 1192. The last sparks turn on and off incorrectly until T=1190. Seems to happen fairly consistently with various ways of getting to T=1200.

Code: Select all

x = 52, y = 16, rule = B3/S23
obobo2b5ob3o21b4obo4bo3bo$2b3o2b2obob2obo24b3obobo4bo$obobo2b2o2bob2o
21b2o2b6o2b2o$o9bob2obo26b2ob2o2bobo$4o4b2o3bobo20bo2bo2b7o$2bob5o5bo
21b8o2bobo$2b2o3bo3bo3bo24bob2o3b3o$2bob2obobo3b2o21b4ob2o3b4obo$ob4ob
o2b2o2bo22b2o2bo3bobo2bo$3o6bobo24bob3ob2ob6o$5b2ob2o2b2o23b3ob2obo3b
2o$obobob2ob2o3b2o22b2obo2bobob2o$6bo2b3ob2o22bobo2bob2obob3o$3bo2b3ob
3ob2o20b3ob5o2bo2b2o$obob4obo2b2obo20bob7ob2ob2o$b4o2bob4ob2o27b3obob
3o!
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 316 is now available on the lazyslug server

Fixes in this build:
  • fixed single phase Copy on Firefox
  • fixed step back after pattern dies
This build is a Release Candidate.
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 317 is now available on the lazyslug server

Enhancements in this build:
  • experimental support for triangular neighbourhood - test
    • rules with a postfix "T" have 12-cell triangular neighbourhood
    • neighbourhood digits are "0123456789ABC" where A, B and C represent 10, 11 and 12 respectively
    • generations rules are supported
    • known issues:
      • B0 support is not correct
      • Copy RLE needs to correctly offset for odd/even cells
      • zooms < 4 have a different y scaling
Fixes in this build:
  • step back was not working correctly every 50 generations
User avatar
rowett
Moderator
Posts: 4597
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

The triangular neighbourhood has twelve neighbours. I need a single character way of representing the neighbour counts without using "B" since it will confuse the parser: so 0123456789ABC won't do. Any bright ideas?
Locked