Alec Thomas

Alec Thomas

Alec Thomas  //  

Sep 23 / 6:19am

Chrysalis - Source to a 2D Platformer from 1994

Chrysalis is a game a friend (Eric Sambach) and I wrote in 1994, just out of high school.

We sent this game to Epic MegaGames for consideration, but without success (and they hadn’t even seen the source). Ouch.

The Game

I really thought the game itself could have been great. It centered around an amorphous blob of green slime (which wasn’t as ugly as it sounds) that could assume the shape and powers of defeated opponents. Only a limited number of shapes could be stored, and the various powers had to be used to solve puzzles and bypass obstacles.

The Engine

The source is horrendous. Almost zero encapsulation. Globals everywhere. You get the picture.

There is C, C++, Objective-C, Intel-style assembler, and GNU-style assembler.

The game ran only on 320x200 256-bit indexed video surfaces, initially supporting only DOS (using the Watcom C++ compiler and mode 13), and the Linux console (via svgalib). A friend (Brian Spilsbury) from #c on EFnet later wrote an X11 surface. We divided the 256 colour palette into a 6x6x6 RGB cube, which allowed us to easily compute fade transitions, though limited the fidelity of images somewhat.

The underlying graphics library was largely equivalent to SDL, but preceded its public release by about four years. It supported full clipping, transparent images, virtual pages, bitmapped text fonts, circle and line (Bresenham) primitives. It also included a full windowing system with transparency, used for the Chrysalis level editor.

Assembler was used for the low-level rendering primitives. 16-bit and 8-bit fixed-point number classes were used for all coordinates.

As a sign of its vintage, the game implements nearly everything from scratch and has almost no external dependencies, primarily because there were very few available. The STL didn’t exist, nor did SDL, or any number of other libraries that would have saved us a lot of time.

The Visuals

The art I created was quite nice too, I thought, though lost now, buried inside the proprietary packed file format we created.

The game itself used four-layer parallax scrolling. The play layer was the second from the front. Each layer faded off slightly more, to ensure it didn’t intrude too much visually.

Entities in the game could be animated, such as the water and vines in creature.cc.

Last Words

If anybody has an old Linux machine lying around and can run the binaries (which are included on GitHub), I’d love a screenshot.

Oct 31 / 11:43pm

Documenting difficulties in moving between Windows and Mac, and some solutions.

My other half bought a 17" MacBook Pro last year with 2GB of RAM, and all I hear from her when she's using it is swearing. Reasons for the swearing are many and varied; some as a result of an unwillingness to learn "the Mac way", some due to Mac UX shortcomings. Related here are some of the issues she's encountered and the solutions we've come up with.

One that she frequently hits is massive slowdowns due to the Mac going into swap. This is caused by a combination of a lack of understanding/caring about how RAM and swap work, and the Mac "feature" of not closing applications when the last window is closed. To be fair though, she also has this issue on Windows. Which brings up an interesting point of whether users should have to care about managing their memory. Regardless, this has been "fixed" by upgrading her Mac from 2GB to 4GB of RAM.

Another problem, more related to muscle memory than any technical or UX issues, was the difference in key bindings between Windows and OSX. This fantastic post saved her sanity.

When Christine first started using the Mac, she used it with one desktop with applications layered on top of each other. She found the combination of floating docks and windows with the layering very confusing though, often clicking straight through the application with focus to one in the background. I see this as a UX failure of Mac, and it frustrated Christine enough to switch to using Spaces. Unfortunately, if you've ever used Spaces on Leopard you'll be aware that it will regularly refuse to switch spaces when an application is keyboard cycled to, or selected on the dock. This bugginess makes it very frustrating to use. The solution here was to ditch spaces and solve the original problem by installing Isolator. This brilliant piece of software fades and blurs background windows, making it very clear which windows and docks are active. This, in combination with Exposé, will hopefully result in a much less frustrating experience.
Jan 30 / 3:24pm

The Big Picture

The Boston Globe's Big Picture showcases stunning, high resolution photographs from the world's press. Not only are the photographs themselves phenomenal, but the subject material is thought provoking and the descriptions insightful.

I can't recommend the Big Picture enough. If only more papers would do the same.

As a bonus to keyboard users, try using j/k to cycle through the images.

Jan 30 / 4:03am

Australian politicians

"This is the problem with Australian politicians. They are under the false impression that they are elected to make decisions for the people. Not on behalf of the people. In Australia there is no government of the people by the people. It is government of the people by the chosen few. This is underlined by the fact that he uses the word "I" more frequently than anything else." Sarah from the STOP Censorship ML, via Somebody Think of the Children.

This statement, made in the context of discussion on the Great Firewall of Oz, perfectly describes politics in Australia.