You're absolutely correct I missed that.
Golly suggestions
Re: Golly suggestions
LifeViewer https://lazyslug.com/lifeviewer
Re: Golly suggestions
Is the requirement here to have a settings UI that would allow state multipliers to be specified which would then impact how Golly displays the population count in the status bar?Extrementhusiast wrote: ↑June 13th, 2022, 11:41 pmI'd be surprised if this hasn't been suggested so far, as it's exceedingly simple: having adjustable weights for each state when calculating population. Even a simple on/off checkbox for each state would be useful for many purposes! (This could probably be modeled after the Set Layer Colors dialog box, with similar behavior under rule changes.)
Would the intention also to have this change the result of the Lua and Python getpop commands?
Would the state multipliers be per rule?
LifeViewer https://lazyslug.com/lifeviewer
Re: Golly suggestions
This certainly would be a big change to Golly and/or LifeViewer and so I don't expect it to be implemented soon or even at all. But it is an idea.
The current RLE format has issues where the pattern is repetitive but does not repeat the same cell -- consider this pattern:
Now my idea is to take any repeating section and compress it by enclosing it in parenthesis with a number outside to say how many times to repeat, then repeating until the pattern can't be compressed further. So bobobobo would compress to 4(bo).
The pattern above would then compress to:
The process of expanding it would be to find all occurrences of strings inside the parens that do not themselves contain parens, expanding it by the number outside the parens, and then repeating until there are no parens.
For the actual code, I have some regular expressions that might work in LifeViewer, but I have no idea how to do it in plain old C++ for Golly. Chris Rowett, feel free to PM me and we can discuss further.
The current RLE format has issues where the pattern is repetitive but does not repeat the same cell -- consider this pattern:
Code: Select all
x = 16, y = 16, rule = B3/S23
obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob$obobobobobobobob!
The pattern above would then compress to:
Code: Select all
x = 16, y = 16, rule = B3/S23
15(8(ob)$)8(ob)!
For the actual code, I have some regular expressions that might work in LifeViewer, but I have no idea how to do it in plain old C++ for Golly. Chris Rowett, feel free to PM me and we can discuss further.
Re: Golly suggestions
There's some prior art for this idea -- see this post by hotdogPi, for example, and the responses to it. That was just the most recent time that the idea has come up.
Actual implementation of that particular compression idea never seems to happen, for what are probably fairly good reasons (given in part in the URLE thread).
Re: Golly suggestions
Whoops, I didn't see that post before! Thanks for pointing it out. I figured it would take a long time to be adopted anyway, since it's such a backwards-incompatible change.dvgrn wrote: ↑June 19th, 2022, 9:16 amThere's some prior art for this idea -- see this post by hotdogPi, for example, and the responses to it. That was just the most recent time that the idea has come up.
I'm not on the Discord (yet!), but I do know Python and Javascript. If the Caterer bot is written in either of those two languages I can help with it.dvgrn, on the URLE thread, wrote: ↑May 23rd, 2021, 10:37 pmSo if someone wants to work out a more compact alternative to RLE, I'd suggest that the best plan would be to work to get Caterer to support it, and get people on Discord to use it -- because it would really be potentially somewhat useful there.
Re: Golly suggestions
What exactly are the "issues"? Other than not being compact or pretty. Writing an RLE encoder/decoder in a new language should be an almost trivial activity, a perfect "exercise for the student" kind of thing.wirehead wrote:The current RLE format has issues where the pattern is repetitive but does not repeat the same cell
A better solution might be to stop thinking of these huge constructions as a giant, single bit-array millions of cells wide. Instead, come up with an encoding that defines the parts in terms of RLE (or apgcode), then specifies their placement by reference with a transformation and offset. Especially if repetition is your concern. That way you won't be breaking existing RLE encoders/decoders and other tools, but building on them.
Re: Golly suggestions
That's actually an idea I had a while back. It would involve some serious pattern-segmentation algorithm but the simplest would probably be that used by move-object.py (flood fill of connected cells) which already works great for Life-like rules, but not very well at all for Wireworld where everything is connected.hkoenig wrote: ↑June 19th, 2022, 1:57 pmInstead, come up with an encoding that defines the parts in terms of RLE (or apgcode), then specifies their placement by reference with a transformation and offset. Especially if repetition is your concern. That way you won't be breaking existing RLE encoders/decoders and other tools, but building on them.
Anyway, the output dump could be structured into larger nodes where a "data" node would include a pattern name, X, Y, and its RLE, and then also have "reference" node that reference the name, and also translation, and transormation matrix (like golly.putcells script command). For example,
Code: Select all
[block,2o$2o]
[b60,{block,0,0,1,0,0,1},{block,7,0,1,0,0,1},{block,3,3,1,0,0,1}]
[simkin gun,{b60,0,0,1,0,0,1},{b60,-17,-13,-1,0,0,-1},{herschel,.....................}]
Re: Golly suggestions
A variety of this has already been done. See here.hkoenig wrote: ↑June 19th, 2022, 1:57 pmA better solution might be to stop thinking of these huge constructions as a giant, single bit-array millions of cells wide. Instead, come up with an encoding that defines the parts in terms of RLE (or apgcode), then specifies their placement by reference with a transformation and offset. Especially if repetition is your concern. That way you won't be breaking existing RLE encoders/decoders and other tools, but building on them.
LifeViewer https://lazyslug.com/lifeviewer
Re: Golly suggestions
I see Chris got in a bit ahead of me, but I'll keep this here since it has more links...!hkoenig wrote: ↑June 19th, 2022, 1:57 pmA better solution might be to stop thinking of these huge constructions as a giant, single bit-array millions of cells wide. Instead, come up with an encoding that defines the parts in terms of RLE (or apgcode), then specifies their placement by reference with a transformation and offset.
There's a current working edition of the old XLife "#I encoding" that matches this description. Golly and LifeViewer both support a "pattern script format", with slightly different syntax. There's a big example of the Golly Python and Lua versions here, and a LifeViewer version is here. See also this "Multiple Cluster Pattern Storage" thread.
Re: Golly suggestions
I'm (finally) starting to do some Golly scripting rather than rewriting Life generation code every time I want to perform a simple task, and one problem I ran into was creating videos in a format such as mp4 suitable for including in a YouTube presentation.
There's the simple solution of screen capture. To be honest, I always get very clumsy with this and have to make repeated attempts, e.g. to set the right screen window and starting time. I would also like to place markers to show cell locations in the video. This can be done in a video editor such as Davinci resolve, but again, there are just too many interactive steps involved.
Today I started coding up a Java solution using a simplistic list-based generation algorithm and Graphics2D on BufferedImage to write out the generations into image files frame by frame. Then I use ffmpeg to create the video.
It would be nice it there was a way to do it in Golly directly. I could write a script, though I would need to do some of the above steps in Python or Lua. Has anyone written something like this?
There's the simple solution of screen capture. To be honest, I always get very clumsy with this and have to make repeated attempts, e.g. to set the right screen window and starting time. I would also like to place markers to show cell locations in the video. This can be done in a video editor such as Davinci resolve, but again, there are just too many interactive steps involved.
Today I started coding up a Java solution using a simplistic list-based generation algorithm and Graphics2D on BufferedImage to write out the generations into image files frame by frame. Then I use ffmpeg to create the video.
It would be nice it there was a way to do it in Golly directly. I could write a script, though I would need to do some of the above steps in Python or Lua. Has anyone written something like this?
Re: Golly suggestions
As far as I know, you could just hack giffer.py or giffer.lua because I think ffmpeg can convert from a gif. Although this will really eat up memory because giffer.lua doesn't compress the gif more if not many cells change.
- confocaloid
- Posts: 2729
- Joined: February 8th, 2022, 3:15 pm
Re: Golly suggestions
(Probably a relatively minor issue, but still) Suppose the current pattern is in a History version of a non-CGoL rule (for a concrete example: B3/S234cHistory). A consequence of choosing menu item "Control -> Set Algorithm -> QuickLife" or "Control -> Set Algorithm -> HashLife" seems that the rule is changed to Life. I think it would be more intuitive to keep the rule (in this example, B3/S234c) but drop the suffix "History" - in other words, the effect of "Control -> Set Algorithm -> QuickLife" or "Control -> Set Algorithm -> HashLife" on a pattern in the History version of some rule should be the same as when I go to "Control -> Set Rule..." dialog, manually remove the suffix "History" from the rule and press "OK".
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.
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.
Re: Golly suggestions
That does seem somewhat reasonable as a default.confocaloid wrote: ↑July 7th, 2022, 8:49 am(Probably a relatively minor issue, but still) Suppose the current pattern is in a History version of a non-CGoL rule (for a concrete example: B3/S234cHistory). A consequence of choosing menu item "Control -> Set Algorithm -> QuickLife" or "Control -> Set Algorithm -> HashLife" seems that the rule is changed to Life. I think it would be more intuitive to keep the rule (in this example, B3/S234c) but drop the suffix "History" - in other words, the effect of "Control -> Set Algorithm -> QuickLife" or "Control -> Set Algorithm -> HashLife" on a pattern in the History version of some rule should be the same as when I go to "Control -> Set Rule..." dialog, manually remove the suffix "History" from the rule and press "OK".
There's probably a reason why this hasn't come up before, though: switching the rule by switching the algo has some unpleasant effects, so nobody does it that way. The main problem is that states greater than 1 all getting reduced to state 1 (which is not what you want for the even-numbered states -- patterns with History cells just turn into a big mess.)
The way you're "supposed" to manage rule and algo changes with History and Super patterns is via Lua scripts, and their associated keyboard shortcuts: Alt+G to switch to a Super version of a rule, Alt+H to switch to a History version, and Alt+J to cleanly get rid of any extra states and go back to the standard two-state rule.
- confocaloid
- Posts: 2729
- Joined: February 8th, 2022, 3:15 pm
Re: Golly suggestions
On my installation (Golly 4.1), pressing Alt+J leads to a message "The script file does not exist: Scripts/Lua/toLife.lua". If I choose "toStandard.lua" from the filetree on the left, it usually works, but sometimes it displays "toStandard.lua:64:dvgrn wrote: ↑July 7th, 2022, 10:10 amThe way you're "supposed" to manage rule and algo changes with History and Super patterns is via Lua scripts, and their associated keyboard shortcuts: Alt+G to switch to a Super version of a rule, Alt+H to switch to a History version, and Alt+J to cleanly get rid of any extra states and go back to the standard two-state rule.
Given rule is not valid in any algorithm." instead, after which "Script aborted" is displayed in status line and generation number is set to 1. (For example, I get this error now when trying to open and convert H-to-G-25Sep2021.rle.)
Probably these issues can be resolved in a simple way - I did not investigate it. It seems that toChangeState.lua works correctly for me, so I use this script to get rid of extra states. After that I convert to non-History version by going to the Set Rule dialog and removing the History suffix from the rulestring.
Edit:
(Probably I should have posted about this issue in another thread - should this post be moved?) Here is a possible guess for my problem with "toStandard.lua". When I download and unpack "golly-4.1-gtk-64bit.tar.gz", there is a directory "golly-4.1-gtk-64bit/Rules/" which contains many rule files, including a file "Life.rule". If "Life.rule" is kept there, "toStandard.lua" seems to work without an error; if "Life.rule" is removed or renamed, "toStandard.lua" fails with error "toStandard.lua:64: Given rule is not valid in any algorithm." (Can someone reproduce this?) Edit 2: I get the same error (toStandard.lua fails without Rules/Life.rule) also in golly-4.2b1-gtk-64bit, and also in golly-4.2b1-win-64bit (using wine).dvgrn wrote: ↑July 7th, 2022, 10:54 amThis part I don't understand, but I'd like to. There's some combination of rule and algo settings that causes this problem -- and it's something that I never do myself, so I never see this problem. If you can find a set of steps that reproduces this issue, I'd definitely like to know about it.confocaloid wrote: ↑July 7th, 2022, 10:35 amIf I choose "toStandard.lua" from the filetree on the left, it usually works, but sometimes it displays "toStandard.lua:64:
Given rule is not valid in any algorithm." instead, after which "Script aborted" is displayed in status line and generation number is set to 1. (For example, I get this error now when trying to open and convert H-to-G-25Sep2021.rle.)
Last edited by confocaloid on July 7th, 2022, 5:11 pm, edited 2 times in total.
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.
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.
Re: Golly suggestions
This is something that can happen when Golly is upgraded in a way that leaves the old GollyPrefs file in place. There isn't any "toLife.lua" in Golly 4.0+, but your GollyPrefs file comes from some version of earlier version of Golly that had Alt+J mapped to the Conway's-Life-only "toLife.lua" (before Chris Rowett put in the general algorithm that works the same way for a wide range of isotropic rules).confocaloid wrote: ↑July 7th, 2022, 10:35 amOn my installation (Golly 4.1), pressing Alt+J leads to a message "The script file does not exist: Scripts/Lua/toLife.lua".
People often seem to think of keyboard shortcuts as a deep mystery, but really they're very simple, and ought to get used a lot more often -- you can customize Golly to let you easily do your most common tasks (which are different for every user of Golly).
It's easy to fix keyboard shortcuts when things like this go wrong. You can re-map the Alt+J keyboard shortcut very quickly, using File > Preferences > Keyboard, type in Alt+J , click "Choose File" and pick toStandard.lua. Similarly, re-map Alt+H with "Choose File" > toHistory.lua and Alt+G with "Choose File" > toSuper.lua.
This part I don't understand, but I'd like to. There's some combination of rule and algo settings that causes this problem -- and it's something that I never do myself, so I never see this problem. If you can find a set of steps that reproduces this issue, I'd definitely like to know about it.confocaloid wrote: ↑July 7th, 2022, 10:35 amIf I choose "toStandard.lua" from the filetree on the left, it usually works, but sometimes it displays "toStandard.lua:64:
Given rule is not valid in any algorithm." instead, after which "Script aborted" is displayed in status line and generation number is set to 1. (For example, I get this error now when trying to open and convert H-to-G-25Sep2021.rle.)
I'd definitely like to understand these rare cases where toStandard.lua gives an error. I've seen it myself -- very early on, I think, during my initial testing of the toStandard, toHistory, and toSuper scripts. I've been unable to duplicate the problem recently. If you want to continue the investigation, we should probably move to discussing it in a Bugs & Errors thread, though.confocaloid wrote: ↑July 7th, 2022, 10:35 amProbably these issues can be resolved in a simple way - I did not investigate it. It seems that toChangeState.lua works correctly for me, so I use this script to get rid of extra states. After that I convert to non-History version by going to the Set Rule dialog and removing the History suffix from the rulestring.
EDIT: To answer the edit above, I think all this is fine where it is, since it may help point out exactly what can be improved in Golly. It was just if this got into an extended troubleshooting session that it would probably fit better in Bugs & Errors.
Re: Golly suggestions
I think I've mentioned this before, but if you have an RLE in the clipboard and try to click Run Clipboard, it tells you that Perl scripting is no longer supported. It should instead tell you that you have an RLE in the clipboard.
User:HotdogPi/My discoveries
Periods discovered: 5-16,⑱,⑳G,㉑G,㉒㉔㉕,㉗-㉛,㉜SG,㉞㉟㊱㊳㊵㊷㊹㊺㊽㊿,54G,55G,56,57G,60,62-66,68,70,73,74S,75,76S,80,84,88,90,96
100,02S,06,08,10,12,14G,16,17G,20,26G,28,38,47,48,54,56,72,74,80,92,96S
217,486,576
S: SKOP
G: gun
Periods discovered: 5-16,⑱,⑳G,㉑G,㉒㉔㉕,㉗-㉛,㉜SG,㉞㉟㊱㊳㊵㊷㊹㊺㊽㊿,54G,55G,56,57G,60,62-66,68,70,73,74S,75,76S,80,84,88,90,96
100,02S,06,08,10,12,14G,16,17G,20,26G,28,38,47,48,54,56,72,74,80,92,96S
217,486,576
S: SKOP
G: gun
Re: Golly suggestions
This sounds like a bug rather than a suggestion!
-
- Posts: 471
- Joined: June 11th, 2022, 11:24 pm
Re: Golly suggestions
Is it feasible to add a function to Golly that directly pastes an apgcode to the Golly layer without first accessing a Catagolue page or running a Python script using lifelib?
Also, when I click and initiate a paste event at the same time, Golly quits with a wxWidgets debug warning. While I am using it as a quick way of force-quitting Golly when I want, someone may accidentally invoke this bug and lose their unsaved data on Golly.
Also, when I click and initiate a paste event at the same time, Golly quits with a wxWidgets debug warning. While I am using it as a quick way of force-quitting Golly when I want, someone may accidentally invoke this bug and lose their unsaved data on Golly.
Re: Golly suggestions
This doesn't happen on my end. Golly 4.1, Mac OS 12.4carsoncheng wrote: ↑July 25th, 2022, 9:25 amAlso, when I click and initiate a paste event at the same time, Golly quits with a wxWidgets debug warning. While I am using it as a quick way of force-quitting Golly when I want, someone may accidentally invoke this bug and lose their unsaved data on Golly.
User:HotdogPi/My discoveries
Periods discovered: 5-16,⑱,⑳G,㉑G,㉒㉔㉕,㉗-㉛,㉜SG,㉞㉟㊱㊳㊵㊷㊹㊺㊽㊿,54G,55G,56,57G,60,62-66,68,70,73,74S,75,76S,80,84,88,90,96
100,02S,06,08,10,12,14G,16,17G,20,26G,28,38,47,48,54,56,72,74,80,92,96S
217,486,576
S: SKOP
G: gun
Periods discovered: 5-16,⑱,⑳G,㉑G,㉒㉔㉕,㉗-㉛,㉜SG,㉞㉟㊱㊳㊵㊷㊹㊺㊽㊿,54G,55G,56,57G,60,62-66,68,70,73,74S,75,76S,80,84,88,90,96
100,02S,06,08,10,12,14G,16,17G,20,26G,28,38,47,48,54,56,72,74,80,92,96S
217,486,576
S: SKOP
G: gun
Re: Golly suggestions
You certainly don't need to access a Catagolue page or use lifelib to do an apgcode-to-RLE conversion. Here's a standalone Golly Python script that accomplishes that trick. If someone wants to port that to Lua, that would get rid of the dependency on Python as well.carsoncheng wrote: ↑July 25th, 2022, 9:25 amIs it feasible to add a function to Golly that directly pastes an apgcode to the Golly layer without first accessing a Catagolue page or running a Python script using lifelib?
(There isn't already a Lua version of an apgcode decoder, is there? I have a vague memory that there might be one, but I have a lot of vague memories about things that ought to exist by this time but probably don't.)
Re: Golly suggestions
I was able to reproduce this, but only on my Mac and only when typing cmd-V rather than just V. I'm pretty sure the warning is spurious (due to a bug somewhere in the wxMac code) but I've committed a change that seems to avoid the warning so this problem should be fixed in the final 4.2 release.carsoncheng wrote: ↑July 25th, 2022, 9:25 amAlso, when I click and initiate a paste event at the same time, Golly quits with a wxWidgets debug warning.
-
- Posts: 2200
- Joined: August 5th, 2016, 10:27 am
- Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
- Contact:
Re: Golly suggestions
The latest Golly 4.2 contains a few duplicated patterns in the Non-Totalistic folder:
double-sierpinski-builder.rle (already in Replicators)
goldilocks.rle (already in Spaceships)
slant-sierpinski-generator.rle (already in Replicators)
smos-predecessor.rle (already in Spaceships)
sparse-c7.rle (already in Spaceships)
---
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. Is there an alternative web Golly that I am not aware of?
double-sierpinski-builder.rle (already in Replicators)
goldilocks.rle (already in Spaceships)
slant-sierpinski-generator.rle (already in Replicators)
smos-predecessor.rle (already in Spaceships)
sparse-c7.rle (already in Spaceships)
---
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. Is there an alternative web Golly that I am not aware of?
熠熠种花 - Glimmering Garden
Harvest Moon
2-engine p45 gliderless HWSS gun
Small p2070 glider gun
Forgive me if I withhold my enthusiasm.
Harvest Moon
2-engine p45 gliderless HWSS gun
Small p2070 glider gun
Forgive me if I withhold my enthusiasm.
Re: Golly suggestions
Thanks for spotting those. I assume the duplicates *outside* the Replicators/Spaceships subfolders are the files that should be deleted?
The commit only changed a file in the golly repository on sourceforge. I haven't uploaded a new version of the web app because it seems to be broken when I've tested it locally on my Mac using Safari or Chrome. Still investigating why that is so, but if I can't fix it then the web app might have to be frozen at its current old version. This was always an experimental version of Golly so people shouldn't really depend on its continued existence.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.
-
- Posts: 2200
- Joined: August 5th, 2016, 10:27 am
- Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
- Contact:
Re: Golly suggestions
Yes.
---
Typos:
Non-Totalistic/Spaceships/tlife-8c282-spaceship.rle, line 5, "inhabits"→is inhabited by
Non-Totalistic/p532-checkerboard-puffer.rle, line 6, "themselve"→themselves
Inconsistent parameters in post links, which don't affect reference locating but may make perfectionists unhappy:
Non-Totalistic/limited-spacefiller.rle, "p=46828#p46337"→p=46337#p46337
Life/Signal-Circuitry/high-bandwith-telegraph.rle.gz, "p=41601#p40760"→p=40760#p40760
Life/Signal-Circuitry/single-channel-spiral-growth.rle.gz, "p=46017#p44792"→p=44792#p44792
---
Life/Miscellaneous/ordovician-radiation.rle, line 181, the name Simon Ekström may contain a broken letter ö within other character encodings. Can this be fixed?
熠熠种花 - Glimmering Garden
Harvest Moon
2-engine p45 gliderless HWSS gun
Small p2070 glider gun
Forgive me if I withhold my enthusiasm.
Harvest Moon
2-engine p45 gliderless HWSS gun
Small p2070 glider gun
Forgive me if I withhold my enthusiasm.
Re: Golly suggestions
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:GUYTU6J wrote: ↑August 15th, 2022, 9:20 amThis 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.
This is Golly 4.2 for the web (copyright 2005-2022 The Golly Gang).