XScreenSaver 5.31

XScreenSaver 5.31 out now. iOS version, too.

  • Three new hacks this time, GeodesicGears, BinaryRing and Cityflow. And I figured out a way to make GLPlanet not look crappy.

  • All of the text-displaying hacks support UTF8 input (even if some of them, like Apple2, can't quite display all of the characters on output), and all text is antialiased, even on Linux. (This means Zalgo Star Wars, as noted previously). To make this work I had to add a UTF8 parser to my VT100 implementation. Like you do.

  • The problems that MacOS 10.10 had with loading text and images are fixed. I still haven't upgraded but I think it should be working.

  • The iOS app has a search field (pull down the top of the list).

  • iOS device rotation completely stopped working when I was forced to upgrade from the iOS 7 SDK to the iOS 8 SDK, so I had to rewrite a bunch of stuff to get it working again.

    Let me know if you have an iOS device/OS combo on which rotation doesn't work, or things are scaled wrong (don't fill the screen, or are too big for the screen.) Good tests are "Apple2" and "Endgame". Do they orient properly when you rotate? When you rotate and then drag in "Endgame" does the object track your finger properly?

  • A fellow named Dennis made some good but very preliminary progress on a port to Android, so there's now an android/ subdirectory in there. If you have an Android development environment installed, give it a whack and let us know how that works.

  • At some point "shake to run a new saver" stopped working. It works when the saver list is visible, but not when a saver is running. I can't figure it out. If you can, send me a diff!

  • I would like confirmation from someone running XScreenSaver 5.30 on on MacOS 10.10 that eventually the "there's a new version available" dialog appears, and then successfully downloads and installs 5.31. So if you don't download it manually, lemme know how that goes.

That's a lot of changes this time. But really I want to talk about GeodesicGears because it's awesome.

Most of the time when I write a new saver, it kind of percolates around in my head for a few weeks, and then I knock it out in a day or two. Not this one. The math on this one kicked my ass for like a month. There were a few times when I was completely stuck and the answers literally came to me in dreams. Not like visualization dreams or anything, but extremely literal, "I am typing, adding struct fields, adding for loops" dreams where I crack the problem, wake up, and think, "Oh hey, that's gonna work." Then I basically type it in. That doesn't happen to me too often, but it does happen with some regularly, and I really enjoy it when it does because if I'm expected to spend a third of my life motionless and hallucinating I might as well be doing something I actually care about with that time.

Anyway, a while back I posted some cool gear animations by TaffGoch. As far as I can tell, he built those by hand in Sketchup, based on the extensive research by Bugman123, who figured out the large set of 32-gear and 92-gear tilings of a sphere that "work", more or less. So I implemented most of those. (I haven't done the 182-gear models yet.)

There are still a bunch of numeric constants in my code to make these layout work, and it bothers me that those numbers aren't all derived from something basic in the model, but most of the layout is done computationally, as is Good and Proper.

So the interesting thing about meshing gears on a closed surface is that because the connectivity graph is neither directed nor acyclic, all possible loops have to be an even number of hops, or the gears bind: clockwise gears can only touch counterclockwise gears. If you look at the animations, you'll see loops of four gears touching each other but you can never see three. It's almost a map-coloring problem, I guess.

The sizes of the various gears have to match in just the right way (outer disc edges tangent to the surface of the sphere, the right set of discs touching and the others not); every gear has to have the same size teeth; and tooth size and radius imply the number of teeth on a gear, which also have to be matching multiples of the rest of the system. There are not always solutions to all of these constraints!

In fact, the 92-gear models don't technically "work". The phase errors build up, and sometimes you see gears that don't mesh properly. If it was a real object, it would bind after a few turns. This bugs me, but it still looks "right" most of the time.

Anyway. Another fun way of looking at the the chirality of meshed gears is, instead of thinking of them as clockwise and counterclockwise, think of them as magnets, with one flat face being positive and one negative, so "In" and "Out" have different polarity. You get the same layout constraints, because "heads" can only be adjacent to and touching "tails".

That's the idea behind Kenneth Snelson's model of the atom:

He discovered the 5, 8, 10, 14 and 18-disc layouts that work, and I tossed those into the mix as well. (His 32 disc layout is the same as one of Bugman123's 32 disc layouts, because it's the case where the 20-count gears and the 12-count gears happen to be the same size).

My thanks and apologies to all of my friends who have had to listen to me drunkenly babble about trigonometry over the last few weeks. (Or possibly years or decades.)

Tags: , , , , , ,

29 Responses:

  1. David M.A. says:

    Very, very cool work on the gear spheres.

    As a 10.10 user, I'll wait patiently for my xScreenSaver copy to phone home... how long is the interval supposed to be? (That is, when will I have know it's failed?)

    Also, where should half-baked feature requests be directed?

    • jwz says:

      The update check interval is in preferences. Half-bakery can go here or email.

      • David M.A. says:

        It's simple, so I'll mention it here:

        It'd be nice if in the MacOS version there was a way to blanket-disable grabbing your current desktop. (I use xScreenSaver at work, and sometimes I have shit on my screen I don't want appearing after a lock.)

        • James C. says:

          I’ll second this. I delete/disable all the hacks that screengrab, and it’s a minor nuisance to do this every time there’s a new version.

  2. dzm says:

    The text/images issue in MacOS 10.10 had made me sad so the savers were no longer auto-running. When I went to MacOS Prefs and selected a Saver I was prompted to install the update.

    The only bad behavior that I observe so far is that at the completion of the Installer run I'm left with a window labeled "Updating XScreenSaver". The contents of this window are a progress meter, the SXcreenSaver logo, "Installing update..." text, and a grayed out "Cancel Update" button. The only menu associated with this app is "finish_installation" and it immediately snaps closed if I try to open it.

    There is also an icon on my Dock for this - "finish_installation". The icon is five blue dots over an orange backdrop and a down-pointing arrow. Right-clicking this icon gets me the "Quit" option. When selected the app properly exits.

    • jwz says:

      It installed properly, though? The versions that you see in System Preferences are the 5.31 versions, not the 5.30 versions?

      • dzm says:

        Yep. Though it left System Prefs (which was open during the install) in an unhappy state that required restarting the prefs app.

        Also, I noticed that the actual installer app was on the "Finished" screen. It's possible my report above was the updater app waiting for me to clear this window.

    • David M.A. says:

      I'll add my experience to this:

      I received the update prompt today, and continued. I made it to the same point as mentioned above, and just waited. My patience was rewarded: eventually, after maybe about 90 seconds, the installation finished, the (no-visible-windows) finish_installation app closed, and the Installer properly reported its tasks were complete. It launched Preferences.app on completion, which I found odd -- is that so that the new hacks properly register?

  3. Not like visualization dreams or anything, but extremely literal, "I am typing, adding struct fields, adding for loops" dreams where I crack the problem, wake up, and think, "Oh hey, that's gonna work." Then I basically type it in.

    The fact that this happens regularly delights me; the implications about the actual usefulness of human consciousness maybe not so much. (Related and relevant: if you haven't yet read "Blindsight" and "Echopraxia" by Peter Watts, you should fix that.)

  4. Patrick says:

    Apollonian doesn't rotate "right" for what it's worth. The labels still stay in portrait after rotating to landscape.

    • jwz says:

      Yeah, I decided it made slightly more sense for that one to ignore rotation. I dunno. With some of them, "to rotate or not" is arguable.

  5. LafinJack says:

    Geodesic Gears is super cool, though I don't use screensavers.

    If it's not already an option, I think it would look more aesthetic to have the gearoid just move off the screen (increasing speed and rotation a bit, maybe) and a new one move on, instead of the shrink/zoom effect of swapping them.

    • Julian Calaby says:

      The teeth not being angled away from the gear faces - I.e. the teeth of meshing gears poking above the faces of those gears - really bugs me for no good reason.

      • jwz says:

        They are angled. The edge of each gear points toward the center. Essentially they're truncated cones.

        • Julian Calaby says:

          I've failed to explain this in words, so I'll attempt to explain it in pictures:

          It's such a minor nit, but it's like font kerning or "converted" 3D films or trigger dicipline, once you know what to look for you can't stop seeing it everywhere, and when you do see it, it ruins the magic.

  6. John says:

    I tried to compile it on Ubuntu 14.04 and had to add:
    #include "stdint.h"
    to hacks/binaryring.c

    (BTW, Sorry about not getting back to you the other day about the Chromebook stuff I said I'd look at. I got busy and by the time I got around to it you'd already fixed it up enough to run on those Android boxes.)

  7. ff says:

    Got the update dialog in system preferences on 10.10, and the update went smooth, but it dropped an "Apple2.app" and an "Phosphor.app" in /Applications for some reason. I deleted those two from the Applications folder - the screensavers seem to work still (even after emptying trash). Actually I think the same thing happened during the previous update too (which must have been on 10.9?)

  8. Craig says:

    iPhone 5s, iOS 7.1.2, screen savers occupy only 25% of the screen (the ones I've checked rotate all right). Upper-left portrait, lower-left landscape.

    • jwz says:

      Build against iOS 7 SDK: works great.
      Build against iOS 8 SDK: does that stupid thing only when running on iOS 7 Retina.

      I haven't figured it out yet.

  9. demcanulty says:

    10.10 - opened Sys Prefs, Desktop/Screensaver, was prompted to update, update completed successfully without a hitch.

  10. > It's almost a map-coloring problem, I guess.

    You need to two-coloring of the graph. There is a special term for this: a graph that is two-colorable is "bipartite".

  11. None of the 2014 savers work on my iPad 2 with 8.1.1 on it. I just get a "unsupported framebuffer" error. Let me know what info you want me to send you and I'll get it when I'm in front of it again.

  12. 205guy says:

    I do believe the soundtrack of the video is from Myst. Well played, sir.

  13. dasuxullebt says:

    XScreenSaver on Android? How is that possible? Android does not use X11, does it?