Beautiful Algorithms
I enjoyed writing the Let’s Make a Game Series, so I’m thinking about a followup with a guide for writing Pacman or Space Invaders. In the meantime, I’d like to start a new recurring series called Beautiful Algorithms.
This new series will explain how to write graphical effects. I’m going to stick to Ruby or possibly JavaScript — languages with simple syntax that won’t scare off newcomers. I’m researching old school demo scene graphics, because that’s what got me into programming in the first place (back on the Sinclair and then Amiga computers).
Here’s a preview:

The Demo Scene
Demos and intros were big in the 90s in Europe. Programmers, artists and musicians collaborated to create audio visual experiences, pushing hardware to the limit. They coaxed realtime raytracing (glossy 3D graphics) out of Amigas — machines many times less powerful than your iPhone.
Fortunately, you don’t need old computers to appreciate demos, people post them to YouTube all the time.
Desert Dream


Desert Dream Part 1, Desert Dream Part 2
This demo is one of my favourites. It ran on Amigas and was release in 1993. The music in this demo is still amazing. It’s pretty typical: effects are showcased with ridiculous showboating, barely knit together into a narrative, complete with mockery of other demo groups. The dot effects haunted me for years, I couldn’t figure out how they drew so many with such a good framerate.
Jesus on E’s

YouTube Playlist for Jesus on E’s
This is another Amiga demo, released in 1992. More famous for its music than graphics, but slickly put together. It’ll probably remind you of acid house if nothing else. It features an effect where curves are plotted and the colour is increased as they overlap (screenshot above), which is the first effect I figured out in my early programming days.
The Black Lotus

This was made in 2005 — people still make Amiga demos, and they’re still getting new things out of the hardware. The 3D dancer is particularly impressive. This demo is a good example of how (in some areas) the scene has matured. To see another example of this shift in culture, get Linger In Shadows off PSN for PlayStation 3.
Demos are what got me into programming: I used to spend hours studying C and trying to recreate the effects on my Amiga 500. It was probably a tough introduction to programming, but it made me realise that making and experimenting with cool graphical algorithms was a great place to start: it was far less boring than studying gigantic books with examples about businesses and databases. So please forward Beautiful Algorithms links on to anyone who you know who wants to learn programming.

