Burning trees

Today I made a little thing, which I find rather more fascinating than I probably should. You see, Joey said, “I wonder if this still works?”

'The Sands of Time' Linux Desktop

That’s quite cool — sand dunes in front of a clock — and it made me remember that years and years ago you used to get these programs where you could click and it would create sand which accumulated at the bottom of the window. The very first one I saw was on the Archimedes. But what came along a little later was one where you could click to produce various different substances — sand, oil, water, fire — and oil floated on water, fire set the oil alight, and so on. It was all rather amazing back when the phrase “particle system” hadn’t been invented. Anyway, I thought: hey, what’d be cool is if the clock in that picture was obscured by actual moving sand, rather than just a static picture of sand dunes. A tiny bit of poking around brought me to Dust, an implementation of precisely the sand/oil/water thing with WebGL in the browser. So I completely forgot about the clock thing and just played with Dust. Which is rather fun.

After some faffing around I discovered that it had two things I liked: “lava”, which is like a static piece of fire in that it ignites things that touch it but is not itself consumed, and “Life Itself” which is stuff that grows, like bacteria in a petri dish. But the life stuff is ignited by lava. so if you drop a couple of tiny bits of lava into the world, and then some green fungus life stuff, the fungus grows and takes over the whole window until it touches the lava, and then it gets burned up and vanishes… but, critically for this, it isn’t entirely consumed. A few specks remain, and those specks start growing again. Very cool. I spent ages just watching it!

Then I thought, well, this is nice and all, but this Dust thing uses WebGL, which is hassle, and it can’t actually cope with filling its whole window up with particles because it runs out of memory or space or shaders or something. So I figured I’d lash together a quick version myself.

Burning Trees on jsbin.com

And lo, it is so: a noddy version in JavaScript. This is superbly inefficient; it regenerates the whole grid and then innerHTMLs it into the page at every clock tick, and it’s completely character-based, like some sort of BBC Micro program. (At least it’s using requestAnimationFrame so it doesn’t hammer the CPU in a background tab!) But I could still sit there and watch it for ages. I really like it; the sense of watching the green take over and then get burned back.

I think what I’d like to do with it is make it considerably more efficient and then try to make it a sort of “live wallpaper” for my Ubuntu desktop. For that, I need to read about Life rendering algorithms; this Life implementation at pmav.eu uses a JS port of Tony Finch’s List Life algorithm to do the calculations. There’s also Golly, the Life simulator, which can do things ridiculously fast, and it’s possible to program your own ruleset (rather than just follow John Conway’s original rules), and if I understood how to do this (I do not) then I could probably turn my little Burning Trees thing into something that’s renderable by Golly at a much bigger size than my inefficient JavaScript can manage. There seems to be a quite large community of people working on Life, still, to my amazement. Where do these people hang out, I wonder? So I can ask them how to write a Golly ruleset. And then see if I can make Golly run fullscreen and render to the root window and have the coolest desktop background imaginable, especially once it’s graphics rather than block characters, and maybe the green is different colours depending on how old it is, and the fire has a slightly cooler effect, and… well, you can see, I like this idea, so making it look pretty would be wonderful. Maybe I’ll even put a clock behind it. But if I did it’d either be this one which I pinched from an imgur idea or my favourite clock that I wrote, which is this:

Stuart’s cool clock on jsbin.com

Anyway, none of this is what Joey wanted. Sorry, Joey. I hope the thing you wanted still works, even if it is waaaay complex to set up. Someone should step up and make that easier for you, because I like it when we have pretty things, and there aren’t enough of them on our desktop.

I'm currently available for hire, to help you plan, architect, and build new systems, and for technical writing and articles. You can take a look at some projects I've worked on and some of my writing. If you'd like to talk about your upcoming project, do get in touch.

More in the discussion (powered by webmentions)

  • Jan Moren responded at likes this. (plus.google.com)
  • BrendanEich responded at reposts this. (twitter.com) RT @sil: A bit more detail on yesterday's little cellular automaton thingy: kryogenix.org/days/2015/05/2…
  • Miguel Krvajal responded at likes this. (twitter.com)
  • Michał Prędotka responded at likes this. (plus.google.com)
  • Manuel Hernandez responded at twitter.com @sil @BrendanEich the more things change the more they stay the same. I'm remembering seeing Conways game of life on Unix systems as a kid
  • Manuel Hernandez responded at likes this. (twitter.com)
  • Christian Kopp responded at likes this. (plus.google.com)
  • Jonathan Jesse responded at likes this. (plus.google.com)
  • Mukilan Thiagarajan responded at likes this. (twitter.com)
  • Joey-Elijah Sneddon responded at likes this. (plus.google.com)
  • Eduardo Raad responded at likes this. (twitter.com)
  • Joe Gaffey responded at likes this. (twitter.com)
  • gus knight responded at likes this. (twitter.com)
  • Rahul Horé responded at likes this. (twitter.com)
  • K. P. MacGregor responded at likes this. (twitter.com)
  • ♥ responded at likes this. (twitter.com)
  • Tero Parviainen responded at twitter.com @js_bin @sil I’m seeing the same thing on teropa.info/blog/2015/06/0… - all bins on the page show the content of the first one now.
  • Remy Sharp responded at twitter.com @sil ping me some URLs, the release was around this so I need to fix pronto
  • Dave, the Bin Bot responded at twitter.com @teropa @sil I'll get this fixed today, the release was related to this
  • Tero Parviainen responded at twitter.com @js_bin @sil Great, thanks!
  • Dave, the Bin Bot responded at twitter.com @teropa @sil darnit - aggressive caching in the browser is causing the issue. I'll fix it up.
  • Dave, the Bin Bot responded at twitter.com @teropa @sil fixed and live. Feel free to double check and confirm - but I'm pretty confident it's correct now.
  • Tero Parviainen responded at twitter.com @js_bin Yup, works great now. Thanks again @sil
  • Stuart Langridge responded at twitter.com @js_bin @teropa yep, seems fixed now; nice one!