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
rowett
Moderator
Posts: 3814
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Pattern viewer for forum threads

Post by rowett » June 29th, 2015, 2:21 am

c0b0p0 wrote:LifeViewer is doing something very strange when running hexagonal rules:
Thanks for reporting the problem. LifeViewer doesn't support hexagonal rules so it's interpreted that as B245/S35 (no H). I'll have it disable execution in a future build.

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

Re: Pattern viewer for forum threads

Post by gmc_nxtman » June 30th, 2015, 7:06 pm

Another suggestion: How about associating hotkey "Z" with possible future "step back one generation"?

I also think you should implement ability to read pattern comments, associate lines #O #N etc. with discoverer, name, and associate hotkey "I" with this feature if implemented.

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

Re: Pattern viewer for forum threads

Post by rowett » June 30th, 2015, 11:37 pm

gmc_nxtman wrote:Another suggestion: How about associating hotkey "Z" with possible future "step back one generation"?
This is already implemented and will be in the next released build. Hotkey 'Z' was already taken (it stops any other Viewers running). Hotkey 'B' (for back) is assigned.
gmc_nxtman wrote:I also think you should implement ability to read pattern comments, associate lines #O #N etc. with discoverer, name, and associate hotkey "I" with this feature if implemented.
Nice idea. I'll put it on the backlog.

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

Re: Pattern viewer for forum threads

Post by dvgrn » September 16th, 2015, 6:29 pm

An intermediate version of the pattern viewer is now live on the forum threads -- Build 157. It includes a new 'b' hotkey which allows patterns to be stepped backward up to several dozen ticks after they've been run for a while.

There's a minor bug that seems to affect only special-case pattern handling, so that patterns posted in the LifeHistory rule are viewable but can't be run. This is a known issue, hopefully very temporary, and it should only affect the threads where people are posting a lot of LifeHistory patterns.

If anyone sees new issues not related to LifeHistory, please report them.

M. I. Wright
Posts: 372
Joined: June 13th, 2015, 12:04 pm

Re: Pattern viewer for forum threads

Post by M. I. Wright » September 16th, 2015, 10:02 pm

The close button doesn't seem to be a button on Chrome 45/windows 7 (hovering over it doesn't change the mouse cursor, and clicking does nothing).

Also: This bug has been around for a while:

Code: Select all

x = 3, y = 3, rule=B3/S23
b2o$obo$2bo!
And I think the LIFEVIEWER text looks a bit odd - it's off-center, and the font looks... I don't know. Bland?

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

Re: Pattern viewer for forum threads

Post by dvgrn » September 16th, 2015, 10:54 pm

M. I. Wright wrote:The close button doesn't seem to be a button on Chrome 45/windows 7 (hovering over it doesn't change the mouse cursor, and clicking does nothing).
By the "close button" you mean the red X in the upper right, correct? I'm running Chrome 45.0.2454.93 on a Windows 7 laptop (Win7Pro SP1) with 1366x768 screen resolution. The cursor switches appropriately from an arrow to a pointing finger when I point to the red X, and the viewer closes with no problem.

In previous builds the top edge of the viewer has sometimes been out of sight and therefore inaccessible, but I haven't seen it be non-functional. What else might be different between our systems besides the Chrome and Windows versions?
M. I. Wright wrote:Also: This bug has been around for a while: [birth and survival rules reversed when no spaces around equal sign in 'rule =' clause]
Nice catch! Never saw that before -- it appears I don't type my own RLE header lines very much these days.

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

Re: Pattern viewer for forum threads

Post by rowett » September 17th, 2015, 3:22 am

M. I. Wright wrote:The close button doesn't seem to be a button on Chrome 45/windows 7 (hovering over it doesn't change the mouse cursor, and clicking does nothing).
I'm having trouble reproducing this.
The button is not a button it's an HTML anchor that looks like a button. Did this work before for you on previous builds? Does it work for you on other browers?
M. I. Wright wrote:Also: This bug has been around for a while:

Code: Select all

x = 3, y = 3, rule=B3/S23
b2o$obo$2bo!
Thanks for reporting, this has been fixed and will be in the next released build.
M. I. Wright wrote:And I think the LIFEVIEWER text looks a bit odd - it's off-center, and the font looks... I don't know. Bland?
The off-center has been fixed and will be in the next released build. I've also modified the text from "LIFEVIEWER" to "LifeViewer". To me it looks a bit better but let me know when the new build is published if you prefer it.

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

Re: Pattern viewer for forum threads

Post by rowett » September 17th, 2015, 3:57 pm

Build 158 is now live on conwaylife.com

Enhancements since the last released build:
  • added the ability to step back up to 512 generations (hotkey "b")
    • the step back function uses the STEP size
    • added keyword [[ NOSTEPBACK ]] to disable step back function
    • added step back details to the help information
  • added keyword [[ STARS ]] to switch on starfield background
    • hotkey "s" to toggle starfield
    • added [[ COLOR STARS R G B ]] to set stars colour (default is white)
    • toggle thumbnail mode is now hotkey "n"
  • added hotkey "0" to reset angle to 0
  • you can now specify THEME CUSTOM to use the custom theme definition at a waypoint
  • added hotkey "5" for 0.5x ZOOM
  • added keyword [[ TITLE "<string>" ]] that allows you to specify the window title for the standalone viewer (up to 30 characters)
  • enhanced the pattern decoders to support simple ASCII "." and "*" with no header
  • arrow keys now use the zoom level to determine how far to pan the pattern
    • shift key with the arrow keys now pans diagonally
  • improved key handling for non-hotkeys
  • notification system now discards duplicate notifications
  • performance improvements for grid allocation and copying
Fixes since the last released build:
  • the standalone viewer title was not centered correctly
  • rules were incorrectly decoding if there was not a space between the equals sign and the rule definition
  • LifeHistory patterns were not executing
  • disabled THUMBNAIL, WIDTH and HEIGHT commands for the standalone viewer
  • default fit zoom display was not being updated after grid grows
  • patterns in extended RLE format but with valid rule definition and two states were being treated as multi-state
  • waypoint ZOOM was not working correctly in THUMBNAIL mode
  • LOOP in waypoint mode was showing a single non-waypoint controlled frame
  • mousewheel ZOOM was broken
  • the Theme UI was not extended to include the custom theme when one was defined
  • remove forum search decoration from patterns
  • patterns bigger than their defined width or height were failing to decode with an exception
  • some non-executable rules were mistakenly being allowed to execute
  • patterns with x and y defined but no rule defined were not defaulting to B3/S23
Here is a map of the hotkeys.

M. I. Wright
Posts: 372
Joined: June 13th, 2015, 12:04 pm

Re: Pattern viewer for forum threads

Post by M. I. Wright » September 17th, 2015, 6:25 pm

Thanks for the updates! (the LifeViewer text looks fine now, too.)
dvgrn wrote:By the "close button" you mean the red X in the upper right, correct? I'm running Chrome 45.0.2454.93 on a Windows 7 laptop (Win7Pro SP1) with 1366x768 screen resolution. The cursor switches appropriately from an arrow to a pointing finger when I point to the red X, and the viewer closes with no problem.
I'm having trouble reproducing this.
The button is not a button it's an HTML anchor that looks like a button. Did this work before for you on previous builds? Does it work for you on other browers?
Yes, yes and yes - in fact, it worked after I restarted Chrome, so it must've just been a fluke.
Nice catch! Never saw that before -- it appears I don't type my own RLE header lines very much these days.
I first noticed it a few months ago in this post, but it popped up occasionally in other threads.

User avatar
Gustavo6046
Posts: 647
Joined: December 7th, 2013, 6:26 pm
Location: Brazil.

Re: Pattern viewer for forum threads

Post by Gustavo6046 » September 17th, 2015, 7:06 pm

Would be nice if the pattern in the viewer could be edited by clicking like in Golly.
*yawn* What a nothing-to-do day! Let's be the only person in the world to do CGOL during boring times. :)

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

Re: Pattern viewer for forum threads

Post by rowett » September 18th, 2015, 7:00 pm

Gustavo6046 wrote:Would be nice if the pattern in the viewer could be edited by clicking like in Golly.
It's on the backlog but won't be soon.

User avatar
Gustavo6046
Posts: 647
Joined: December 7th, 2013, 6:26 pm
Location: Brazil.

Re: Pattern viewer for forum threads

Post by Gustavo6046 » September 18th, 2015, 8:30 pm

And exporting GIFs of oscillators and such?
*yawn* What a nothing-to-do day! Let's be the only person in the world to do CGOL during boring times. :)

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

Re: Pattern viewer for forum threads

Post by rowett » September 19th, 2015, 2:12 am

Gustavo6046 wrote:And exporting GIFs of oscillators and such?
Not planned.
LifeViewer does support taking a screenshot of the current generation and displaying it as an image in a separate browser window (via hotkey 'o'). You'll need to enable popups in the browser.

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

Re: Pattern viewer for forum threads

Post by gmc_nxtman » September 19th, 2015, 12:03 pm

Can it not run other Life-Like rules? Take a look through the other cellular automata subforum and see if you can run the Life-Like totalistic rules.

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

Re: Pattern viewer for forum threads

Post by rowett » September 19th, 2015, 12:30 pm

gmc_nxtman wrote:Can it not run other Life-Like rules? Take a look through the other cellular automata subforum and see if you can run the Life-Like totalistic rules.
LifeViewer can only run 2-state Moore neighbourhood Life-like rules. If it can't find a rule or the rule is "Life" it'll assume Conway's Life (B3/S23). Otherwise it looks for the B012345678/S012345678 style rule definition.
The only other exception is it has partial support for "LifeHistory" which it will collapse to the 2-state variant and run as Conway's Life.
For any other rule it will just display the initial state.

User avatar
Scorbie
Posts: 1692
Joined: December 7th, 2013, 1:05 am

Re: Pattern viewer for forum threads

Post by Scorbie » September 19th, 2015, 12:37 pm

When I run a pattern, reset, and press space, gen 1 becomes the gen when I clicked reset. And it starts running from that gen. On windows 10 IE 11 and android (touch instead of space)

Strange. Sometimes it happens and sometimes it doesn't.

Also, off-topic, but select all button doesn't work on microsoft edge. Wonder why...

Thanks in advance.

EDIT:
rowett wrote:
Gustavo6046 wrote:Would be nice if the pattern in the viewer could be edited by clicking like in Golly.
It's on the backlog but won't be soon.
Very excited about this, thanks a lot!
Last edited by Scorbie on September 19th, 2015, 1:11 pm, edited 1 time in total.

M. I. Wright
Posts: 372
Joined: June 13th, 2015, 12:04 pm

Re: Pattern viewer for forum threads

Post by M. I. Wright » September 19th, 2015, 12:39 pm

Scorbie wrote:When I run a pattern, reset, and press space, gen 1 becomes the gen when I clicked reset. And it starts running from that gen. On windows 10 IE 11 and android (touch instead of space)

Thanks in advance.
I've seen this too, but I can't find a specific sequence of button presses that triggers it without fail... sometimes it happens when you press reset while the pattern is running, other times you have to press space/pause and then reset, and sometimes it doesn't happen at all.

User avatar
simsim314
Posts: 1823
Joined: February 10th, 2014, 1:27 pm

Re: Pattern viewer for forum threads

Post by simsim314 » September 19th, 2015, 12:44 pm

Hey many thanks for the go back option - I would suggest to add it to the buttons controls (if this is not too complex).

I don't see how LifeHistory was improved - I think it was evolving for a while now. The thing that dvgrn talked about is showing LifeHistory coloring at gen = 0, and then on run collapse and evolve as usual Life (I still don't see this feature).

I really recommend to add LifeHistory not as additional rule, but as advanced coloring option (ignoring state 6), this is in my opinion the current biggest limitation of the Viewer - which is really great addition to the site in general.

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

Re: Pattern viewer for forum threads

Post by rowett » September 19th, 2015, 6:36 pm

Scorbie wrote:Also, off-topic, but select all button doesn't work on microsoft edge. Wonder why...
This is because of a bug in one of the php forum javascript files (forum_fn.js). I've attached an updated version of that file with a fix. Nathaniel will need to incorporate.

Code: Select all

/**
* phpBB3 forum functions
*/

/**
* Window popup
*/
function popup(url, width, height, name)
{
	if (!name)
	{
		name = '_popup';
	}

	window.open(url.replace(/&/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes, width=' + width);
	return false;
}

/**
* Jump to page
*/
function jumpto()
{
	var page = prompt(jump_page, on_page);

	if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
	{
		if (base_url.indexOf('?') == -1)
		{
			document.location.href = base_url + '?start=' + ((page - 1) * per_page);
		}
		else
		{
			document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
		}
	}
}

/**
* Mark/unmark checklist
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state)
{
	var parent = document.getElementById(id);
	if (!parent)
	{
		eval('parent = document.' + id);
	}

	if (!parent)
	{
		return;
	}

	var rb = parent.getElementsByTagName('input');
	
	for (var r = 0; r < rb.length; r++)
	{	
		if (rb[r].name.substr(0, name.length) == name)
		{
			rb[r].checked = state;
		}
	}
}

/**
* Resize viewable area for attached image or topic review panel (possibly others to come)
* e = element
*/
function viewableArea(e, itself)
{
	if (!e) return;
	if (!itself)
	{
		e = e.parentNode;
	}
	
	if (!e.vaHeight)
	{
		// Store viewable area height before changing style to auto
		e.vaHeight = e.offsetHeight;
		e.vaMaxHeight = e.style.maxHeight;
		e.style.height = 'auto';
		e.style.maxHeight = 'none';
		e.style.overflow = 'visible';
	}
	else
	{
		// Restore viewable area height to the default
		e.style.height = e.vaHeight + 'px';
		e.style.overflow = 'auto';
		e.style.maxHeight = e.vaMaxHeight;
		e.vaHeight = false;
	}
}

/**
* Set display of page element
* s[-1,0,1] = hide,toggle display,show
*/
function dE(n, s)
{
	var e = document.getElementById(n);

	if (!s)
	{
		s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1;
	}
	e.style.display = (s == 1) ? 'block' : 'none';
}

/**
* Alternate display of subPanels
*/
function subPanels(p)
{
	var i, e, t;

	if (typeof(p) == 'string')
	{
		show_panel = p;
	}

	for (i = 0; i < panels.length; i++)
	{
		e = document.getElementById(panels[i]);
		t = document.getElementById(panels[i] + '-tab');

		if (e)
		{
			if (panels[i] == show_panel)
			{
				e.style.display = 'block';
				if (t)
				{
					t.className = 'activetab';
				}
			}
			else
			{
				e.style.display = 'none';
				if (t)
				{
					t.className = '';
				}
			}
		}
	}
}

/**
* Call print preview
*/
function printPage()
{
	if (is_ie)
	{
		printPreview();
	}
	else
	{
		window.print();
	}
}

/**
* Show/hide groups of blocks
* c = CSS style name
* e = checkbox element
* t = toggle dispay state (used to show 'grip-show' image in the profile block when hiding the profiles) 
*/
function displayBlocks(c, e, t)
{
	var s = (e.checked == true) ?  1 : -1;

	if (t)
	{
		s *= -1;
	}

	var divs = document.getElementsByTagName("DIV");

	for (var d = 0; d < divs.length; d++)
	{
		if (divs[d].className.indexOf(c) == 0)
		{
			divs[d].style.display = (s == 1) ? 'none' : 'block';
		}
	}
}

function selectCode(a)
{
	// Get ID of code block
	var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];

	// Not IE
	if (window.getSelection)
	{
		var s = window.getSelection();
		// Safari
		if (s.setBaseAndExtent)
		{
			var l = (e.innerText.length > 1) ? e.innerText.length - 1 : 1;
			try {
				s.setBaseAndExtent(e, 0, e, l);
			}
			catch (error) {
				var r = document.createRange();
				r.selectNodeContents(e);
				s.removeAllRanges();
				s.addRange(r);
			}
		}
		// Firefox and Opera
		else
		{
			// workaround for bug # 42885
			if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
			{
				e.innerHTML = e.innerHTML + '&nbsp;';
			}

			var r = document.createRange();
			r.selectNodeContents(e);
			s.removeAllRanges();
			s.addRange(r);
		}
	}
	// Some older browsers
	else if (document.getSelection)
	{
		var s = document.getSelection();
		var r = document.createRange();
		r.selectNodeContents(e);
		s.removeAllRanges();
		s.addRange(r);
	}
	// IE
	else if (document.selection)
	{
		var r = document.body.createTextRange();
		r.moveToElementText(e);
		r.select();
	}
}

/**
* Play quicktime file by determining it's width/height
* from the displayed rectangle area
*/
function play_qt_file(obj)
{
	var rectangle = obj.GetRectangle();

	if (rectangle)
	{
		rectangle = rectangle.split(',');
		var x1 = parseInt(rectangle[0]);
		var x2 = parseInt(rectangle[2]);
		var y1 = parseInt(rectangle[1]);
		var y2 = parseInt(rectangle[3]);

		var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
		var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
	}
	else
	{
		var width = 200;
		var height = 0;
	}

	obj.width = width;
	obj.height = height + 16;

	obj.SetControllerVisible(true);
	obj.Play();
}

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

Re: Pattern viewer for forum threads

Post by rowett » September 19th, 2015, 6:39 pm

M. I. Wright wrote:
Scorbie wrote:When I run a pattern, reset, and press space, gen 1 becomes the gen when I clicked reset. And it starts running from that gen. On windows 10 IE 11 and android (touch instead of space)

Thanks in advance.
I've seen this too, but I can't find a specific sequence of button presses that triggers it without fail... sometimes it happens when you press reset while the pattern is running, other times you have to press space/pause and then reset, and sometimes it doesn't happen at all.
Please can you confirm in which build of LifeViewer you're seeing this? Press "i" and then scroll down and it will tell you the build number. Thanks.

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

Re: Pattern viewer for forum threads

Post by rowett » September 19th, 2015, 6:44 pm

simsim314 wrote:Hey many thanks for the go back option - I would suggest to add it to the buttons controls (if this is not too complex).
I've been debating what to do with more buttons. LifeViewer has tons of functions and I've been trying to keep the display as uncluttered as possible. If you think this is an important feature to surface on the UI I'll see if I can squeeze it in.
simsim314 wrote:I don't see how LifeHistory was improved - I think it was evolving for a while now. The thing that dvgrn talked about is showing LifeHistory coloring at gen = 0, and then on run collapse and evolve as usual Life (I still don't see this feature).
I haven't changed the LifeHistory support in LifeViewer.
simsim314 wrote:I really recommend to add LifeHistory not as additional rule, but as advanced coloring option (ignoring state 6), this is in my opinion the current biggest limitation of the Viewer - which is really great addition to the site in general.
Yes I'm considering both this and dvgrn's request. Please will you give me more details as to what to draw (and in what order).

M. I. Wright
Posts: 372
Joined: June 13th, 2015, 12:04 pm

Re: Pattern viewer for forum threads

Post by M. I. Wright » September 19th, 2015, 8:01 pm

rowett wrote:
M. I. Wright wrote:
Scorbie wrote:When I run a pattern, reset, and press space, gen 1 becomes the gen when I clicked reset. And it starts running from that gen. On windows 10 IE 11 and android (touch instead of space)

Thanks in advance.
I've seen this too, but I can't find a specific sequence of button presses that triggers it without fail... sometimes it happens when you press reset while the pattern is running, other times you have to press space/pause and then reset, and sometimes it doesn't happen at all.
Please can you confirm in which build of LifeViewer you're seeing this? Press "i" and then scroll down and it will tell you the build number. Thanks.
158, the most recent build.

I think this is what gmc_nxtman was referring to by 'other Life-Like totalistic rules':

Code: Select all

x = 13, y = 5, rule = B1/S
3ob2ob2ob3o$bo2bo2bo3bo$bo2b2ob2o2bo$bo2bo3bo2bo$bo2b2ob2o2bo!

Code: Select all

x = 13, y = 5, rule = B/S1
3ob2ob2ob3o$bo2bo2bo3bo$bo2b2ob2o2bo$bo2bo3bo2bo$bo2b2ob2o2bo!

Code: Select all

x = 13, y = 5, rule = /1
3ob2ob2ob3o$bo2bo2bo3bo$bo2b2ob2o2bo$bo2bo3bo2bo$bo2b2ob2o2bo!

Code: Select all

x = 13, y = 5, rule = 1/
3ob2ob2ob3o$bo2bo2bo3bo$bo2b2ob2o2bo$bo2bo3bo2bo$bo2b2ob2o2bo!
Looks like it doesn't recognize rules where one of the sections is empty.

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

Re: Pattern viewer for forum threads

Post by rowett » September 20th, 2015, 3:36 am

M. I. Wright wrote:I think this is what gmc_nxtman was referring to by 'other Life-Like totalistic rules':

Code: Select all

x = 13, y = 5, rule = B1/S
3ob2ob2ob3o$bo2bo2bo3bo$bo2b2ob2o2bo$bo2bo3bo2bo$bo2b2ob2o2bo!

Code: Select all

x = 13, y = 5, rule = B/S1
3ob2ob2ob3o$bo2bo2bo3bo$bo2b2ob2o2bo$bo2bo3bo2bo$bo2b2ob2o2bo!

Code: Select all

x = 13, y = 5, rule = /1
3ob2ob2ob3o$bo2bo2bo3bo$bo2b2ob2o2bo$bo2bo3bo2bo$bo2b2ob2o2bo!

Code: Select all

x = 13, y = 5, rule = 1/
3ob2ob2ob3o$bo2bo2bo3bo$bo2b2ob2o2bo$bo2bo3bo2bo$bo2b2ob2o2bo!
Looks like it doesn't recognize rules where one of the sections is empty.
Ah sorry I didn't understand! Yes, gmc_nxtman is correct it's a bug. Fixed in the next build.

User avatar
simsim314
Posts: 1823
Joined: February 10th, 2014, 1:27 pm

Re: Pattern viewer for forum threads

Post by simsim314 » September 20th, 2015, 5:43 am

rowett wrote:If you think this is an important feature to surface on the UI I'll see if I can squeeze it in.
I think that move back is as natural as move forward. I would also suggest to ask other forum members - in my opinion the button controls is very natural place for the play-back (if it's too complex I wouldn't bother - but if it's simple enough, and the only question is GUI aesthetics - I personally think it's very intuitive place, and frequent/important enough).
rowett wrote:Please will you give me more details as to what to draw
Generally LifeHistory has two more states other than what is the viewer. In the viewer we have
0 - empty (black).
1 - active (green).
2 - something was there a while ago (blue).

State 2 in the viewer is even cooler as it has coloring for history as well (how long ago something was in that cell).

LifeHistory adds only 2 more states (for 99% of the relevant usage):

state 4 - special states cells (red). Those states are red instead of black when they empty.
state 3 - special state cells activated (white). If special state is active - it's not green but white.

-----

To implement LifeHistory you need to let the viewer make another "walk through" and color special case cells. In Gen 1 special cells are defined (red or white). Then you iterate as usual, and after that "paint over" the special states with relevant colors.

The only thing it requires from you is to keep an array of special states cells (initialized at gen 0), and "paint over" with relevant colors (red and white instead of black and green in those cells).

-----

For general knowledge LifeHistory has state 5 - which can be treated as state 3 (it's just coloring on top of coloring that doesn't usually means anything). And state 6 that means - active that never change. I think it's also simple to implement, but not so frequent or critical.
Last edited by simsim314 on September 20th, 2015, 8:03 am, edited 1 time in total.

User avatar
Scorbie
Posts: 1692
Joined: December 7th, 2013, 1:05 am

Re: Pattern viewer for forum threads

Post by Scorbie » September 20th, 2015, 6:29 am

rowett wrote: If you think this is an important feature to surface on the UI I'll see if I can squeeze it in.
Personally I'm not sure. Currently in Golly there isn't a "go back" button but I don't have problems with "undo"ing with the Z hotkey. If you are planning to add editing functionalities, then I think a "undo" hotkey would suffice. One problem is that Z in LifeViewer is reserved in showing grid lines... (Guess how I got to know that!) So maybe there might be some time to get used to the "undo" hotkey (and other different hotkeys) in LifeViewer... So maybe one would like to add a UI button for it... (or maybe change the Z hotkey to something else)
simsim314 wrote:state 3 - special states cells (red). Those states are red instead of black when they empty. state 4 - special state cells activated (white). If special state is active - it's not green but white.
Simsim got state 3 and state 4 the other way around. 3 is the live special cell and 4 is the dead special cell. Likewise, state 5 is identical to state 3, it's just for highlighting things at gen 0, but I don't think anyone would mind if you parse it as state 3. And to elaborate, a state 6 cell kills all adjacent on cells. You can play with LifeHistory rule in Golly if you get something unsure.


EDIT: I think once starfield is on, opening other patterns (without starfield) won't take it off. (Still, I like that starry background so it seems more like a feature to me :))

Post Reply