Golly suggestions

For general discussion about Conway's Game of Life.
GUYTU6J
Posts: 2200
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.

User avatar
Andrew
Moderator
Posts: 919
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).
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

GUYTU6J
Posts: 2200
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)

User avatar
Andrew
Moderator
Posts: 919
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
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Macbi
Posts: 903
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).

User avatar
confocaloid
Posts: 2729
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?
127:1 B3/S234c User:Confocal/R (isotropic rules, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.

User avatar
dvgrn
Moderator
Posts: 10612
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.

GUYTU6J
Posts: 2200
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.

User avatar
Andrew
Moderator
Posts: 919
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.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

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

Re: Golly suggestions

Post by GUYTU6J » September 25th, 2022, 9:44 am

Andrew wrote:
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.
Maybe, but is there a convenient single command to go to a particular previous generation in lua overlay? I can see none in Golly Help.

For the record, the relevant part in goto.lua is

Code: Select all

    if newgen < currgen then
        -- try to go back to starting gen (not necessarily 0) and
        -- then forwards to newgen; note that reset() also restores
        -- algorithm and/or rule, so too bad if user changed those
        -- after the starting info was saved;
        -- first save current location and scale
        local midx, midy = g.getpos()
        local mag = g.getmag()
        g.reset()
        -- restore location and scale
        g.setpos(midx, midy)
        g.setmag(mag)
which is unsatisfactory. Assuming no edits after T=0 and same step size, going from T=10000 to T=9999 takes more time than going from T=10 to T=9 in this reset-then-play scheme, despite both essentially being one generation backwards.

Timelines do not (at least seem to me) have this issue. Once recorded, it is only a mouse click on the "<" button of the scroll bar to go to the previous step (not necesarrily 1 tick) in the timeline regardless of the T count. What I am requesting is a one-line script command that replaces one or more such clicks of my finger.

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

Re: Golly suggestions

Post by Andrew » September 27th, 2022, 12:21 am

GUYTU6J wrote:
September 25th, 2022, 9:44 am
Maybe, but is there a convenient single command to go to a particular previous generation in lua overlay?
No. I think it's worth pointing out that Golly is in a somewhat unusual state while a timeline exists. Note that you can't do any editing or change the algo/rule or run the pattern. You also can't run a script, so adding new script commands to control timeline functions would require a lot of messy changes. Certainly not something I'm ever likely to attempt.
Timelines do not (at least seem to me) have this issue. Once recorded, it is only a mouse click on the "<" button of the scroll bar to go to the previous step (not necesarrily 1 tick) in the timeline regardless of the T count. What I am requesting is a one-line script command that replaces one or more such clicks of my finger.
I'm a bit confused by this request. Given that it's easy to go to any step in the timeline, why do you want a script command to do it? Maybe provide more details about what sort of script you want to write.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

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

Re: Golly suggestions

Post by GUYTU6J » September 27th, 2022, 12:55 am

Andrew wrote:
September 27th, 2022, 12:21 am
...
I'm a bit confused by this request. Given that it's easy to go to any step in the timeline, why do you want a script command to do it? Maybe provide more details about what sort of script you want to write.
The script I am envisioning is a Seeds of Destruction emulator mentioned previously, intended to be used on any Golly-compatible rule. One of its features is the Gens button: hover mouse over it and "mousewheel to change number of generations", which evolves the pattern forwards or backwards. The closest effect in Golly happens upon clicking on the "<" or ">" buttons in a timeline. So to reproduce this, I need a single script command as stated (but not necessarily mapped to mouse wheel in actual program).

Without timelines, either the reset-then-play scheme or a save-all-intermediate-generations-to-files-for-arbitrary-inspection method would be inefficient, and I have no other idea for implementation of said feature.

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

Re: Golly suggestions

Post by Andrew » September 27th, 2022, 4:43 am

GUYTU6J wrote:
September 27th, 2022, 12:55 am
Without timelines, either the reset-then-play scheme or a save-all-intermediate-generations-to-files-for-arbitrary-inspection method would be inefficient, and I have no other idea for implementation of said feature.
I've never used Seeds of Destruction but it looks like it operates on fairly small patterns, so unless you want to manipulate patterns with millions of cells then I'm pretty sure either of those schemes would work just fine.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

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

Re: Golly suggestions

Post by Andrew » September 27th, 2022, 10:14 pm

Below is a quick and dirty script that implements a simple timeline using code from goto.lua to go back and forwards. Try loading a pattern like breeder.lif and then running the script. I think it shows that this method works fine, even for patterns with thousands of cells.

Code: Select all

-- This script implements a simple timeline.

local g = golly()
local gp = require "gplus"
local op = require "oplus"
local split = gp.split
local ov = g.overlay

-- set startgen to current generation count
local startgen = tonumber(g.getgen())
local endgen = startgen + 1000 -- maximum gen count
local currgen = startgen

local ovwd, ovht        -- size of overlay (set by CreateOverlay)
local minwd = 500       -- minimum width of overlay

-- controls (set by CreateControls)
local backbutton        -- -1
local nextbutton        -- +1
local exitbutton        -- X
local genslider         -- slider for changing currgen

--------------------------------------------------------------------------------

function CreateOverlay()
    -- the overlay is a bar at the bottom of the viewport
    local viewwd, viewht = g.getview(g.getlayer())
    ovht = 32
    ovwd = viewwd
    if ovwd < minwd then ovwd = minwd end
    ov("create "..ovwd.." "..ovht)
    ov("cursor arrow")
    ov("position bottomleft")

    -- set parameters for buttons
    op.buttonht = 20
    op.textgap = 8                          -- gap between edge of button and its label
    op.textfont = "font 10 default-bold"    -- font for button labels
    op.textshadowx = 2
    op.textshadowy = 2
    if g.os() == "Linux" then
        op.textfont = "font 10 default"
    end
end

--------------------------------------------------------------------------------

function DrawControls()
    -- enable/disable some buttons
    backbutton.enable(currgen > startgen)
    nextbutton.enable(currgen < endgen)

    local hgap = 10     -- horizontal space between buttons
    local vgap = 6      -- vertical space above buttons
    local x = hgap
    local y = vgap
    local biggap = hgap * 2

    backbutton.show(x, y)
    x = x + backbutton.wd + hgap
    nextbutton.show(x, y)
    x = x + nextbutton.wd + biggap

    -- show slider to right of nextbutton
    genslider.show(x, y, currgen)

    -- exitbutton is at right end of slider
    x = x + genslider.wd + biggap
    exitbutton.show(x, y)
end

--------------------------------------------------------------------------------

function Refresh()
    ov("rgba 200 200 200 255")
    ov("fill")
    DrawControls()
    g.update()
end

--------------------------------------------------------------------------------

function Goto(newgen)
    -- simplified code from goto.lua
    if newgen < currgen then
        -- go back to starting gen (not necessarily 0);
        -- first save current location, scale, selection
        local midx, midy = g.getpos()
        local mag = g.getmag()
        local sel = g.getselrect()
        g.reset()
        -- restore location, scale, selection
        g.setpos(midx, midy)
        g.setmag(mag)
        g.select(sel)
        -- current gen might be > 0
        currgen = tonumber(g.getgen())
    end
    if newgen == currgen then return end

    local function intbase(n, b)
        -- convert integer n >= 0 to a base b digit array (thanks to PM 2Ring)
        digits = {}
        while n > 0 do
            digits[#digits + 1] = n % b
            n = math.floor(n / b)
        end
        if #digits == 0 then digits = {0} end
        return digits
    end

    -- use fast stepping (thanks to PM 2Ring)
    for i, d in ipairs(intbase(newgen - currgen, g.getbase())) do
        if d > 0 then
            g.setstep(i-1)
            for j = 1, d do
                if g.empty() then
                    currgen = tonumber(g.getgen())
                    return
                end
                g.step()
            end
        end
    end
    currgen = newgen
end

--------------------------------------------------------------------------------

function GotoGen(newgen)
    if newgen < startgen or newgen > endgen then return end
    
    local oldstep = g.getstep()
    Goto(newgen)
    g.setstep(oldstep)
    
    if g.getoption("autofit") == 1 then
        --!!! need smarter code to allow for overlay height
        g.fit()
    end
    
    Refresh()
end

--------------------------------------------------------------------------------

function GenChange(newgen)
    -- called if genslider position has changed
    GotoGen(newgen)
end

--------------------------------------------------------------------------------

function CreateControls()
    -- create buttons
    backbutton = op.button("-1", function() GotoGen(currgen-1) end)
    nextbutton = op.button("+1", function() GotoGen(currgen+1) end)
    exitbutton = op.button("X", g.exit)

    -- create slider for adjusting currgen
    genslider = op.slider("", op.white, 200, startgen, endgen, GenChange)
end

--------------------------------------------------------------------------------

function CheckWindowSize()
    -- if viewport width has changed then resize the overlay
    local newwd, newht = g.getview(g.getlayer())
    if newwd ~= ovwd then
        ovwd = newwd
        if ovwd < minwd then ovwd = minwd end
        ov("resize "..ovwd.." "..ovht)
        Refresh()
    end
end

--------------------------------------------------------------------------------

function EventLoop()
    while true do
        local event = g.getevent()
        if #event == 0 then
            g.sleep(5)          -- don't hog the CPU when idle
            CheckWindowSize()   -- might need to resize the overlay
        else
            event = op.process(event)
            if #event == 0 then
                -- op.process handled the given event (click in slider or button)
            elseif event:find("^key") then
                -- allow keyboard shortcuts (eg. to toggle full screen mode)
                g.doevent(event)
            elseif event:find("^click") or event:find("^zoom") then
                -- allow moving, zooming, etc
                g.doevent(event)
            end
        end
    end
end

--------------------------------------------------------------------------------

function Main()
    CreateOverlay()
    CreateControls()
    Refresh()
    EventLoop()
end

--------------------------------------------------------------------------------

if g.empty() then g.exit("There is no pattern.") end

-- make Goto code faster by copying current pattern into a new layer
-- so the g.step calls won't create lots of temporary files
if g.numlayers() == g.maxlayers() then
    g.exit("You need to delete a layer.")
else
    local pattern = g.getcells(g.getrect())
    local midx, midy = g.getpos()
    local mag = g.getmag()
    local sel = g.getselrect()
    g.addlayer()
    g.new("timeline")
    g.putcells(pattern)
    -- use same location, scale, selection, starting gen
    g.setpos(midx, midy)
    g.setmag(mag)
    g.select(sel)
    g.setgen(tostring(currgen)) -- currgen = startgen
    g.setcursor("Zoom In")
end
local oldtile = g.setoption("tilelayers", 0)

local status, err = xpcall(Main, gp.trace)
if err then g.continue(err) end
-- the following code is executed even if error occurred or user aborted script
ov("delete")
g.dellayer()
g.setoption("tilelayers", oldtile)
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
pipsqueek
Posts: 265
Joined: September 10th, 2022, 4:42 pm

Re: Golly suggestions

Post by pipsqueek » November 19th, 2022, 12:29 pm

Why are Margolus rules only able to be simulated through Margolus.lua or emulation? Could It have its own algorithm built into golly? (like how LTL and generations are)

Code: Select all

x=17,y=16,rule=B3/S23
3bo3bobo2bob2o$bobo4bo4b4o$bobo5bobo2b3o$b2obob2o3b2o$3o4b2ob2o2b2o$4b
o4bo$4b2obobob2ob3o$3ob3o2b2o$b3o2bobobo5bo$o3b2o3bobo2b2o$4bo3bob2o3b
o$2obo2bobobo2b2o$3b3o5bo2b2o$2obo4bo2bob2o$o3bob2obo3b2o$2bo8bobobo![[ STOP 3 GPS 4 ]]

User avatar
Redstoneboi
Posts: 429
Joined: May 14th, 2018, 3:57 am

Re: Golly suggestions

Post by Redstoneboi » December 27th, 2022, 2:15 am

Pardon me but I would like to bring attention back to An earlier suggestion of mine, to see if there are any technical (OS-related?) limitations that prevent the idea from being implemented, or if the feature is under way, or if it's not a priority.

It's mildly annoying having to move rules into my folder from my downloads every time, and I've found it's a relatively common source of confusion for newcomers.

The game "osu!" has a system where if you open an osz file, (a pack containing several maps to play,) it immediately moves the file out of the source folder (e.g. deletes it from downloads) and into wherever it internally stores community-provided maps. It's a very smooth process; I download a map from the website, click the downloading file which tells my computer "Open when fully downloaded", and wait as my computer handles the rest. Once the maps are fully downloaded, I am greeted with the map already open, and my downloads folder preserved, without me having to enter the filesystem at all.

This is, of course, just the ideal case. But I know you can create files in the rules folder because you can do it when pasting or opening zip files.

I hope I could get a (link to a prior?) response this time. Apologies if I sound rude, it's been bugging me every now and then.
c(>^w^<c)~*
This is 「Fluffy」
「Fluffy」is my sutando.
「Fluffy」has the ability to engineer r e p l i c a t o r s.
「Fluffy」likes to watch spaceship guns in Golly.
「Fluffy」knows Natsuki best girl.

User avatar
DroneBetter
Posts: 94
Joined: December 1st, 2021, 5:16 am
Location: The UK (a delightful place)
Contact:

Re: Golly suggestions

Post by DroneBetter » January 7th, 2023, 7:25 am

This has likely been thought of before, but what if the "hold arrow key to continue moving in that direction" behaviour were to work for both axes independently? (ie. with one key, say rightwards, it would move once then continue moving after the initial delay, but then pressing and holding down while keeping it pressed wouldn't overwrite it and cause you to move down once, have a delay and then continue, but would immediately change it to be moving diagonally.) I find myself having to alternate axes, this seems like it would be more efficient.

Also, does there exist a middle-mouse-button click-and-drag panning mode? (I don't have any mice with middle buttons to find out myself.) And could support for the standard behaviour of the macOS trackpad (and, I imagine, every multitouch one these days for most things), of two-finger scrolling causing panning and pinching causing zooming be added, or has it been tested and discovered not to work very well with its discrete coordinates and zooming?

Also, are there any plans at all to add an option for noninteger camera coordinates and non-power-of-2 zoom values to allow smooth panning, or is that considered too much trouble for what it's worth?
That concludes my post (I hope you liked it)

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

Re: Golly suggestions

Post by dvgrn » January 7th, 2023, 11:59 am

DroneBetter wrote:
January 7th, 2023, 7:25 am
This has likely been thought of before, but what if the "hold arrow key to continue moving in that direction" behaviour were to work for both axes independently? (ie. with one key, say rightwards, it would move once then continue moving after the initial delay, but then pressing and holding down while keeping it pressed wouldn't overwrite it and cause you to move down once, have a delay and then continue, but would immediately change it to be moving diagonally.) I find myself having to alternate axes, this seems like it would be more efficient.
Could be a cool feature, though I can't speak to how easy it would be to implement, especially across platforms. Seems to me that the way key repeats happen is OS-specific, so offhand I don't see how you'd avoid the initial delay on the second keypress.

Are you aware of the pop-up diagonal movement buttons in the upper left corner of Golly's universe pane? Holding down the mouse on one of the diagonal arrows lets you scroll in that direction until you let go of the button.

Also -- I don't remember if this was a recent addition and I've just been upgrading Golly too long instead of starting fresh, but there are "Scroll NW", "Scroll NE", etc. options under Preferences > Keyboard. They weren't mapped to anything on my system, but I assigned

Home = Scroll NW
Pg Up = Scroll NE
Pg Down = Scroll SE
End = Scroll SW

and now with the Num Lock key off, my numeric keypad lets me scroll in eight directions instead of just four. Works great!

Depending on your keyboard layout, you might want to do the mapping differently, but there should be a workable solution there somewhere.

User avatar
Redstoneboi
Posts: 429
Joined: May 14th, 2018, 3:57 am

Re: Golly suggestions

Post by Redstoneboi » January 17th, 2023, 6:15 am

DroneBetter wrote:
January 7th, 2023, 7:25 am
1.) Also, does there exist a middle-mouse-button click-and-drag panning mode? (I don't have any mice with middle buttons to find out myself.)
2.) And could support for the standard behaviour of the macOS trackpad (and, I imagine, every multitouch one these days for most things), of two-finger scrolling causing panning and pinching causing zooming be added, or has it been tested and discovered not to work very well with its discrete coordinates and zooming?

3.) Also, are there any plans at all to add an option for noninteger camera coordinates and non-power-of-2 zoom values to allow smooth panning, or is that considered too much trouble for what it's worth?
1.) Yes.
2.) I use a macbook and 2 finger scrolling zooms in/out since it just binds to scroll up/down. Pinching doesn't work. It's pretty sensitive in its current state anyway. It doesn't really have first-class support. Mouse is simply better.
3.) No. HactarCE had plans for a more advanced CA program called NDCell and had those working, but its development is on hold since he had other things to prioritize.

If anyone could answer my earlier request, that would be nice.
One more thing, accidentally opening a zip file and reverting your version of the rule isn't too fun either so those should ask if you want to replace the existing rule.
c(>^w^<c)~*
This is 「Fluffy」
「Fluffy」is my sutando.
「Fluffy」has the ability to engineer r e p l i c a t o r s.
「Fluffy」likes to watch spaceship guns in Golly.
「Fluffy」knows Natsuki best girl.

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

Re: Golly suggestions

Post by dvgrn » January 17th, 2023, 11:45 am

Redstoneboi wrote:
January 17th, 2023, 6:15 am
If anyone could answer my earlier request, that would be nice.
One more thing, accidentally opening a zip file and reverting your version of the rule isn't too fun either so those should ask if you want to replace the existing rule.
I haven't been answering, just because I can't volunteer to do the coding to work on that particular problem at the moment. I agree that the current behavior could definitely be improved, but it might be tricky to make changes without breaking some functionality that somebody is relying on. It will need a lot of testing, anyway.

As is often the case, the most likely way to push this particular change forward is probably to contribute the necessary code changes to Golly's repo, in the form of a pull request.

User avatar
confocaloid
Posts: 2729
Joined: February 8th, 2022, 3:15 pm

Re: Golly suggestions

Post by confocaloid » January 18th, 2023, 12:55 pm

Although this seems to be a known issue, I wanted to post it here as a suggestion. LifeViewer seems to ignore leading spaces in RLEs. I think Golly should do the same. Right now, when trying to paste in Golly a RLE with leading spaces, the result is broken.

The following examples paste correctly:

Code: Select all

x = 10, y = 5, rule = B3/S23
2b6o$bo6bo$o8bo$bo6bo$2b6o!

Code: Select all

#C This is okay
x = 10, y = 5, rule = B3/S23
2b6o$bo6bo$o8bo$bo6bo$2b6o!

Code: Select all

#C [[ THEME 6 ZOOM 8 GPS 15 AUTOSTART HARDRESET ]]
#C This is also okay
x = 10, y = 5, rule = B3/S23
2b6o$bo6bo$o8bo$bo6bo$2b6o!
The following examples paste incorrectly:

Code: Select all

 x = 10, y = 5, rule = B3/S23
2b6o$bo6bo$o8bo$bo6bo$2b6o!

Code: Select all

  x = 10, y = 5, rule = B3/S23
2b6o$bo6bo$o8bo$bo6bo$2b6o!

Code: Select all

 #C The leading space breaks things
x = 10, y = 5, rule = B3/S23
2b6o$bo6bo$o8bo$bo6bo$2b6o!

Code: Select all

#C The leading space breaks things
 x = 10, y = 5, rule = B3/S23
2b6o$bo6bo$o8bo$bo6bo$2b6o!
127:1 B3/S234c User:Confocal/R (isotropic rules, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.

BokaBB
Posts: 2973
Joined: December 30th, 2019, 11:55 am
Location: Serbia

Re: Golly suggestions (Actual hexagonal grid in Golly?)

Post by BokaBB » February 23rd, 2023, 3:48 am

Hi there. I'd love if the next update of Golly could have an actual hexagonal grid instead of the current mess. It'd help a lotI think. Anyone else agree?
777
I CAN APGSEARCH NOW!


Sure, I was a bad person, but I have changed myself.
I'd love to befriend anybody who's interested.
Have a good day!

BokaBB

BokaBB
Posts: 2973
Joined: December 30th, 2019, 11:55 am
Location: Serbia

Re: Golly suggestions

Post by BokaBB » March 16th, 2023, 2:22 pm

Hey ya. I think there's currently a large problem with all multistate rules:there is no option for an area to be randomly filled with only some cell states and not them all, prohibiting meaningful random fills in History, LtL, Generations and such rules. Could that be implemented, please?
777
I CAN APGSEARCH NOW!


Sure, I was a bad person, but I have changed myself.
I'd love to befriend anybody who's interested.
Have a good day!

BokaBB

User avatar
pipsqueek
Posts: 265
Joined: September 10th, 2022, 4:42 pm

Re: Golly suggestions (Actual hexagonal grid in Golly?)

Post by pipsqueek » March 30th, 2023, 3:00 pm

BokaBB wrote:
February 23rd, 2023, 3:48 am
Hi there. I'd love if the next update of Golly could have an actual hexagonal grid instead of the current mess. It'd help a lotI think. Anyone else agree?
agreed! I do think we should at least be able to properly rotate and reflect hexagonal patterns. a built in hexagonal grid would be cool

Code: Select all

x=17,y=16,rule=B3/S23
3bo3bobo2bob2o$bobo4bo4b4o$bobo5bobo2b3o$b2obob2o3b2o$3o4b2ob2o2b2o$4b
o4bo$4b2obobob2ob3o$3ob3o2b2o$b3o2bobobo5bo$o3b2o3bobo2b2o$4bo3bob2o3b
o$2obo2bobobo2b2o$3b3o5bo2b2o$2obo4bo2bob2o$o3bob2obo3b2o$2bo8bobobo![[ STOP 3 GPS 4 ]]

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

Re: Golly suggestions

Post by GUYTU6J » April 30th, 2023, 12:52 am

Apart from the "SuperToHistory" part, there are other unnecessary inconsistencies between toHistory.lua and toSuper.lua. Suggested changes:

Code: Select all

$ git diff ./toHistory.lua ./toHistory_new.lua
diff --git a/./toHistory.lua b/./toHistory_new.lua
index 3a4d553..54e3764 100644
--- a/./toHistory.lua
+++ b/./toHistory_new.lua
@@ -48,10 +48,6 @@ local function CreateRule()
     end
 end

-local function tryrule()
-    g.setrule(baserule.."History"..suffix)
-end
-
 -- deal with bounded-universe syntax appropriately
 suffix = ""
 baserule = rule
@@ -62,7 +58,9 @@ if ind then
@@ -62,7 +58,9 @@ if ind then
 end

 -- No effect if the current rule ends with "History"
-if algo == "Super" and baserule:sub(-7) == "History" then g.exit("The current rule is already a [Rule]History rule.") end
+if algo == "Super" and baserule:sub(-7) == "History" then^M
+    g.exit("The current rule is already a [Rule]History rule.")^M
+end^M

 step = g.getstep()
 -- If rulestring contains "Super" suffix, remove it and continue
@@ -73,7 +71,11 @@ if algo == "Super" and baserule:sub(-5) == "Super" then
     g.run(1)
     g.setgen("-1")
 end
+^M
 -- attempt to set the new History rule to see if it is valid
+local function tryrule()^M
+    g.setrule(baserule.."History"..suffix)^M
+end^M
 local status, err = pcall(tryrule)
 if err then
     g.note("Conversion failed. This '"..baserule.."' rule is not supported by the Super algo.\n"
@@ -81,4 +83,4 @@ if err then
     g.exit("Press Z to revert to the original rule.")
 end

-g.setstep(step)
\ No newline at end of file
+g.setstep(step)^M

Code: Select all

$ git diff ./toSuper.lua ./toSuper_new.lua
diff --git a/./toSuper.lua b/./toSuper_new.lua
index d238127..9e5002b 100644
--- a/./toSuper.lua
+++ b/./toSuper_new.lua
@@ -10,21 +10,31 @@ local algo = g.getalgo()
 suffix = ""
 baserule = rule
 ind = string.find(rule, ":")
-if (ind) then
+if ind then^M
     suffix = rule:sub(ind)
     baserule = rule:sub(1,ind-1)
 end

 -- No effect if the current rule ends with "Super"
-if algo == "Super" and baserule:sub(-5) == "Super" then g.exit("The current rule is already a [Rule]Super rule.") end
+if algo == "Super" and baserule:sub(-5) == "Super" then^M
+    g.exit("The current rule is already a [Rule]Super rule.")^M
+end^M

+step = g.getstep()^M
 -- If rulestring contains "History" suffix, remove it and continue
-if algo == "Super" and baserule:sub(-7) == "History" then baserule = baserule:sub(1, #baserule-7) end
+if algo == "Super" and baserule:sub(-7) == "History" then^M
+    baserule = baserule:sub(1, #baserule-7)^M
+end^M

-local function setnewrule()
+-- attempt to set the new Super rule to see if it is valid^M
+local function tryrule()^M
     g.setrule(baserule.."Super"..suffix)
 end
-local status, err = pcall(setnewrule)
+local status, err = pcall(tryrule)^M
 if err then
-    g.exit("The current rule is not supported by the Super algo.")
-end
\ No newline at end of file
+    g.note("Conversion failed. This '"..baserule.."' rule is not supported by the Super algo.\n"^M
+           .. "To revert to the original rule, please click OK, then press Z to undo the rule change.")^M
+    g.exit("Press Z to revert to the original rule.")^M
+end^M
+^M
+g.setstep(step)^M
---
Please replace Non-Totalistic/whitespace-puffer.rle with this:

Code: Select all

#N whitespace-puffer.rle
#O Moosey, 12 May 2019
#C 
#C     Here in another corner of the whitespace rules is a puffer 
#C puffing spacefillers at a period of 26. The resulting pattern
#C grows in population in an unusual way.
#C Reference:
#C  https://conwaylife.com/forums/viewtopic.php?p=76107#p76107
#C Compare with a period-14 example by jimmyChen2013, 28 March 2021:
#C  https://conwaylife.com/forums/viewtopic.php?p=127178#p127178
#C 
#C     In the original post, Moosey also offered a stationary
#C period-184, mod-92 factory of whitespaces:
#C x = 25, y = 6, rule = B3ai4ce5c6c7c/S3acein4et5i6cei78
#C 23bo$12bo2bo8bo$11b4o6b4o$12bo2bo8bo$2o21bo$2o!
#C Compare with another pattern where outputs are linear wick-
#C stretchers instead of quadratic spacefillers, where the population
#C versus generation curve will converge to a Takagi function
#C as pointed out in this post:
#C   https://conwaylife.com/forums/viewtopic.php?p=90367#p90367
#C
x = 11, y = 3, rule = B2i3-cejk4ceky5ci6c7c/S3acein4etyz5i6cei78
bo7b2o$3o5b3o$bo7b2o!
Additionally, the word "in" in both addenda of Self-Rep/Banks/Banks-I-demo.rle and Banks-III-demo.rle should be "on".

Post Reply