Golly 5.0 is coming

For general discussion about Conway's Game of Life.
Post Reply
User avatar
Andrew
Moderator
Posts: 1064
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Golly 5.0 is coming

Post by Andrew »

Actually, there's more likely to be a beta version first (5.0b1). Here are the changes so far:
  • Created a new application icon (with help from Claude) to celebrate Golly's 20th anniversary.
  • Removed the Convert Old Rules command from the Control menu. Golly no longer supports .table/tree/colors/icons files.
  • Added a Stop If Dead option to the Control menu. If ticked then Golly automatically stops generating a pattern if it dies. The final generation number is accurate if the step size is 1. If greater than 1 then death occurred somewhere within the last step (possibly the last generation in that step).
  • Added a Show XY State option to the View menu. If ticked then the status bar shows the state of the cell at the XY location. Note that if that location is outside the edit boundaries (+/- 1 billion) and the universe is not empty then "?" is displayed for the state.
  • Added support for @NAMES in a .rule file. The names are displayed to the right of the scroll bar used to change the drawing state, and in the status bar if the Show XY State option is ticked. To see examples, open circuit.mcl or worm-1040512.rle.
  • Added support for @RULE data in a .rle file. For example, open calcyman-primer.rle (replaces calcyman-primer.zip).
  • Added "-" and "+" buttons to the help window for changing the text size.
  • Golly now uses C++11's Mersenne Twister for randomly filling a selection, rather than rand(), since rand() has a somewhat low period (about 2^31 or 2^32 on various platforms).
  • Fixed slow scrolling at some scales when using arrow keys.
  • Fixed Control > Reset being called via a keyboard shortcut while the mouse is drawing or selecting cells.
  • Fixed cosmetic problems with the state boxes and directory icons in the macOS app.
  • Fixed a problem with the About dialog in the macOS app.
  • Updated Lua to version 5.4.8.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife and SpectreLife
hkoenig
Posts: 299
Joined: June 20th, 2009, 11:40 am

Re: Golly 5.0 is coming

Post by hkoenig »

On the Mac version, a keyboard equivalent for "Shrink Selection" would be useful.

Also, adding a way to move a selection and its contents would be appreciated. "Nudge" via option-<cursor key>? Right now I have to cut/paste and then drag the selection. (At least I can't find any better way.)
User avatar
LuveelVoom
Posts: 888
Joined: April 27th, 2022, 7:59 pm
Location: The 102 dimensional INT hypercube

Re: Golly 5.0 is coming

Post by LuveelVoom »

I think a control rework would be great, as right now a lot of golly elements feel clunky to use. Not sure where exactly to start though.
User avatar
Andrew
Moderator
Posts: 1064
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 5.0 is coming

Post by Andrew »

hkoenig wrote: July 26th, 2025, 1:39 pm On the Mac version, a keyboard equivalent for "Shrink Selection" would be useful.
Just open the Preferences dialog (now called Settings on newer macOS versions), go to the Keyboard tab, type the key combo you want to use (I use Option-S), select Shrink Selection from the Action menu, then hit OK.
Also, adding a way to move a selection and its contents would be appreciated. "Nudge" via option-<cursor key>? Right now I have to cut/paste and then drag the selection. (At least I can't find any better way.)
Open Preferences/Settings > Keyboard, type a key combo not assigned to any other action (eg. Option-M), then hit the Choose File button and select Scripts/Lua/move-selection.lua.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife and SpectreLife
User avatar
islptng
Posts: 496
Joined: May 24th, 2024, 6:17 am
Location: 种花家

Re: Golly 5.0 is coming

Post by islptng »

Where can I get it? Also, has the pattern collection been enlarged?
(As now old format is no longer supported, please check RuleTableRepository for old format rules and replace them with new ones.)
(By the way: is the new icon your current avatar? I actually prefer the old one,)
(A PNG/JPG/BMP exporter will be useful too. This will make Golly a Pixel Art editor.)

EDIT: You can just move part of the "too large" collection to the internet (but make sure Chinese can access them!).
Last edited by islptng on July 27th, 2025, 1:42 am, edited 1 time in total.
My sandbox | All my engineered replicators | BsKngt | TNT
Asperger, ISTP, using a Dvorak keyboard.

I love my new school life.
User avatar
Andrew
Moderator
Posts: 1064
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 5.0 is coming

Post by Andrew »

islptng wrote: July 26th, 2025, 8:04 pm Where can I get it?
I'm still making changes so best to wait for the release of 5.0b1 (hopefully within the next month or two).
Also, has the pattern collection been enlarged?
Not yet (personally I think it's already too large, but that ship has sailed).
(As now old format is no longer supported, please check RuleTableRepository for old format rules and replace them with new ones.)
Just checked all the zip files in that repository and only two need to be updated (Petelka.zip and Pilot.zip) so I'll do that soon.
(By the way: is the new icon your current avatar? I actually prefer the old one,)
Yes, that's the new Golly icon. I suspect you're in a tiny minority of people who prefer the old one!
(A PNG/JPG/BMP exporter will be useful too. This will make Golly a Pixel Art editor.)
I'm pretty sure all platforms provide easy ways to capture a screenshot of the Golly window, so I don't see any need to provide an image exporter within Golly. Plus we already provide giffer.lua to create GIF files, and below is a similar Lua script for creating BMP files:

Code: Select all

-- Run the current pattern and save the selection as a separate .bmp file
-- for each generation.  The files are saved in the same folder as the script.
-- Author: Andrew Trevorrow (andrew@trevorrow.com), March 2017.

local g = golly()
local gp = require "gplus"
local chr = string.char
local getcell = g.getcell

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

local srect = g.getselrect()
if #srect == 0 then g.exit("There is no selection.") end
local x, y, wd, ht = table.unpack(srect)

-- avoid creating huge files
if wd * ht >= 100000000 then
   g.exit("Bitmap area is restricted to < 100 million cells.")
end

local colors = g.getcolors()     -- {0,r0,g0,b0, ... N,rN,gN,bN}
local state0 = chr(colors[4])..chr(colors[3])..chr(colors[2])
local statebgr = {}
for i = 1, g.numstates() - 1 do
    local j = i * 4 + 2
    statebgr[i] = chr(colors[j+2])..chr(colors[j+1])..chr(colors[j])
end

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

-- Pack a given +ve integer into a little-endian binary string of size numbytes.
-- Based on code at http://lua-users.org/wiki/ReadWriteFormat.

local function lpack(numbytes, value)
    local result = ""
    for i = 1, numbytes do
        result = result .. chr(value % 256)
        value = math.floor(value / 256)
    end
    return result
end

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

-- create a minimal dictionary with values for a Windows Version 3 DIB header:
local d = {
    mn1=66,
    mn2=77,
    filesize=0,
    undef1=0,
    undef2=0,
    offset=54,
    headerlength=40,
    width=wd,
    height=ht,
    colorplanes=1,
    colordepth=24,
    compression=0,
    imagesize=0,
    res_hor=0,
    res_vert=0,
    palette=0,
    importantcolors=0
}

-- we only need to create the header data once:
local header =
    lpack(1, d.mn1) ..
    lpack(1, d.mn2) ..
    lpack(4, d.filesize) ..
    lpack(2, d.undef1) ..
    lpack(2, d.undef2) ..
    lpack(4, d.offset) ..
    lpack(4, d.headerlength) ..
    lpack(4, d.width) ..
    lpack(4, d.height) ..
    lpack(2, d.colorplanes) ..
    lpack(2, d.colordepth) ..
    lpack(4, d.compression) ..
    lpack(4, d.imagesize) ..
    lpack(4, d.res_hor) ..
    lpack(4, d.res_vert) ..
    lpack(4, d.palette) ..
    lpack(4, d.importantcolors)

-- we may need to pad each row:
local row_mod = (d.width * d.colordepth / 8) % 4
local padding = ""
if row_mod > 0 then
    for i = 1, 4 - row_mod do
        padding = padding..chr(0)
    end
end

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

function CreateBMPFile(filename)
    -- create a BMP file showing the pattern in the current selection
    local outfile = io.open(filename,'wb')
    if not outfile then g.exit("Unable to create BMP file:\n"..filename) end

    -- write the header info
    outfile:write(header)

    -- write the byte data (BMPs are encoded left-to-right from the bottom-up)
    for row = ht, 1, -1 do
        for col = 1, wd do
            local state = getcell(x + col - 1, row + y - 1)
            if state == 0 then
                outfile:write(state0)
            else
                outfile:write(statebgr[state])
            end
        end
        if row_mod > 0 then
            -- add padding so the byte count for each row is divisible by 4
            outfile:write(padding)
        end
    end

    outfile:close()
end

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

-- remove any existing extension from layer name
local outname = gp.split(g.getname(),"%.")

-- prompt user for number of generations (= number of files)
local numgens = g.getstring("The number of generations will be\n" ..
                            "the number of .bmp files created.",
                            "100", "How many generations?")
if #numgens == 0 then
    g.exit()
end
if not gp.validint(numgens) then
    g.exit('Sorry, but "' .. numgens .. '" is not a valid integer.')
end

local numcreated = 0
local intgens = tonumber(numgens)
while intgens > 0 do
    local outfile = outname .. "_" .. g.getgen() .. ".bmp"
    g.show("Creating " .. outfile)
    CreateBMPFile(outfile)
    numcreated = numcreated + 1
    if intgens == 1 then break end
    g.run(1)
    g.update()
    intgens = intgens - 1
end
g.show("Number of .bmp files created: " .. numcreated)
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife and SpectreLife
User avatar
muzik
Posts: 6605
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Golly 5.0 is coming

Post by muzik »

Here's a rule table I posted about a year ago:
muzik wrote: August 29th, 2024, 7:43 amLifeViewer does not appear to accept this as a valid rule table, even though Golly does:

Code: Select all

x = 3, y = 3, rule = iwanttoconvertthis
2o$obo$b2o!
@RULE iwanttoconvertthis
@TABLE

n_states:2
neighborhood:Moore
symmetries:none

0100111101
0001100001
1100111000
1100001100
1100011100
1001010000
0100101011
1001000110
1101111000
1101010110
1000100000
0100111011
1110111100
0001000111
0011111101
1111110100
0111111001
0101010001
1001000100
1000001100
0100001101
1110001100
0101010001
0011110001
1011010000
0010100001
1101111100
0000011001
1011101000
0110011001
0110010001
1111010000
0111110101
0000001001
1111011000
0011110101
1100011010
1010110000
1010010000
00000000001
0011111101
0100000001
1000000000
0001001101
0011100001
0010011001
1100000000
1101010000
0000001001
Would it be a good idea to have the ruletable parser in Golly reject this on the basis that there is a table line which is one character too long as LifeViewer does, to enforce proper rule formatting and consistent definition across programs?
Parity Replicator Collection v1.6 is now live - please send all relevant discoveries here.
User avatar
Andrew
Moderator
Posts: 1064
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 5.0 is coming

Post by Andrew »

muzik wrote: September 4th, 2025, 2:55 pm Would it be a good idea to have the ruletable parser in Golly reject this on the basis that there is a table line which is one character too long as LifeViewer does, to enforce proper rule formatting and consistent definition across programs?
Making that change might break some Golly users rule files. I'm guessing the parsing code (written by Tim Hutton) ignores extra characters on a transition line to allow for comments. Tim's docs say that such comments should be preceded by a # but maybe he relaxed that at some point. Probably better if LifeViewer also ignored any extra characters.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife and SpectreLife
User avatar
islptng
Posts: 496
Joined: May 24th, 2024, 6:17 am
Location: 种花家

Re: Golly 5.0 is coming

Post by islptng »

Is it available now?

By the way, crossposting:
islptng wrote: October 2nd, 2024, 10:13 am
islptng wrote: September 30th, 2024, 4:32 am I suggest dots to be replaced with hyphen, while I was planning a project, hacking Golly to make it support some rule like B3/S23|B38/S238 and Rychládrát. In my hacking project, the dots are used in some special cases.
I found I could not do that though Golly is open-sourced :(
Then I'll post here to tell the developers to do that for me.

My thought:
Add a new system, separated from the "algorithms", called "Rule Controls".
There are 3: "Stable", "Cyclic" and "CtrlLoader".
"Stable" just acts as Golly 4.3 works now;
"Cyclic" for some rule that switches(i.e. rulestrings with "|");
and finally, "CtrlLoader", loads from ".ctrl" file in a folder called "Controls".
a ".ctrl" file look likes (take that for example):

Code: Select all

@CTRL Rychladrat
Describe. It maybe no longer supports something like á, so use a instead.
@PART SignalPropagate
@TABLE
n_states: xx
neighborhood: xx
symmetries: xx
x,x,x,x,x,x,x,x,x,x # Yes, just normal .rule format

@PART GateCompute
@TABLE ...

@CONNECT
SignalPropagate RunUntilNoChange
GateCompute RunForGen 1
And an rle could be

Code: Select all

+ x = *, y = *, rule = Rychladrat, part = SignalPropagate
xxxxxxxxxx!
Also,
PLEASE! HEXAGONAL ISOTROPIC NOTATION SUPPORTION!
PLEASE! RULELOADER CUSTOM & RANGE 1-5 NEIGHBORHOOD SUPPORTION!
My sandbox | All my engineered replicators | BsKngt | TNT
Asperger, ISTP, using a Dvorak keyboard.

I love my new school life.
User avatar
dvgrn
Moderator
Posts: 12046
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Golly 5.0 is coming

Post by dvgrn »

I see from a recent checkin that a Golly 5.0 beta build is in the works.

I'm still too short on time to pay proper attention to pattern checkins for the upcoming release -- recently I've been traveling more weekends than not, to work on property maintenance and cleanup because of family medical issues, in three different U.S. states not particularly close to each other.

It seems like it might be possible to recruit one or more new people to wear the Pattern Collector's Hat, though.

For starters, what is a likely target date for pattern checkins and corrections, to get them in safely ahead of the Golly 5.0 beta 1 build?
User avatar
Andrew
Moderator
Posts: 1064
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 5.0 is coming

Post by Andrew »

dvgrn wrote: September 25th, 2025, 7:00 am For starters, what is a likely target date for pattern checkins and corrections, to get them in safely ahead of the Golly 5.0 beta 1 build?
Sorry Dave but pattern changes will have to wait for the final 5.0 release (or maybe a 5.0b2 release if there are any dramatic changes to 5.0b1 that need testing).
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife and SpectreLife
User avatar
muzik
Posts: 6605
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Golly 5.0 is coming

Post by muzik »

Should it be mentioned somewhere that specifying a bounded grid with only one value will result in it being corrected to a square with both values specified? According to this there is no mention of it in the help documents.
Parity Replicator Collection v1.6 is now live - please send all relevant discoveries here.
User avatar
Andrew
Moderator
Posts: 1064
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 5.0 is coming

Post by Andrew »

muzik wrote: September 30th, 2025, 9:10 am Should it be mentioned somewhere that specifying a bounded grid with only one value will result in it being corrected to a square with both values specified? According to this there is no mention of it in the help documents.
Thanks -- I've just committed some changes to clarify this.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife and SpectreLife
User avatar
The loafer
Posts: 8
Joined: October 18th, 2024, 5:15 am

Re: Golly 5.0 is coming

Post by The loafer »

I’m late, but happy 20th anniversary to golly :D
I was very interested in finding discoveries inside rules
Thanks to golly for making me very happy :)
Post Reply