HGE Comes To GNU/Linux !

Posted: 7th August 2011 by Maxim Bardin in Uncategorized
Tags: , ,

Ryan Gordon who ported many games to GNU/Linux including those of The Humble Indie Bundle #1 #2 and #3 has made a guest post on the Wolfire Blog :

This is a guest post from Ryan Gordon, announcing the release of Haaf’s Game Engine (HGE) for Mac and Linux. HGE is the 2d engine that powers games such as Hammerfight.

On top of all the other goodness, the thing I love most about the Humble Bundles is how they tend to leave a trail of open source software in their wake.

We’ve seen games opened up, which has made them bloom on exotic platforms the original developers never dreamed of; never mind the iPad ports and the Mac App Store, I’m talking about insanity like Lugaru running on an Amiga, Gish on the Pandora handheld, and Aquaria ported to Sony’s PSP.

We’ve also seen great improvements, optimizations, and enhancements to all the opened games, across hundreds of patches from dozens of contributors.

I got my start in the game industry working for Loki Software, coercing a wild array of titles to run on Linux. Loki was doing something no one had tried to do before, and we found we were missing some fundamental tools.

Out of necessity, we rolled up our sleeves and built toolkits, libraries, utilities and infrastructure to aid in the job. Out of a sense of community, we released the source code to these things. Because it’s what you should do if you can.

Loki didn’t survive, but their open source projects did. Their contributions are still paying off, over a decade later: SDL, built by Loki employees as an answer to DirectX, is still the gold standard for low-level game toolkits on Linux. Over the past decade, it has powered everything from blockbuster commercial games to indie experiments to awesome demoscene showcases. Almost every Mac and Linux game that has appeared on humblebundle.com uses it. The same is true for OpenAL, a 3D audio API which Loki spearheaded back in 2000. Now this library ships on every iOS device, Linux desktop, and Mac computer. It has powered the audio in several generations of Unreal Engine and id Tech.

What I love most about my career is that I get to follow Loki’s crazy, quixotic example.

It’s not enough to just bring games to Linux. Games will come and go. A game may take years of devotion to build, and then maybe it will live on a best-seller list for a few weeks and be forgotten. Ultimately, any given product is just another bullet point: does this run on Linux? Great, but what have you done for me lately? Porting a game isn’t nearly as rewarding as releasing the source code to something you built to help port that game. To that end, today I’m announcing the availability of hge-unix.

Under the hood, Hammerfight uses an engine named “Haaf’s Game Engine” (or “HGE,” for short). HGE has been popular for 2D indie and casual games in the last few years. It provides a decent wrapper over Direct3D and other common Win32 functionality, plus gives you some basic tools like particle systems. It’s an open source project, under a very permissive license, but it’s a big pile on non-portable Windows source code.

I had ported HGE to the Mac a few years ago for Red Marble Games. We used it for several games: Magic Match Adventures, Go Go Gourmet and its sequel. This was an education in the casual market: if we could make these games run on a blueberry iMac with Mac OS X 10.0, by god, we were going make it happen. It was great fun; I had to learn to inch as close to the impossible as I could, and develop the wisdom to know when I was close enough to it. As a benefit, the Mac port of HGE could run on some seriously ancient machines.

When Hammerfight came along for Humble Indie Bundle #3, I didn’t want to reinvent the wheel, so Red Marble and I discussed the HGE work we had already done. They were incredibly supportive, and let me use it as a starting point for Hammerfight. And now, they have graciously allowed me to open source that work, with the revision history intact, so others can benefit from it, too.

hge-unix is built with SDL, OpenGL and OpenAL. It has been known to run on Mac OS X and Linux, PowerPC, x86, and x86-64. It will probably run on any reasonable Unix variant. It might even run on Windows. The original API remains intact; if your project uses HGE for all its functionality, it’s possible that your Windows game will more or less Just Work on Linux and Mac OS X.

You can find details on hge-unix here. For those that want source code (which is currently identical to what we shipped in Hammerfight), point your web browsers or Mercurial client at this URL:


If you’re a Mac gamer that has enjoyed the Humble Indie Bundles, you should stop by redmarblegames.com and shop around. Red Marble does nothing but Mac games. They’re one of the few true believers, so you should go support them.

If you know someone with a Windows game built on HGE, you may now officially harass them for a Linux port. Just like Loki did ten years ago, I’m giving out the source code to my tools where I can, in hopes that it makes other game developers more successful.