Loki Software was a software company based out of Southern California that was active from 1998 to 2001. During that time, the Dotcom bubble was rapidly expanding and Linux was picking up steam as a desktop operating system. Many corporate interests and venture capital firms were scrambling to be the first to somehow make a bundle of money on Linux's sudden good fortune. Loki Software was formed for the purpose of porting Windows desktop PC game titles to Linux. The company did good work and really advanced the state of the tools, libraries, and drivers available at the time. But, the marketbase just wasn't there to support the company. Once the VC money dried up, so did Loki.

I first encountered the company in 1999 when I entered the Loki Hack programming competition at the Atlanta Linux Symposium. Among other people, I bumped into I ended up coming in second place, which earned me a (pretty sweet for the time) Adaptec 3950U2 Ultra2 Dual Channel SCSI card and an (even sweeter for the time) offer of a job at Loki. I ended up taking the job, and a few months later I was relocating out to California.

Desktop::Loki("Deus Ex")

My involvement on this title was pretty tangental. The Unreal Tournament software renderer that I ported was added to the Linux port of Deus Ex as an additional render target. Since Deus Ex uses an Unreal Tournament engine, the addition of my renderer involved little more than linking in the new rendering library and hooking up the INI setting in the config files.

Sadly, the Linux port of Deus Ex never made it to market. Between Loki folding and stalled licensing talks between Loki and Eidos, Deus Ex remains a bit of Linux urban legend. Few have seen it actually run under Linux, but the code did exist. And it may still exist. Somewhere.

Interact with tons of NPCs Underground computer center Secret holding facility

Desktop::Loki("Kohan: Immortal Sovereigns")

TimeGate Studios was a new face in the gaming industry back in 1998, but their first title, Kohan: Immortal Sovereigns, was released in 2001 and was very well received. KIS is a real-time strategy game that strikes a good balance between strategy, tactics, diplomacy, and teamwork. All in all, really good stuff!

Since Timegate was still a young company, they were interested in finding a publisher for their launch title. Some of the Timegate staff were handing out press kits and demos of their new game at E3, trying to establish a partnership with a publisher. I happened to find the demo disk under a pile of stuff that the Loki staff brought back from E3, and I liked it so much that I went straight to Loki's management and suggested that we approach Timegate about developing and publishing a Linux port. Timegate was interested, a contract was made, and the rest, as they say, is history.

There's an interesting span list-based rendering engine inside of KIS that gives the game engine the ability to display many, many sprites at the same time with no pixel overdraw. Also, the game uses a number of specialized assembly-based blitters that contribute to the speed of the game's rendering engine. Mickey Kawick's book Real-Time Strategy Game Programming Using MS DirectX 6.0 has a terrific sample implementation of a span list renderer, in case you were interested in learning a bit more about it.

While I spent a large portion of time dealing with the assembly code within the game engine, I spent even more time coordinating with Timegate Studios. At the time I began porting the KIS codebase to Linux, the Win32 codebase was still under active development. It wasn't too long before large patches were being sent from Loki to Timegate Studios and back as the Linux tools caught things that the Win32 tools didn't. As the Win32 codebase stabilized, both the Linux codebase and the Win32 codebase were rock solid.

... but boy... it's a lot of work to do simultaneous development on two platforms from two different locations. Quite an experience for both the Win32 and Linux folks involved.

Skirmish against the undead Fighting the local militia Destroying the last few outposts

You can see more information on Kohan: Immortal Sovereigns here:

Desktop::Loki("Sid Meier's Alpha Centauri/Alien Crossfire")

The Firaxis title Sid Meier's Alpha Centauri is a classic in the turn-based strategy genre of games. Even though some time has passed since the original release of the game, the fans of SMAC keep coming back for more. An extension to the SMAC gaming world was added with the Alien Crossfire expansion. Together, these two titles are known as the Alpha Centauri Planetary Pack.

When I first came onboard with Loki, the Alpha Centauri Plantary Pack was my first porting project. I didn't know what to expect from commercial game code, but I sure wasn't expecting what I found in the SMAC codebase. Tens of thousands of lines of assembly code was in SMAC, some of which was self-modifying. I spent most of my time looking at memory in the debugger and flipping bits.

Intro movie of colonists leaving Earth Design workshop for designing custom units A scout exploring early in the game New intro for the Alien Crossfire expansion New factions in the Alien Crossfire expansion

Desktop::Loki("Unreal Tournament")

The Epic Games title Unreal Tournament has one of the best software-based 3-D renderers that I've ever seen. For a software renderer that does as many effects as it does, it's quite fast. This is mainly due to the well-designed span buffer implementation of the renderer (which greatly eliminates pixel overdraw). It also owes its speed to the large quantities of assembly code that do the actual pixel pushing.

It's the assembly code bit that steered this project into my lap. I burned a lot of hours calculating structure offsets, poking through memory, and converting MASM assembly syntax into GAS syntax. The Linux software renderer has been folded into the main Linux source tree, and it was released into the wild with the Linux 428 patch of Unreal Tournament.

Colored, dynamic lighting from weapons The intro animation Tutorial area

Desktop::Loki("Quake III Arena")

As of the point release 1.27 of Quake III Arena back in January 2001, my name joined the short list of people that have had the opportunity to have their code merged into the Quake III engine prior to the engine's GPL release. My contributions were minor fixes to the Quake Virtual Machine that avoided some cross-platform floating point errors. I had the chance to tinker with Carmack's VM code, and I slipped a few opcodes into it that modified the floating point control word on the x86 platform.

You can browse the Quake III source code base to look at exactly what I did. I created these two files:

  • code/unix/snapvectora.s
  • code/unix/linux_common.c

    ... and I rolled in some other Loki code to fix a floating point bug in the functions within this file:

  • code/unix/ftol.nasm

    The changelog spells out everything in quite a bit of detail.