Life tag testing

For scripts to aid with computation or simulation in cellular automata.
Locked
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 143 continues the implementation of the Waypoint system.
  • [[ GPS ]] and [[ THEME ]] can now be specified at each waypoint
  • playback continues after the last defined waypoint at the current gps
  • pan, zoom, angle, layer, depth, theme and gps controls are locked (greyed out) during waypoint playback
Updated example pattern using waypoints is here:
http://lazyslug.no-ip.biz/lifeview/plugin/test.html

Here are the waypoint instructions from the example (without pattern):

Code: Select all

#C [[ GPS 60 THEME 2 LAYERS 2 DEPTH 0.4
#C T 0 X 48 Y -58 ZOOM 12
#C PAUSE 1 "3..."
#C PAUSE 1 "2..."
#C PAUSE 1 "1..."
#C PAUSE 1 "Go!"
#C T 140 X 80 Y -94 ZOOM 20
#C T 310 X 120 Y -52 ZOOM 16 ANGLE 45
#C T 360 X 130 Y -65 ZOOM 10 ANGLE 90
#C PAUSE 2 "Dramatic pause"
#C T 480 THEME 3 DEPTH 5 LAYERS 6 GPS 15 X 110 Y -95 ANGLE 0 ZOOM 15 "Slow motion"
#C T 610 THEME 1 DEPTH 0.4 GPS 30 X 75 Y -50
#C T 675 THEME 4 GPS 60 LAYERS 2 X 106 Y -50 ZOOM 10
#C T 858 X 140 Y 0 ZOOM 8
#C PAUSE 5 X 0 Y -5 ZOOM 1.5 DEPTH 0 "Show me the world..."
#C PAUSE 0.1 THEME 5 "That's all folks!"
#C LOOP 1300 ]]
This build is probably good enough to deploy but I'll defer to Dave's testing...
User avatar
dvgrn
Moderator
Posts: 11980
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Build 143 continues the implementation of the Waypoint system.
...
This one is probably good enough to deploy but I'll defer to Dave's testing...
Looks good to me! I'm traveling this week and don't have a lot of time to do my own experiments, unfortunately. The example on the test page goes through a lot of the transitions, and they all seem to work as advertised.

I did wonder about interpolating GPS settings to get a gradual increase or decrease in speed, along the same lines as all the other gradual changes.

When playback is happening, the mousewheel causes jitters in the display. Might be better to have the mousewheel either work or not work... it would be kind of nice if it worked, actually, so that people could see what they wanted to see, but after X seconds of no mousewheel activity (or arrows, etc?) the waypoint playback would start interpolating its way back to where the settings were supposed to be.

I don't see a way to re-play a pattern from the beginning without the waypoint lockdown and messages showing up again and so forth. I can control the pattern after the waypoint playback lets go of it, which would be good enough for something like the p59 gun but annoying for a pattern that's supposed to only run once.

I did manage to cancel the LOOP part of the waypoint playback, and just keep the gun running indefinitely at the end, but the system stayed locked down. Should ESC cancel the waypoint playback, and just leave settings as they are at that moment?

Pushing the Reset button might go back to the waypoint settings as they are at T=0 -- but I would say that playback shouldn't start over again when the user presses Play. After the initial show, it seems to me that the viewer can go back to being a normal viewer until the page is refreshed. A hotkey to restart the waypoint playback would be fine, too, of course, but maybe not necessary.

I wonder if there's a use case for something like AUTOFIT, to zoom automatically to the current bounds of the pattern? I guess that would only make sense during a PAUSE, since otherwise the viewer won't know ahead of time what the bounds will be.

Haven't tried combining the waypoint system with a STEP setting yet. Is there any possibility of building in interpolation there as well? I don't think there's a big use case for that, or for interpolated GPS settings, necessarily, so "No" is probably the most reasonable answer...!

Other than that, the only detail I noticed on this trip through the plugin test page was the "Script error handling" viewer, which is showing up in VIEWONLY mode. Presumably that's because the "b368/s245" rule spec is in lowercase, but there doesn't seem to be any error message saying why the viewer is stuck in VIEWONLY. Maybe when [[ VIEWONLY ]] isn't specified in the script, that should count as an error, so that there's a line saying why the controls don't work.
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:Other than that, the only detail I noticed on this trip through the plugin test page was the "Script error handling" viewer, which is showing up in VIEWONLY mode. Presumably that's because the "b368/s245" rule spec is in lowercase, but there doesn't seem to be any error message saying why the viewer is stuck in VIEWONLY. Maybe when [[ VIEWONLY ]] isn't specified in the script, that should count as an error, so that there's a line saying why the controls don't work.
The Viewer is happy with rule specs in lowercase ("b368/s245"). The reason this one is in VIEWONLY is because it is specified in the script commands.

Code: Select all

#C Playback disabled [[ AUTOSTART LOOP 100 STOP 100 VIEWONLY ]]
Having said that I currently silently ignore missing VIEWONLY directives for non-executable rules. If you prefer that to be an error I'm happy to change it.
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:I did wonder about interpolating GPS settings to get a gradual increase or decrease in speed, along the same lines as all the other gradual changes.
This is possible but I'd have to do some Math...
dvgrn wrote:When playback is happening, the mousewheel causes jitters in the display. Might be better to have the mousewheel either work or not work... it would be kind of nice if it worked, actually, so that people could see what they wanted to see, but after X seconds of no mousewheel activity (or arrows, etc?) the waypoint playback would start interpolating its way back to where the settings were supposed to be.
Having played with this for a bit I've currently settled on the following:
  • Controls are locked during waypoint playback
  • Controls are automatically unlocked once the final waypoint is reached
  • Controls are temporarily unlocked while playback paused, once unpaused play snaps back to where it should be based on the waypoint definitions
dvgrn wrote:I don't see a way to re-play a pattern from the beginning without the waypoint lockdown and messages showing up again and so forth. I can control the pattern after the waypoint playback lets go of it, which would be good enough for something like the p59 gun but annoying for a pattern that's supposed to only run once.
Perhaps we could use the two stage reset here? Reset once which sets T=0 and disables waypoint mode. Reset again at T=0 and waypoint mode re-enabled.
dvgrn wrote:I did manage to cancel the LOOP part of the waypoint playback
This is existing behaviour. If you pause during playback then any pending LOOP is ignored until the next reset.
dvgrn wrote:Should ESC cancel the waypoint playback, and just leave settings as they are at that moment?
Perhaps hotkey "W" to toggle waypoint mode on/off?
dvgrn wrote:Pushing the Reset button might go back to the waypoint settings as they are at T=0 -- but I would say that playback shouldn't start over again when the user presses Play.
Agreed, based on the two stage reset proposal above.
dvgrn wrote:I wonder if there's a use case for something like AUTOFIT, to zoom automatically to the current bounds of the pattern? I guess that would only make sense during a PAUSE, since otherwise the viewer won't know ahead of time what the bounds will be.
No need now, since once paused the new version unlocks the controls, so you can just use hotkey "F" to fit to zoom.
User avatar
dvgrn
Moderator
Posts: 11980
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:
dvgrn wrote:I wonder if there's a use case for something like AUTOFIT, to zoom automatically to the current bounds of the pattern? I guess that would only make sense during a PAUSE, since otherwise the viewer won't know ahead of time what the bounds will be.
No need now, since once paused the new version unlocks the controls, so you can just use hotkey "F" to fit to zoom.
Well, but I meant a [[ PAUSE ]], not just a pause using the Pause button. The suggestion was an AUTOFIT script command that would set a waypoint to whatever the current pattern's best zoom and center values are, or something like that. Just a convenience, really, to avoid having to look up the actual X, Y, and ZOOM values -- so definitely not a very high priority.

The two-stage reset idea makes sense to me. 'W' might be fine as a waypoint on/off toggle. I'd kind of like to see ESC work to cancel playback, too, though -- that's my instinct for when I want to go look at something and the current playback is getting in my way.
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:Well, but I meant a [[ PAUSE ]], not just a pause using the Pause button. The suggestion was an AUTOFIT script command that would set a waypoint to whatever the current pattern's best zoom and center values are, or something like that. Just a convenience, really, to avoid having to look up the actual X, Y, and ZOOM values -- so definitely not a very high priority..
OK that should be straightforward. Note that [[ AUTOFIT ]] would be the target for the [[ PAUSE ]] waypoint. So the effect would be to interpolate from current camera state to the best zoom and center values over the duration of the [[ PAUSE ]].
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 144 is available on the lazyslug server and continues the Waypoint system implementation.
  • controls are unlocked after the final waypoint is reached
  • controls are temporarily unlocked when waypoint playback is paused
    • if the camera is moved and then playback is resumed the camera will glide to the correct waypoint position
  • if waypoints are available then waypoint playback will be disabled on reset
    • reset again while at T=0 to re-enable
  • hotkey "Esc" will pause playback and if already paused will disable waypoint playback
  • hotkey "W" will toggle waypoint playback
    • if waypoint playback is disabled and then enabled the camera will glide to the correct waypoint position
  • angle interpolation now takes the shortest path (e.g. 350 degrees to 10 degrees)
  • added waypoint details to help information
    • whether waypoint playback is enabled
    • number of waypoints
    • list of waypoint definitions with current waypoint marked
  • added loop details to help information
    • whether loop is enabled
    • loop generation
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

rowett wrote:Build 144 is available on the lazyslug server
Nathaniel please will you upload this build when you get a moment.

Many thanks,
Chris
User avatar
Nathaniel
Site Admin
Posts: 903
Joined: December 10th, 2008, 3:48 pm
Location: New Brunswick, Canada
Contact:

Re: Life tag testing

Post by Nathaniel »

rowett wrote:Nathaniel please will you upload this build when you get a moment.
Done, thanks for the update!
User avatar
dvgrn
Moderator
Posts: 11980
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Build 144 is available on the lazyslug server and continues the Waypoint system implementation.
I've been traveling for the last couple of days, and only just got a chance to do a quick trial animation with the waypoint system. Good Golly, it's looking really nice! Not that I didn't find any bugs, of course... but it really is a usable system already.

In fact, it's downright awesome -- not a word I use very much, but it seems justified here.

The first item that showed up was that if there's an initial PAUSE and a message, you have to know not to move the mouse over the viewer window. Otherwise the message gets erased prematurely by the "Click to control" text.

I wondered if it might be possible to include line breaks -- "\n", maybe? -- in message text. Tried a line for the initial message that was too long, but two lines would be fine.

Then I was hoping that STEP changes would work in waypoints, but it doesn't seem to. (Yet?)

-- Oh, and have a look at what happens when you leave out the initial "X 0 Y 0", which I was thinking would be the default. And in fact it is the default as long as I haven't defined any waypoints, I think. But when waypoints are defined, the default coordinates seem to be (512, 512).

Not sure I quite understand Reset behavior. Once the viewer is waypointing, the first click on Reset brings the generation count back to zero, and you can do your own exploring -- good. Second click on Reset restarts the waypoint-showing -- good. Third click on Reset starts the pattern running for some reason, but not in waypoint mode...?

If instead of all the waypoints I just put in just #C [[ STEP 20 ]] as the first line, maybe with [[ AUTOSTART ]], then suppose someone decides they want to reset the pattern and go through it at a step size of 1 -- well, how do they do that? Seems like right now, unless they are able to edit the comments, they're stuck at STEP 20.

Speaking of which, when I put in just [[ STEP 20 ]] as the first line -- without the #C -- I get a blank pattern but no error message. Usually it seems as if there's an "invalid pattern" error message, but not in this case...?

High STEP sizes, not surprisingly, seem to bog down the viewer quite a bit, usually just because of an oversight on my part -- I should set a STOP or a LOOP of an appropriate size, but I don't, or it doesn't get triggered. So the gun-or-whatever just keeps getting boringly bigger off-screen, using more CPU and memory and slowing everything else down.

See the pattern on this page, for example. Sometimes when I click to open it in a separate window, the LOOP 1864 doesn't take effect for some reason, and viewer memory gradually gets filled up with inconsequential gliders so the viewer runs slower and slower.

I wondered if it might make sense to set a reasonable default -- keep patterns inside 1024^2 with an automatically generated STOP or LOOP, let's say, unless there are specific comments with bigger generation numbers, to tell the viewer to run farther.

Keep the cheer,


Dave
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:In fact, it's downright awesome -- not a word I use very much, but it seems justified here.
Thanks, it's been a lot of fun. And even better when it turns out to actually be useful :)
dvgrn wrote:The first item that showed up was that if there's an initial PAUSE and a message, you have to know not to move the mouse over the viewer window. Otherwise the message gets erased prematurely by the "Click to control" text.
The waypoint messages and system messages are now shown on separate lines and so no longer interfere.
dvgrn wrote:I wondered if it might be possible to include line breaks -- "\n", maybe? -- in message text. Tried a line for the initial message that was too long, but two lines would be fine.
Yes, done, two lines are allowed [[ "This is a\ntwo line message" ]]
dvgrn wrote:Then I was hoping that STEP changes would work in waypoints, but it doesn't seem to. (Yet?)
It does now.
dvgrn wrote:Oh, and have a look at what happens when you leave out the initial "X 0 Y 0", which I was thinking would be the default. And in fact it is the default as long as I haven't defined any waypoints, I think. But when waypoints are defined, the default coordinates seem to be (512, 512).
Fixed.
dvgrn wrote:Not sure I quite understand Reset behavior. Once the viewer is waypointing, the first click on Reset brings the generation count back to zero, and you can do your own exploring -- good. Second click on Reset restarts the waypoint-showing -- good. Third click on Reset starts the pattern running for some reason, but not in waypoint mode...?
Fixed. Third click no longer misbehaves.
dvgrn wrote:If instead of all the waypoints I just put in just #C [[ STEP 20 ]] as the first line, maybe with [[ AUTOSTART ]], then suppose someone decides they want to reset the pattern and go through it at a step size of 1 -- well, how do they do that? Seems like right now, unless they are able to edit the comments, they're stuck at STEP 20.
True. I haven't yet provided a UI or keyboard shortcuts to control STEP, mainly because I haven't decided the best way to do so. I don't want to clutter the UI and I'm not sure if I want to combine it with the gps slider. I've seen how Golly does it but the way it works in the Viewer is that STEP is independent of gps. So you could have a step of 20 but a gps of 1 and every second the Viewer would move on 20 generations.
dvgrn wrote:Speaking of which, when I put in just [[ STEP 20 ]] as the first line -- without the #C -- I get a blank pattern but no error message. Usually it seems as if there's an "invalid pattern" error message, but not in this case...?
I can't reproduce this. Do you have a failure I could look at?
dvgrn wrote:High STEP sizes, not surprisingly, seem to bog down the viewer quite a bit, usually just because of an oversight on my part -- I should set a STOP or a LOOP of an appropriate size, but I don't, or it doesn't get triggered. So the gun-or-whatever just keeps getting boringly bigger off-screen, using more CPU and memory and slowing everything else down.
This will be greatly improved when I get time to complete my pending updates to the generation engine. At the moment it tracks the bounding box used by the pattern and only computes new cells within, and does similar for the colour history. The worst case for this approach being single gliders heading off in opposite directions which unfortunately occur fairly frequently.
The new version will independently track bounding boxes round each object. I'd half implemented it for the non-plugin-LifeViewer to allow smarter automatic camera following but then got sidetracked with the plugin.
dvgrn wrote:See the pattern on this page, for example. Sometimes when I click to open it in a separate window, the LOOP 1864 doesn't take effect for some reason
This was a bug, and now fixed. Closing and opening the standalone viewer wasn't resetting disabled LOOP after reset properly.

These changes are in Build 145 and you can see them at my standard test page:
http://lazyslug.no-ip.biz/lifeview/plugin/test.html
User avatar
dvgrn
Moderator
Posts: 11980
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

Code: Select all

[[ THUMBNAIL AUTOSTART ]]
#C Spartan 2G-to-H with a semi-Snark reset
x = 98, y = 156, rule = LifeHistory
.A58.A$2.A56.A$3A56.3A$9.A9.A$9.3A5.3A$12.A3.A$11.2A3.2A50.A$66.3A$
65.A$65.2A2$96.A$95.A.A$95.A.A$25.2A13.2A54.A$25.2A13.2A26.2A15.A$13.
2A53.2A15.A$12.A2.A69.3A$7.2A4.2A72.A$6.A.A$6.A$5.2A$15.2A$15.A62.2A$
16.3A60.A$18.A44.2A11.3A$63.2A11.A$22.2A$23.A$23.A.A23.2A$24.2A24.A$
47.3A$39.2A6.A$39.2A18.2A$59.A$60.3A$22.2A38.A$22.2A5.2A$29.2A2$35.A$
34.A.A$27.2A6.2A$28.A$25.3A$25.A65$.A58.A$2.A56.A$3A56.3A$9.A9.A$9.3A
5.3A$12.A3.A$11.2A3.2A50.A$66.3A$65.A$65.2A2$96.A$95.A.A$95.A.A$25.2A
13.2A54.A$25.2A13.2A26.2A15.A$13.2A53.2A15.A$12.A2.A69.3A$7.2A4.2A72.
A$6.A.A$6.A$5.2A$15.2A$15.A62.2A$16.3A60.A$18.A44.2A11.3A$63.2A11.A$
22.2A$23.A$23.A.A23.2A$24.2A24.A$47.3A$39.2A6.A$39.2A18.2A$59.A$30.2A
28.3A$22.2A6.2A30.A$22.2A3$35.A$34.A.A$27.2A6.2A$28.A$25.3A$25.A!
rowett wrote:
dvgrn wrote:Speaking of which, when I put in just [[ STEP 20 ]] as the first line -- without the #C -- I get a blank pattern but no error message. Usually it seems as if there's an "invalid pattern" error message, but not in this case...?
I can't reproduce this. Do you have a failure I could look at?
Ah, I figured out what I was seeing. Try quoting and then previewing this message. The odds are that the mouse will be over the viewer canvas when the viewer shows up, so the "Invalid pattern!" message is immediately replaced by "Click to control".

So it's the same problem as the initial PAUSE message, and almost certainly already fixed.

Here's an optional idea for a feature request that I forgot to mention: when the viewer is in LOOP mode, and maybe also when it's playing a series of waypoints, there don't seem to be any visual cues about how far along the loop/playback is. Would it be possible to add a vertical line in the Generation box in the lower left, similar to the bar in the GPS readout, that moves from left to right as the loop or playback proceeds?

I suppose this hypothetical line wouldn't be click-and-draggable like every other line in the viewer, so it's probably not a good idea as it stands. Maybe a faint status-bar-ish background fill in the Gen box instead? Just some way to get the message across that there's a sudden change in behavior coming after another X% of the total ticks are complete.
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:So it's the same problem as the initial PAUSE message, and almost certainly already fixed.
Yes, absolutely.
dvgrn wrote:Here's an optional idea for a feature request that I forgot to mention: when the viewer is in LOOP mode, and maybe also when it's playing a series of waypoints, there don't seem to be any visual cues about how far along the loop/playback is. Would it be possible to add a vertical line in the Generation box in the lower left, similar to the bar in the GPS readout, that moves from left to right as the loop or playback proceeds?
Done. There's now a progress bar in the Generation box which tracks the waypoint progress and/or LOOP progress. It disappears if there's no active waypoint playback or LOOP is disabled. I've also added extra text to the "Pause" and "Reset" message so it's explicit when LOOP gets disabled or enabled and the same for waypoint playback.

Unfortunately I'm travelling at the moment so this won't hit my test site until Thursday. Works great on my laptop though :wink:
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 145 is available on the lazyslug server.

Enhancements in this build:
  • user-defined waypoint messages and system messages are now displayed on separate lines
  • user-defined waypoint messages can now be two lines [[ "This is a\ntwo line message" ]]
    • messages with more than two lines are reported as errors
  • [[ STEP ]] command can now be used in waypoints
  • added a progress bar behind the Gen button when LOOP or waypoint playback enabled
  • the Pause and Reset messages now also say whether LOOP or waypoint playback have been enabled or disabled or if AUTOSTART is activated
Fixes in this build:
  • closing and opening the standalone viewer on the same pattern now correctly resets the looping and waypoint playback mode
  • fixed occasional strange behaviour on a third reset
  • startup time was being counted in the first waypoint
  • user-defined waypoint messages were not being cleared when waypoints were disabled
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 146 is available on the lazyslug server.

Enhancements in this build:
  • added a slider to control the STEP size
    • hotkey "D" to decrease and "E" to increase STEP size
  • valid patterns that are too big are now reported as "Pattern too big!" rather than "Invalid pattern!"
  • the "Gen" button is now labelled "T"
Fixes in this build:
  • opening a multi-state pattern in the standalone viewer after an executable pattern could cause the wrong colours to be used
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:If instead of all the waypoints I just put in just #C [[ STEP 20 ]] as the first line, maybe with [[ AUTOSTART ]], then suppose someone decides they want to reset the pattern and go through it at a step size of 1 -- well, how do they do that? Seems like right now, unless they are able to edit the comments, they're stuck at STEP 20.
Dave, let me know if the new STEP control UI works for you and if so Nathaniel please can you upload this build since it also contains some fixes.
User avatar
dvgrn
Moderator
Posts: 11980
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Dave, let me know if the new STEP control UI works for you and if so Nathaniel please can you upload this build since it also contains some fixes.
I've done at least a quick round of testing, and everything seems to work great so far. I'll try harder... but not for a few days, so this definitely seems like a good build to make available. Thanks!

EDIT: I put together a waypoint animation that seems to be mildly challenging for the current build of the viewer. On my system at least, the browser becomes temporarily somewhat unresponsive when I pause waypoint playback in the middle. When I hit the Play button again, playback is much less smooth. I'll check again when the new build is available on conwaylife.com.
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:EDIT: I put together a waypoint animation that seems to be mildly challenging for the current build of the viewer. On my system at least, the browser becomes temporarily somewhat unresponsive when I pause waypoint playback in the middle. When I hit the Play button again, playback is much less smooth. I'll check again when the new build is available on conwaylife.com.
Things to check:
  • Is the LifeViewer the only one playing on the page? Press hotkey 'Z' to force other Viewers to stop.
  • What's the performance of the current LifeViewer? Press hotkey 'T' to turn on timing display in the top right of the Viewer window. The important figures are "work" followed by "menu".
    • In order for smooth update the total needs to be less than 16ms per frame
    • "menu" should be relatively small (i.e. < 1.0ms)
    • "work" is how much time this Viewer needs to compute new generations, update the colour history, and render the display. On my laptop with your waypoint animation it peaks at about 6.0ms
  • If the total is > 16ms then the Viewer won't achieve 60 frames per second and it will start dropping frames and the display will look choppy
  • In waypoint mode the Viewer will auto-adjust the STEP to try to keep up and this can also result in the display looking choppy
When I complete the new generation engine the performance will improve for many, but not all, patterns.
User avatar
dvgrn
Moderator
Posts: 11980
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Things to check: ...
  • What's the performance of the current LifeViewer? Press hotkey 'T' to turn on timing display in the top right of the Viewer window. The important figures are "work" followed by "menu".
    • In order for smooth update the total needs to be less than 16ms per frame[./list]
My laptop is several years old, and can only manage work=12-15ms while running that animation. So in Build 146 I'm seeing frame rates hovering around 57-59fps, occasionally dropping down to 49 for a moment.

That's not the problem, though -- everything looks perfectly smooth as long as I just let the animation run, even if it's slightly slow. Here's how to make weird things happen:
  • Let the animation run for a short time (doesn't seem to matter).
  • Hit Pause.
  • Drag the pattern about one screen width with the mouse. Optionally mousewheel zoom a bit.
  • Hit Play again to continue the animation.
One thing that happens is maybe by design, but it's not what I expect: hitting Pause and then Play seems to cancel the LOOP setting but not the waypoint animation. Is there a way to tie those together, so that it's possible to pause and explore a pattern and then return to the normal animation behavior?

The other problem is that there are often several seconds as the viewpoint moves back to where it's supposed to be, where the work number goes steadily up: 32, then 276, then 1443 -- and then back suddenly to work=15ms again when the viewpoint gets back to normal. I know the viewer is capable of doing this zoom smoothly without breaking a sweat, but some big inefficiency seems to be creeping into the interpolation in this case.

Oddly enough, if you Pause, hit "F" to fit the whole pattern, and the Play, you don't see the problem. You also don't get a smooth zoom back to where the animation left off -- it just jumps instantly back to the correct point and continues from there. If you wait until the construction is almost done and then hit "F", you do see the choppiness.

Another issue:
I tried adding STEP 8 in -- not in the forum posting, since Build 144 doesn't handle steps mixed with waypoints very well, but with Build 146. Without waypoints the pattern runs very smoothly at STEP 8, but when an animation is running I get numbers like work=1907.

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

Here's a mostly unrelated item. The way the math works out, a linear interpolation between zoom levels tends to go through suboptimal intermediate views. For example:

Code: Select all

x = 826, y = 829, rule = B3/S23
2o2b3o$2o2bo$5bo14$30b3o$30bo$31bo34$32b3o$32bo$33bo14$70b3o$70bo$71bo
14$54b3o$54bo$55bo14$105b3o$105bo$106bo14$89b3o$89bo$90bo14$137b3o$
137bo$138bo14$118b3o$118bo$119bo14$177b3o$177bo$178bo14$142b3o$142bo$
143bo14$206b3o$206bo$207bo14$187b2o$186b2o$188bo14$235b2o$234b2o$236bo
19$207b3o$207bo$208bo9$268b3o$268bo$269bo9$256b3o$256bo$257bo19$298b3o
$298bo$299bo30$330b3o$330bo$331bo6$308b3o$308bo$309bo18$331b3o$331bo$
332bo2$363b2o$362b2o$364bo14$358b3o$358bo$359bo14$407b3o$407bo$408bo
14$391b3o$391bo$392bo14$424b2o$423b2o$425bo14$415b2o$414b2o$416bo14$
468b3o$468bo$469bo14$454b3o$454bo$455bo14$489b3o$489bo$490bo14$474b2o$
473b2o$475bo14$514b3o$514bo$515bo14$499b3o$499bo$500bo14$544b3o$544bo$
545bo14$543b3o$543bo$544bo14$593b3o$593bo$594bo26$598b3o$598bo$599bo2$
625b3o$625bo$626bo14$616b3o$616bo$617bo14$667b3o$667bo$668bo14$637b3o$
637bo$638bo14$669b3o$669bo$670bo14$669b3o$669bo$670bo14$704b3o$704bo$
705bo14$698b3o$698bo$699bo14$744b3o$744bo$745bo14$723b3o$723bo$724bo
14$764b3o$764bo$765bo14$763b3o$763bo$764bo36$823b3o$823bo$824bo!
[[ AUTOSTART X 0 Y 0 ZOOM .5 THEME 9 LOOP 3400 ]]
[[ PAUSE 5 "Zooming in starting at T=200..." ]]
[[ T 200 ]]
[[ T 3200 X -410 Y -410 ZOOM 12 ]]
In general, let's say we're zooming from Waypoint 1 (X1, Y1 @ Z1) to Waypoint 2 (X2, Y2 @ Z2). If (X2,Y2) is visible in the Waypoint 1 view, and obviously it will be in view at Waypoint 2, then is there a way to set up the interpolation so as not to lose sight of it so thoroughly in the middle? Is there a plausible formula that will keep the zoom level lower until right near the end?

Seems to me that a good default interpolation for the above case might be something closer to a continuous autofit. Maybe that could just be a script option? (I think I've mentioned something like this before, but maybe not very clearly.) It's surprisingly difficult to do a continuous autofit with the current system -- you'd need a lot of waypoints to smooth it out enough.

For this pattern, ten waypoints still make me a little queasy... not counting the sudden angle change at the end, which is maybe not such a good idea. As the animation runs you can see the construction area moving in different directions at different times. Gets worse toward the end, especially at T=2900:

Code: Select all

x = 826, y = 829, rule = B3/S23
2o2b3o$2o2bo$5bo14$30b3o$30bo$31bo34$32b3o$32bo$33bo14$70b3o$70bo$71bo
14$54b3o$54bo$55bo14$105b3o$105bo$106bo14$89b3o$89bo$90bo14$137b3o$
137bo$138bo14$118b3o$118bo$119bo14$177b3o$177bo$178bo14$142b3o$142bo$
143bo14$206b3o$206bo$207bo14$187b2o$186b2o$188bo14$235b2o$234b2o$236bo
19$207b3o$207bo$208bo9$268b3o$268bo$269bo9$256b3o$256bo$257bo19$298b3o
$298bo$299bo30$330b3o$330bo$331bo6$308b3o$308bo$309bo18$331b3o$331bo$
332bo2$363b2o$362b2o$364bo14$358b3o$358bo$359bo14$407b3o$407bo$408bo
14$391b3o$391bo$392bo14$424b2o$423b2o$425bo14$415b2o$414b2o$416bo14$
468b3o$468bo$469bo14$454b3o$454bo$455bo14$489b3o$489bo$490bo14$474b2o$
473b2o$475bo14$514b3o$514bo$515bo14$499b3o$499bo$500bo14$544b3o$544bo$
545bo14$543b3o$543bo$544bo14$593b3o$593bo$594bo26$598b3o$598bo$599bo2$
625b3o$625bo$626bo14$616b3o$616bo$617bo14$667b3o$667bo$668bo14$637b3o$
637bo$638bo14$669b3o$669bo$670bo14$669b3o$669bo$670bo14$704b3o$704bo$
705bo14$698b3o$698bo$699bo14$744b3o$744bo$745bo14$723b3o$723bo$724bo
14$764b3o$764bo$765bo14$763b3o$763bo$764bo36$823b3o$823bo$824bo!
[[ THUMBNAIL X 0 Y 0 ZOOM .5 THEME 9 LOOP 3500 ]]
[[ T 200 X -24 Y -24 ZOOM .5 ]]
[[ T 500 X -65 Y -65 ZOOM .52 ]]
[[ T 800 X -105 Y -105 ZOOM .54 ]]
[[ T 1100 X -145 Y -145 ZOOM .56 ]]
[[ T 1400 X -180 Y -180 ZOOM .66 ]]
[[ T 1700 X -220 Y -220 ZOOM .77 ]]
[[ T 2000 X -255 Y -255 ZOOM .92 ]]
[[ T 2300 X -300 Y -300 ZOOM 1.13 ]]
[[ T 2600 X -340 Y -340 ZOOM 1.55 ]]
[[ T 2900 X -375 Y -375 ZOOM 2.44 ]]
[[ T 3200 X -410 Y -410 ZOOM 5.5 ]]
[[ T 3400 ANGLE 270 ]]
The script numbers were picked by autofitting every 300 ticks. They're rounded off a little, and I might have made a copying error I suppose, but I think the effect is mainly due to the zoom interpolation.

There appears to be a hiccup in the HTML on your current test page, by the way -- the first pattern has eaten one of the following tests, which now show up as comments at the end of the too-big RLE due to a missing </textarea> tag.
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:Here's how to make weird things happen:
  • Let the animation run for a short time (doesn't seem to matter).
  • Hit Pause.
  • Drag the pattern about one screen width with the mouse. Optionally mousewheel zoom a bit.
  • Hit Play again to continue the animation.
OK I've figured out why it does this. There will be a fix in due course. It's a combination of the waypoint system inserting a temporary waypoint one second back in time to allow the course correction when you un-pause, and a bit of logic which tries to catch up when your machine isn't fast enough to keep it at the right generation at the expected time.
dvgrn wrote:One thing that happens is maybe by design, but it's not what I expect: hitting Pause and then Play seems to cancel the LOOP setting but not the waypoint animation. Is there a way to tie those together, so that it's possible to pause and explore a pattern and then return to the normal animation behavior?
Yes this is by design (or rather lack of better design). Originally pausing would immediately disable LOOP, but the waypoint system is only disabled on a Reset (which ironically would re-enable a disabled LOOP). I'll probably link the two when Waypoints are defined and leave the original behaviour when they're not.
The later builds notify you when stuff gets enabled or disabled so you can at least tell when it happens.
dvgrn wrote:The other problem is that there are often several seconds as the viewpoint moves back to where it's supposed to be, where the work number goes steadily up: 32, then 276, then 1443 -- and then back suddenly to work=15ms again when the viewpoint gets back to normal. I know the viewer is capable of doing this zoom smoothly without breaking a sweat, but some big inefficiency seems to be creeping into the interpolation in this case.
Yes this is the same problem as above.
dvgrn wrote:Another issue:
I tried adding STEP 8 in -- not in the forum posting, since Build 144 doesn't handle steps mixed with waypoints very well, but with Build 146. Without waypoints the pattern runs very smoothly at STEP 8, but when an animation is running I get numbers like work=1907.
Again, the same issue. The waypoint system is trying to catch up because your machine is not powerful enough to run in real time at STEP=8 and is raising the STEP to catch up (which it can't do, so gets further and further behind). With the waypoints off this logic doesn't run so it's happy to STEP at 8 and take as long as it needs.
dvgrn wrote:Here's a mostly unrelated item. The way the math works out, a linear interpolation between zoom levels tends to go through suboptimal intermediate views.
Agreed I'll take a look.
dvgrn wrote:There appears to be a hiccup in the HTML on your current test page, by the way -- the first pattern has eaten one of the following tests, which now show up as comments at the end of the too-big RLE due to a missing </textarea> tag.
Thanks, fixed.
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 147 is available on the lazyslug server.

Enhancements in this build:
  • when waypoints are defined LOOP is not disabled on Pause but on first Reset (to match waypoint playback)
Fixes in this build:
  • fixed the waypoint playback catch up algorithm after Pause or waypoint playback disable/enable
    • catch up spends one second gliding from current position to what would be the correct waypoint playback position based on current generation and elapsed time
  • don't display progress bar in VIEWONLY mode
  • limit catch up rate to prevent race condition on slower machines
  • only the first 128 state colours were being displayed
  • help information now correctly shows subset of custom colours used
  • colour states for states not present in the pattern are now silently ignored
Dave, please let me know if these address your concerns above. I'm still thinking about the ZOOM issue.
User avatar
dvgrn
Moderator
Posts: 11980
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Build 147 is available on the lazyslug server...
Dave, please let me know if these address your concerns above. I'm still thinking about the ZOOM issue.
Yes, that looks like a very reasonable solution to the problem.

I had been visualizing a somewhat different plan for allowing the user to interact with a waypoint animation, though. I'll explain it, and you can maybe see if it would be too much of a headache.

As of build 147, to be able to click-and-drag to pan around a pattern, you have to hit the Pause button. If you see something to investigate that's not in view in the waypoint animation, you can stop the animation and go over and look at it -- but you can't watch it running, because the view snaps back to the current interpolated waypoint position as soon as you hit Play again. To watch something other than what the animation wants you to watch, you have to Reset to turn off the waypoints, then run the pattern all over again to the generations you want to see.

Now, suppose that instead of this, the pan and zoom functions are left enabled during waypoint playback. The viewer keeps track of what the zoom and center should be, but lets the user wander around the pattern and see whatever they want to see -- increase the step, change the frame rate, whatever. I guess this kind of user input might temporarily disable pauses and text display, too (?) -- haven't really thought that out yet.

After several seconds of no mouse activity, the viewer would start drifting back toward the current interpolated waypoint. Not too fast, at least at first -- could maybe start with a 1% move in the right direction, and work gradually up to 10% or some such. Bonus points for decelerating at the end, too.... The maximum initial change could maybe be capped at a small value, so the user could notice the beginning of the drift and do some minor mouse operation to keep control.

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

Another topic: Brian Prentice's objections to the "Show in Viewer" link are, well, interesting... I don't find the minor and unobtrusive modification of old posts to be particularly problematic, myself -- no one is forcing anyone to click those links -- but it's worth looking for creative solutions here.

Let's see, just don't add "Show in Viewer" if the HTML text includes "bprentice" anywhere... that would give him the Midas-like ability to disable viewers by commenting in a thread, so it's probably not the best idea. Kind of an amusing idea, though.

Mostly just bear in mind the old Aesop's fable about the two men and the donkey (where the moral is, you can't please everyone...!)

Somewhat related to the add-link/don't-add-link decision: here's an example of a post where the viewer currently adds a Show in Viewer tag to a code block containing a Python script, but not to an actual pattern -- I believe because the pattern is too large to display.
User avatar
rowett
Moderator
Posts: 4570
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:As of build 147, to be able to click-and-drag to pan around a pattern, you have to hit the Pause button. If you see something to investigate that's not in view in the waypoint animation, you can stop the animation and go over and look at it -- but you can't watch it running, because the view snaps back to the current interpolated waypoint position as soon as you hit Play again. To watch something other than what the animation wants you to watch, you have to Reset to turn off the waypoints, then run the pattern all over again to the generations you want to see.
What you can currently do (and the advantage, to me at least, is that it's already implemented!) is temporarily disable waypoint playback with hotkey "W". At which point playback continues at the current rate. You can adjust whatever you wish. Switching it back on (with "W" again) will then glide to where playback would have been at that time and generation. Have a go with that (if you haven't already) and let me know if it's good enough, or if you'd like me to look at your alternative suggestion.
dvgrn wrote:Another topic: Brian Prentice's objections to the "Show in Viewer" link are, well, interesting... I don't find the minor and unobtrusive modification of old posts to be particularly problematic, myself -- no one is forcing anyone to click those links -- but it's worth looking for creative solutions here.
Yes I'd rapidly reached the conclusion that the set of people I can please does not contain "bprentice". I'm not planning on responding any further to him on this topic, especially since a) he wasn't terribly polite and b) I disagree with almost all the points he's made.
dvgrn wrote:Let's see, just don't add "Show in Viewer" if the HTML text includes "bprentice" anywhere... that would give him the Midas-like ability to disable viewers by commenting in a thread, so it's probably not the best idea. Kind of an amusing idea, though.
I had a similar idea albeit a little more targeted which was that if I detected he was logged into the browser to hide the "Show in Viewer" links so he, and he only, thought they weren't there any more... :wink:
dvgrn wrote:Somewhat related to the add-link/don't-add-link decision: here's an example of a post where the viewer currently adds a Show in Viewer tag to a code block containing a Python script, but not to an actual pattern -- I believe because the pattern is too large to display.
Yes I'd spotted that too. The second is indeed because the pattern is too large to display. The fact that the Viewer parsed the Python script into a pattern is clearly a bug, but on the other hand quite interesting. I wonder which other Python scripts result in a Life pattern...
User avatar
dvgrn
Moderator
Posts: 11980
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:What you can currently do (and the advantage, to me at least, is that it's already implemented!) is temporarily disable waypoint playback with hotkey "W". At which point playback continues at the current rate. You can adjust whatever you wish. Switching it back on (with "W" again) will then glide to where playback would have been at that time and generation. Have a go with that (if you haven't already) and let me know if it's good enough, or if you'd like me to look at your alternative suggestion.
Ah, of course. I'd forgotten about the keyboard waypoint toggle. That works reasonably well, once I get used to it.

I guess if you don't mind looking at the alternate suggestion, I'd still be interested in seeing what you think. The (not too major) problem is that waypoint playback disables various convenient mouse controls that the user might want to use, maybe somewhat mysteriously -- and there's nothing obvious to guide the user to the disable-playback hotkey. The advantage of my alternative is that users get to do whatever they want to do, and playback just automatically gets disabled temporarily while they're doing it.

Definitely not a really high priority or anything, just the way I personally would really rather it worked. (Or at least I think so -- it's perfectly possible that it might be annoying if I actually tried it.)

Re: unwanted viewer links --
rowett wrote:I had a similar idea albeit a little more targeted which was that if I detected he was logged into the browser to hide the "Show in Viewer" links so he, and he only, thought they weren't there any more... :wink:
Yes, another item for the Great Ideas That Are Probably Really Better To Think About And Not Actually Implement category. What if Brian comes around and wants to start using the viewer eventually? Discrimination is such a slippery slope...
rowett wrote:The fact that the Viewer parsed the Python script into a pattern is clearly a bug, but on the other hand quite interesting. I wonder which other Python scripts result in a Life pattern...
I've seen several of these cases, I think, and of course I always tried the Show in Viewer link. What I get is a strange VIEWONLY-type display with a white background and no visible pattern.
User avatar
Nathaniel
Site Admin
Posts: 903
Joined: December 10th, 2008, 3:48 pm
Location: New Brunswick, Canada
Contact:

Re: Life tag testing

Post by Nathaniel »

I'll just add my vote to the "we may as well ignore bprentice's complaint" choir. He seems to think that his posts should never ever change in any way whatsoever on these forums, but that's just not how this (or any!) site operates. It'd be like complaining that we "edited" his posts because we changed the font that the forums use.

It's a tiny link that is useful in 90% of cases, and is completely unobtrusive in the rest. It'd be nice if we could find some way to detect what rules his posts are using so that things are displayed correctly, but there's only so much guesswork we can do.
Locked