Golly suggestions

For general discussion about Conway's Game of Life.
User avatar
GUYTU6J
Posts: 1937
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Golly suggestions

Post by GUYTU6J » August 17th, 2022, 11:54 pm

Andrew wrote:
August 17th, 2022, 11:34 pm
GUYTU6J wrote:
August 15th, 2022, 9:20 am
This commit says it "updated patterns used by web version of Golly", but the collection on http://golly.sourceforge.net/webapp/golly.html hasn't been expanded.
I've just uploaded a new version of webGolly that contains all your suggested pattern changes. You'll probably need to force the page to be reloaded, which might take a while, so be patient. Eventually you should see this message in the status bar:

This is Golly 4.2 for the web (copyright 2005-2022 The Golly Gang).
Update confirmed. Thank you! But zooming in or out the canvas with mouse wheel (laptop) or two fingers (mobile) seems to be not supported.
Why do most 2-state OCA rules tend to get a diminishing span of interest and go into oblivion, like lost civilizations leaving little records for their beauty and power?

Here multiflorate splendour blooms forlorn
Midst broken fountains, mouldering walls.

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

Re: Golly suggestions

Post by Andrew » August 18th, 2022, 5:48 am

GUYTU6J wrote:
August 17th, 2022, 11:54 pm
Update confirmed. Thank you! But zooming in or out the canvas with mouse wheel (laptop) or two fingers (mobile) seems to be not supported.
I've uploaded a new build that should fix this (works on Safari and Chrome on my Mac).

User avatar
GUYTU6J
Posts: 1937
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Golly suggestions

Post by GUYTU6J » August 20th, 2022, 11:49 pm

In a modified but not saved layer marked with *, open Life/Signal-Circuitry/h-to-h-collection-26Aug2017.zip, then click "cancel" in the "save changes" dialog. The package contains a pattern RLE and a lua script for poping up a window; despite the former not being loaded on the layer, the latter will still pop up.

I am not sure if it is caused by Golly or by the h-to-h-collection-21Aug2017.lua script within the package. The script boils down to

Code: Select all

local g = golly()

htmlname = g.getdir("temp").."h-to-h-collection-21Aug2017.html"
f = io.open(htmlname, "w")
if f then
    f:write(
[[
<html>
...
</html>
]]
    )
    f:close()
end
g.open(htmlname)
Why do most 2-state OCA rules tend to get a diminishing span of interest and go into oblivion, like lost civilizations leaving little records for their beauty and power?

Here multiflorate splendour blooms forlorn
Midst broken fountains, mouldering walls.

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

Re: Golly suggestions

Post by Andrew » August 21st, 2022, 12:39 am

GUYTU6J wrote:
August 20th, 2022, 11:49 pm
In a modified but not saved layer marked with *, open Life/Signal-Circuitry/h-to-h-collection-26Aug2017.zip, then click "cancel" in the "save changes" dialog. The package contains a pattern RLE and a lua script for poping up a window; despite the former not being loaded on the layer, the latter will still pop up.
I don't think it's worth changing Golly's code to detect this (uncommon) situation. It would be quite easy to modify the script to do nothing if the file wasn't loaded. Something like this (untested!):

Code: Select all

if not g.getpath():find("h-to-h-collection-26Aug2017.rle",1,true) then g.exit() end

User avatar
Macbi
Posts: 880
Joined: March 29th, 2009, 4:58 am

Re: Golly suggestions

Post by Macbi » September 4th, 2022, 12:58 pm

On Linux, could we stop using the user's home directory for ~/.golly? The new consensus for dotfile locations seems to be the freedesktop.org standard. So the 'proper' place for GollyPrefs would be $XDG_CONFIG_HOME (which by default is ~/.config), while the user's Rules and Downloads would go in $XDG_DATA_HOME/golly (which by default is ~/.local/share/golly).

confocaloid
Posts: 291
Joined: February 8th, 2022, 3:15 pm

Re: Golly suggestions

Post by confocaloid » September 4th, 2022, 8:03 pm

A request for two related features. This is also related to files/directories. I may attempt to clarify any missing details later if needed, assuming this feature request will not happen outright unreasonable.
  • (Feature 1) For an arbitrary rule supported by RuleLoader, allow the user to store the rule definition in the same file as the pattern that uses the rule (rather than putting the rule definition in a separate file). More specifically, I think one way would be the same way as LifeViewer does it (i.e. by appending the rule definition to the end of the RLE).
  • (Feature 2) Provide a programmatic way to construct and use in a pattern an arbitrary RuleLoader-supported rule from a Golly script, without storing the rule in a file. (Note: this feature request is about programmatically building/generating a completely new rule from scratch, as opposed to modifying/mutating an already existing rule.)
Interactions between features (assuming both implemented):
  • When (2) is used to construct a rule dynamically and switch to it, a subsequent "File -> Save pattern..." should follow (1) by writing the rule definition to the same file as the pattern (rather than asking the user to provide two different filenames for the pattern and the rule) .
Several use cases:
  • (a) A multistate rule may be specifically designed for a single use in a specific pattern, without having any particularly "interesting" features otherwise. Several examples can be found in this thread. Having to invent names for such one-time rules and store them in separate files seems an inconvenience.
  • (b) I would like to write a script to generate and test random rules, without storing each rule in a file. Probably the script will be invoked many times, possibly with some user input to configure it. Each time the script is invoked, a new random rule is generated and the current pattern is set to use the rule. If given a choice, I would certainly prefer to avoid cluttering my rule directory by lots of rule files with autogenerated filenames, most of which will never be used again.
In this use case, feature (2) is needed to be able to generate and use rules from a script without forcing the user to save each of them in a file, and feature (1) is needed to allow the user to save any found "potentially interesting" rules - along with example soups/patterns for those rules - without having to pause and think to invent meaningful names for those rules.
  • (c) Write a script that dynamically generates both the pattern and the rule to be used in this pattern. In this use case, the only thing stored in a file is the script itself - neither the pattern nor the rule is stored. Again, there may be user input to the script, potentially affecting both the pattern and the rule.
  • (d) Compatibility with LifeViewer. If feature (1) is implemented in the same way (from the user's viewpoint) as LifeViewer does it, it would be possible to copy-and-paste a RLE with an appended rule definition into a single file and open it by Golly.
Is there any hope of seeing something along these lines implemented in Golly? I think these features would become useful, if implemented. Are there any important missing details to be clarified in this feature request?

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

Re: Golly suggestions

Post by dvgrn » September 4th, 2022, 10:08 pm

confocaloid wrote:
September 4th, 2022, 8:03 pm
...
  • (d) Compatibility with LifeViewer. If feature (1) is implemented in the same way (from the user's viewpoint) as LifeViewer does it, it would be possible to copy-and-paste a RLE with an appended rule definition into a single file and open it by Golly.
Is there any hope of seeing something along these lines implemented in Golly? I think these features would become useful, if implemented. Are there any important missing details to be clarified in this feature request?
Feature (1) does seem to me to be worth considering, just to get Golly and LifeViewer supporting the same pattern+rule format.

Personally I'm not convinced that feature (2) is an interesting thing to build in to Golly. If you care about not cluttering up your Rules folder, then you can just name all your rules "TempRule_{identifer}", and write a script that finds and deletes all TempRule_* rules (and run that on startup, or whenever you want). And/or go to File > Preferences > Control, change the "Your Rules" folder to where you're temporarily generating rules -- and then delete the whole folder when you're done.

Then again, I'm not somebody that you really need to convince, since I'm not likely to be the one to implement either of these features in any case!

It seems to me that it would be a somewhat tricky change to Golly's architecture to require that it not save a rule-table file anywhere. Golly saves a lot of temporary files -- Undo buffers and so on -- and cleans them up when they're no longer needed. The Python and Lua scripting systems completely allow you to implement both Feature 1 and Feature 2 yourself, with no changes to Golly needed -- as long as you can let go of the idea that a rule should never be saved to disk at all, as opposed to being saved temporarily and then deleted later.

User avatar
GUYTU6J
Posts: 1937
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Golly suggestions

Post by GUYTU6J » September 22nd, 2022, 12:37 am

Algorithms except for QuickLife and Larger than Life support timelines, but no script command to operate on timelines exists. So I'd request for the relevant python and lua functions, particularly the ability to go to a specific generation (which may be forwards or backwards) within the record.
Why do most 2-state OCA rules tend to get a diminishing span of interest and go into oblivion, like lost civilizations leaving little records for their beauty and power?

Here multiflorate splendour blooms forlorn
Midst broken fountains, mouldering walls.

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

Re: Golly suggestions

Post by Andrew » September 22nd, 2022, 7:08 pm

GUYTU6J wrote:
September 22nd, 2022, 12:37 am
Algorithms except for QuickLife and Larger than Life support timelines, but no script command to operate on timelines exists. So I'd request for the relevant python and lua functions, particularly the ability to go to a specific generation (which may be forwards or backwards) within the record.
A better idea would be to write an overlay script called timeline.lua that emulates (and improves on) the current timeline code. It would work in all algorithms, could record at variable step sizes, have a "Go To ..." button, etc. A nice little project for anyone interested in learning how to write an overlay script.

Post Reply