sprite animation toolkit (1992-1999)

Ingemar Ragnemalm first released the Sprite Animation Toolkit (SAT) in 1992. “I have always liked to make computer games,” Ingemar wrote in the SAT manual. “It has been one of my hobbies since the late 70’s. When I started using Macs, of course I wanted to make some games for it too.” After writing many games, he had developed some shared code for sprite drawing and other utilities, so he released it as a library. Dozens of eccentric Macintosh games were built on the SAT, including Harry the Handsome Executive, Bub&Bob, Ingemar’s Skiing Game, and Snood.

Screenshot of Snood running on Mac OS 9

By 2009, the SAT was abandoned. It had survived many transitions: from black-and-white to 16-bit color, from Motorola 68K to the PowerPC architecture, from the original Macintosh operating system to Mac OS X. But the arrival of dedicated graphics cards and OpenGL spelled the end. As Ingemar put it, “writing sprites fast was no longer an interesting problem and even the wrong way of doing things.” A planned rewrite never materialized.

Nonetheless, the University of Linköping in Sweden, where Ingemar teaches computer graphics, continues to host the SAT homepage to this day.

Screenshot of the Sprite Animation Toolkit website in Internet Explorer 5 on Mac OS 9

The libraries, examples, and manual1 can still be downloaded. The demos still run, although they require some qemu incantations to emulate Mac OS 9 running on a PowerPC.

Seeing these again, after nearly a quarter century, fills me with nostalgia. I was a teenager, desperate to write a computer game. I didn’t know where to begin, had barely started pre-algebra. Forum posts recommended a book called Tricks of the Mac Game Programming Gurus, which Ingemar had co-authored in 1995. That led me to the Sprite Animation Toolkit, on which I built my first games.2 I printed out pages of example code to study at school.

Writing games in the 90s was hard. Classic Mac OS lacked protected memory or preemptive multitasking. A single NULL pointer dereference or infinite loop would take down the system. There was no hardware acceleration for graphics – everything ran on the CPU. Floating point calculations and trigonometric functions were prohibitively slow. Even storing multiple sprites was difficult, since neither Pascal nor C had container abstractions. The first time I saw a doubly linked list was in the SAT header files:

Screenshot of SAT.h in CodeWarrior, with the “next” and “prev” pointers highlighted

Fully sorting the sprites by position was too expensive, so the SAT would run one iteration of BubbleSort per frame, each requiring only a single list traversal. Since sprites usually moved a small amount each frame, the list would converge quickly to the correct order. I learned sorting algorithms by modifying and playing with demos like this:

Reading the SAT example code and manual, I learned tricks that I still remember today. You could avoid floating point calculations by using integers to represent fixed-point decimal numbers. You could compare squared distances to detect collisions between circles without a costly sqrt call. You could use Euler’s method to approximate parabolic motion, changing each sprite’s position and velocity a tiny amount each frame.

Beyond the technology, I remember the excitement of seeing people create games to share with the world. The Macintosh gaming market was too small to attract large publishers, so the majority of original games were created by enthusiasts. For example, each year from 1993 to 1999, Ingemar released a Christmas jigsaw puzzle game.

The completed puzzle shows a picture of Ingemar’s two-year-old son enjoying the first snow of the year. The text reads, “Merry Christmas 1999 to all Mac users!” This was not a polished, commercially-driven project. Just a small program, created for the joy of it.

I was a kid with no programming experience, but I could sense that real people built these games. So maybe I could build them too.

  1. The original manual no longer loads in current versions of Microsoft Word, so I have uploaded a PDF version of the manual here↩︎

  2. I tried, unsuccessfully, to distribute one of my games (a multiplayer card game) through an indie Mac game publisher. I don’t think they knew how young I was. We exchanged dozens of emails, and at one point I even signed an NDA. But the game was bizarre and buggy, so they wisely rejected it. ↩︎