ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

Golly 2.9b1 and the overlay

For general discussion about Conway's Game of Life.

Re: Golly 2.9b1 and the overlay

Postby Andrew » June 17th, 2017, 10:52 pm

dvgrn wrote:Is it possible that the newer Lua object files are for some reason not cleaned out reliably by nmake...clean?

Not according to tests on my Win7 system. The makefile-win file should have these lines (with tabs, not spaces, at the start of each -if line):
clean:
   -if exist $(OBJDIR)\*.obj del $(OBJDIR)\*.obj
   -if exist *.res del *.res
   -if exist $(EXEDIR)\Golly.exe del $(EXEDIR)\Golly.exe
   -if exist $(EXEDIR)\bgolly.exe del $(EXEDIR)\bgolly.exe
   -if exist $(EXEDIR)\RuleTableToTree.exe del $(EXEDIR)\RuleTableToTree.exe
   -if exist golly.pdb del golly.pdb
   -if exist $(LUADIR)\*.obj del $(LUADIR)\*.obj

The bottom line correctly deletes all the .obj files in the lua directory, at least on my Win7 system.

I'm not surprised to hear that your 64-bit bgolly build runs ok. It doesn't have any wxWidgets or Python or Lua code. To successfully build a 64-bit Golly and a 32-bit Golly on the one machine I think you need to have the following:

- Two separate wxWidgets directories.
- Two separate Python directories.
- Two separate golly directories.

Your local-win.mk file needs to be different in each golly/gui-wx directory:

WX_DIR must point to the correct wxWidgets directory.
WX_RELEASE must match the correct wxWidgets version.
PYTHON_INCLUDE must point to the correct Python include directory.
LUA_DEFS should contain -DLUA_32BITS *only* for the 32-bit build.
User avatar
Andrew
Moderator
 
Posts: 752
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia

Re: Golly 2.9b1 and the overlay

Postby Saka » June 24th, 2017, 12:11 am

Andrew, are you planning to do Larger Than Life rules available in the next Golly update? What about actual support for Margolus (Without that weird checkerboard)? Are the unsupported neighborhoods in the RoadMap going to be supported in the next version? When are you going to release it? Sorry if that's too many questions...
If you're the person that uploaded to Sakagolue illegally, please PM me.
x = 17, y = 10, rule = B3/S23
b2ob2obo5b2o$11b4obo$2bob3o2bo2b3o$bo3b2o4b2o$o2bo2bob2o3b4o$bob2obo5b
o2b2o$2b2o4bobo2b3o$bo3b5ob2obobo$2bo5bob2o$4bob2o2bobobo!

(Check gen 2)
User avatar
Saka
 
Posts: 3074
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

Re: Golly 2.9b1 and the overlay

Postby Andrew » June 24th, 2017, 1:27 am

Saka wrote:Andrew, are you planning to do Larger Than Life rules available in the next Golly update?

Yes.

What about actual support for Margolus (Without that weird checkerboard)?

No.

Are the unsupported neighborhoods in the RoadMap going to be supported in the next version?

No.

When are you going to release it?

Hopefully some time next week.
User avatar
Andrew
Moderator
 
Posts: 752
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia

Re: Golly 2.9b1 and the overlay

Postby Saka » June 24th, 2017, 1:46 am

Andrew wrote:
Saka wrote:Andrew, are you planning to do Larger Than Life rules available in the next Golly update?

Yes.

What about actual support for Margolus (Without that weird checkerboard)?

No.

Are the unsupported neighborhoods in the RoadMap going to be supported in the next version?

No.

When are you going to release it?

Hopefully some time next week.

Ok. So why are those unsupported neighborhoods in the roadmap anyway?
If you're the person that uploaded to Sakagolue illegally, please PM me.
x = 17, y = 10, rule = B3/S23
b2ob2obo5b2o$11b4obo$2bob3o2bo2b3o$bo3b2o4b2o$o2bo2bob2o3b4o$bob2obo5b
o2b2o$2b2o4bobo2b3o$bo3b5ob2obobo$2bo5bob2o$4bob2o2bobobo!

(Check gen 2)
User avatar
Saka
 
Posts: 3074
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

Re: Golly 2.9b1 and the overlay

Postby Andrew » June 24th, 2017, 4:41 am

Saka wrote:So why are those unsupported neighborhoods in the roadmap anyway?

You'd have to ask the author (Tim Hutton), but why shouldn't they be there? The first paragraph says:

"here's a sketch of how the rule table format might be extended to support future CA"

Note the "might".
User avatar
Andrew
Moderator
 
Posts: 752
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia

Re: Golly 2.9b1 and the overlay

Postby rowett » June 24th, 2017, 3:44 pm

rowett wrote:In either case 2048 is bigger than the supported maximum texture size of 1024 on your driver so you'll get unwanted behaviour. I'm working on this now.

Dave I've checked in a change to use tiled rendering when the requested texture is bigger than your driver's maximum texture size. Please let me know if it helps.

EDIT: I've checked in further changes so please test with the latest commit 4135bc.
User avatar
rowett
Moderator
 
Posts: 1521
Joined: January 31st, 2013, 2:34 am
Location: UK

Re: Golly 2.9b1 and the overlay

Postby gmc_nxtman » June 25th, 2017, 5:12 pm

Unrelated to the overlay, would it be possible to add diagonal selections? As in, the red celled area is selected when selecting from one of the white cells to the other:

Screen Shot 2017-06-25 at 10.38.59 PM.png
Screen Shot 2017-06-25 at 10.38.59 PM.png (9.9 KiB) Viewed 6482 times


I think it would be a nice feature when working with boustrophedonic or diagonal constructions.
User avatar
gmc_nxtman
 
Posts: 1147
Joined: May 26th, 2015, 7:20 pm

Re: Golly 2.9b1 and the overlay

Postby Andrew » June 26th, 2017, 3:21 am

gmc_nxtman wrote:Unrelated to the overlay, would it be possible to add diagonal selections?

I'm highly unlikely to add that via C++ code. One of the primary reasons for implementing the overlay was to make it easy for people to extend Golly's interface in lots of interesting ways. Adding support for diagonal selections would be an excellent project for someone wanting to learn Lua and the wonders of the overlay.
User avatar
Andrew
Moderator
 
Posts: 752
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia

Re: Golly 2.9b1 and the overlay

Postby biggiemac » June 26th, 2017, 4:12 am

And then someone doing so could also be free to define non-diagonal oblique selections, perhaps with slope 45/19 along the sides. I might need to invest some time with Lua.
Physics: sophistication from simplicity.
User avatar
biggiemac
 
Posts: 504
Joined: September 17th, 2014, 12:21 am
Location: California, USA

Re: Golly 2.9b1 and the overlay

Postby gameoflifemaniac » July 4th, 2017, 5:09 am

I have an idea for Golly 2.9/3.0. My idea are Golly accounts and a Cloud. When someone saves like 200 patterns in Golly and accidentally lost all his saved files, he could save it in a Cloud before and then load the clouddata to his computer. Is it a good idea or useless?
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 762
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Golly 2.9b1 and the overlay

Postby gmc_nxtman » July 4th, 2017, 12:49 pm

I don't think this really needs to be a specific feature for golly, as you can simply use a computer backup service, and store all of your files in a cloud.
User avatar
gmc_nxtman
 
Posts: 1147
Joined: May 26th, 2015, 7:20 pm

Re: Golly 2.9b1 and the overlay

Postby simsim314 » February 27th, 2019, 4:13 pm

Hey I was playing with the overlay and it works fine for me in general, and great job! This is very nice viewer in its own right.

I've found a small issue I couldn't fix: when I change button label, it appears to be not updating after single click - and I couldn't find a way to update a button. I feel also that button API is not so well documented as one might hope, there is a lot of functionality in 3d.lua but you actually need to dig and it's not documented anywhere in the site.

Here is my result - I feel the GUI needs some more documentation work or minimalistic examples at least. Bars, menus, buttons etc. are not that well documented yet, with all their capacity. My sample show some of the functionality I could dig from the 3d.lua, I just wanted an overlay with play/pause and exit buttons.

local g = golly()
local gp = require "gplus"
local op = require "oplus"
local ov = g.overlay
local ovt = g.ovtable
local owd, oht = g.getview(g.getlayer())
local bgcolor = "rgba 255 255 255 "
SELSTOP_COLOR = "rgba 50 50 50 255"

local function do_line()
    op.fill_ellipse(200, 450, 140, 99, 2, "rgba 255 255 0 200")
   sbutt.setlabel("Stop")
   g.update()
end

local function do_line2()
    op.fill_ellipse(200, 450, 140, 99, 2, "rgba 255 255 0 200")
   g.update()
end

local function create_overlay()
    -- create overlay in middle of current layer
    ov("create "..owd.." "..oht)
   
   sbutt = op.button("Run", do_line)
   pbutt = op.button("Pause", do_line)
    cbutt = op.button("Exit", g.exit)
   
   pbutt.enable(false)
   pbutt.customcolor = SELSTOP_COLOR
   
    controlht = 20 + sbutt.ht
end

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

local function draw_controls()
    ov(bgcolor..255)
    ovt{"fill", 0, (oht-controlht), owd, controlht}

    local butY = oht-sbutt.ht-10
   
   sbutt.show(10, butY)
   pbutt.show(sbutt.x + sbutt.wd + 10, butY)
   cbutt.show(pbutt.x + pbutt.wd + 10, butY)

    ov(bgcolor..255)
    ovt{"fill", 0, 0, owd, (oht-controlht)}
   
end

function main()

    create_overlay()
    draw_controls()

   g.update()
    while true do
        local event = op.process( g.getevent() )
         if #event > 0 then
            g.doevent(event)
        end
    end
end

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

local _, err = xpcall(main, gp.trace)
if err then g.continue(err) end
-- the following code is always executed
ov("delete")



I also feel I can use it for my purposes now, after learning curve of 1.5hr which is reasonable time to learn the basics of a library. So I'm generally pleased. If you want to see my learning curve, and what I miss as a "power user" you can watch it here.
User avatar
simsim314
 
Posts: 1694
Joined: February 10th, 2014, 1:27 pm

Re: Golly 2.9b1 and the overlay

Postby dvgrn » February 27th, 2019, 4:51 pm

simsim314 wrote:Here is my result - I feel the GUI needs some more documentation work or minimalistic examples at least. Bars, menus, buttons etc. are not that well documented yet, with all their capacity. My sample show some of the functionality I could dig from the 3d.lua, I just wanted an overlay with play/pause and exit buttons.

Just to check -- did you find overlay-demo.lua? That's supposed to have the simplest sample code for most of the functionality. I didn't check your whole video, but only saw 3d.lua open.

Maybe overlay-demo.lua should be listed first in the list of scripts in overlay Help, with some notes to push people more in that direction.
User avatar
dvgrn
Moderator
 
Posts: 5742
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI

Re: Golly 2.9b1 and the overlay

Postby simsim314 » February 27th, 2019, 6:09 pm

dvgrn wrote:Just to check -- did you find overlay-demo.lua?


No - I was reading on the site and it refered to the 3d not to the demo. I checked out the demo only after finding this thread. The demo is still not UI oriented. I think we should have something similiar to the demo for all the buttons menus and options, like enable, color, label etc properties for all the UI classes. I didn't find this anywhere else except 3d, with some searching effort inside the script. The documentation for button and simple examples for its advanced properties are lacking.
User avatar
simsim314
 
Posts: 1694
Joined: February 10th, 2014, 1:27 pm

Re: Golly 2.9b1 and the overlay

Postby Andrew » February 28th, 2019, 12:14 pm

simsim314 wrote:I've found a small issue I couldn't fix: when I change button label, it appears to be not updating after single click - and I couldn't find a way to update a button.

Just replace the g.update() call with sbutt.refresh():
    sbutt.setlabel("Stop")
    sbutt.refresh()  -- redraws button and calls g.update()

I feel also that button API is not so well documented as one might hope

Sorry about that. There is some documentation in Help > Overlay > The oplus package, but not all functions are mentioned. Best to click on the link there that opens Scripts/Lua/oplus/init.lua in your preferred text editor and look at the various button functions (search for "function m.button").
User avatar
Andrew
Moderator
 
Posts: 752
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia

Re: Golly 2.9b1 and the overlay

Postby simsim314 » March 1st, 2019, 9:54 am

Andrew wrote: sbutt.refresh()


Many thanks!

Andrew wrote: Scripts/Lua/oplus/init.lua


Many thanks again! This will work for me. I would like to help to provide more documentation and examples, as I go along with CA studio. The drawing/text examples themselves are well documented and explained and there are plenty of them, only the oplus is not explained well but the code is very nice and readable so I can help with the documentation.

For example you write "see init.lua for the implementation details" - but I don't care about implementation. I want to know all the properties and functions. If even you would write - more details and functionality is in init.lua or something along those lines, that it's clearly not about how you implemented the oplus package but as an advanced reference, I would know to check it out. This sounds obvious to you, but to me having 0.1 sec. to think about it, never occured to look at the source, as it many times very complex and not readable, and only used by developers of the package. I was going into many places but not this. So many thanks once again.
User avatar
simsim314
 
Posts: 1694
Joined: February 10th, 2014, 1:27 pm

Re: Golly 2.9b1 and the overlay

Postby simsim314 » June 9th, 2019, 6:01 am

Is there a way to natively let the user to fill a textbox, or should I have a button and use g.getstring - and only present the user what he filled?
User avatar
simsim314
 
Posts: 1694
Joined: February 10th, 2014, 1:27 pm

Re: Golly 2.9b1 and the overlay

Postby Andrew » June 9th, 2019, 9:47 pm

simsim314 wrote:Is there a way to natively let the user to fill a textbox, or should I have a button and use g.getstring - and only present the user what he filled?

g.getstring is the only way at the moment. The oplus module might one day provide a textbox control, but it won't be native.
User avatar
Andrew
Moderator
 
Posts: 752
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests