Abstract
Problem: In the early 1990s, DOS game development required dealing with ugly, inconsistent low-level systems β bank switching for Super VGA, assembly-level timers, and platform-specific mouse/keyboard handling β all of which cluttered game code.
Approach: Tim Cain iteratively built OS abstraction libraries β first GNW (Game's Not Windows) at Interplay, then TIG (TIG Isn't GNW) at Troika β to encapsulate all platform-specific code behind clean interfaces.
Findings: The abstraction paid off enormously: Fallout was ported to Mac in a weekend and to Windows 95 in weeks. Arcanum was recompiled as a native Windows 10 app with minimal effort decades later. The libraries were adopted by 5-6 Interplay teams despite management skepticism about code reuse.
Key insight: By isolating all OS-specific code into a single library, game code becomes platform-independent β making ports trivial and ensuring games can survive operating system changes for decades.
Origin: GRLIB and the Pain of Bank Switching
Tim Cain's journey started with his personal GURPS apps, where he first encountered Super VGA programming on DOS. The video memory window was only 64K, but Super VGA needed far more, requiring bank switching β writing to a 64K memory region, then switching which part of the screen it mapped to. Bank switching required assembly code and was different for every video card.
To hide this ugliness, Tim wrote a small library called GRLIB (Graphics Library) that encapsulated bank switching. This was the seed of everything that followed.
Growing Into GNW
When Tim started working on Rags to Riches at Interplay, the library expanded organically:
- Custom mouse pointer β drawing the mouse required understanding bank switching, so mouse routines moved into the library
- Event queue β mouse clicks and double-clicks were queued as events for the game to process
- Keyboard abstraction β key down, key up, and key repeat events joined the queue
- Millisecond timer β DOS only provided a tenth-of-a-second timer, insufficient for 30/60 FPS games. The millisecond timer required assembly, which Tim wanted hidden away from his "beautiful C code"
After Rags to Riches shipped, Tim formalized all these abstractions into a single library called GNW β standing for "GNW's Not Windows", a front-end recursive acronym in the tradition of programmer humor (like GNU).
Proving the Concept: Fallout on Mac in a Weekend
The abstraction's power was demonstrated dramatically. Chris Salvo, who had stayed up all night helping Tim code Rags to Riches, volunteered to test the theory by creating a Mac version of GNW. He took it home over one weekend and came back with roughly 90% of GNW Mac working (color cycling was the main issue, since Macs handled palettes differently).
They recompiled the early Fallout code against GNW Mac β and it worked. Fallout was running on a Mac, just like that.
Chris Jones later created a Windows version of GNW in a few weeks, giving them Fallout running on DOS, Mac, and Windows 95.
Adoption and Management Skepticism
Tim shared GNW with other Interplay teams. It was adopted by:
- The Star Trek team
- MACE (Mechanized Armored Combat Exploration)
- Several Sim games β SimAnt, SimEarth, SimCity, SimCity 2000
Despite 5-6 projects depending on GNW, the executive producer told Tim to stop wasting his time because "no one reused software." Tim pointed to the half-dozen projects already using it and kept going.
The Windows 95 Logo Fiasco
Marketing wanted a Windows 95 sticker on the Fallout box. Tim submitted it confidently β Fallout wasn't just Windows 95 compatible, it was generically Windows-compliant. He was shocked when it came back unapproved.
The reason: it ran on Windows NT. Microsoft's certification required that software "degrade gracefully" on Windows NT. Tim called the testing facility and argued that running flawlessly was the most graceful degradation possible. The response: "Nope. It's not supposed to work."
To get the logo, they needed to make it not work on NT. Tim refused to put OS-detection code in the game itself, so he had Chris Jones add a check in the installer only β if you tried to install Fallout on Windows NT, it would reject the target OS. But since Tim had already built a manual installation path (copy the DAT file and executable by hand) for users with bad CD-ROM drives, NT users could simply bypass the installer.
The irony: Windows 95 was eventually phased out, and everything from Windows 2000 onward was NT-based. The installer wouldn't work β but hand-copying still did. Fallout continued to run.
TIG: The Troika Successor
When Tim co-founded Troika Games, he left all of Interplay's code behind and rewrote the library from scratch as TIG β standing for "TIG Isn't GNW" (recursive in both the first and last letters).
TIG expanded significantly beyond GNW's capabilities:
- Any bit depth β 8-bit, 16-bit, 24-bit, 32-bit color
- Memory management β either automatic or developer-managed buffers
- Any resolution β 640Γ480 and beyond
Interplay's Code Theft Accusation
At one point, Interplay suspected Tim had stolen GNW code. Tim invited them to inspect. Fergus Urquhart came over with a programmer who reviewed all of TIG's source. The programmer's verdict: "This is totally brand new. This isn't anything from GNW. In fact, it's better β I kind of wish we could do some of this stuff."
Legacy: Why Abstraction Libraries Matter
Tim's key point is that GNW and TIG made games trivially portable. Because game code never touched OS-specific APIs, porting meant only rewriting the thin abstraction layer.
To prove this, Tim took the Arcanum source code, recompiled it with a modern C compiler targeting Windows 10 and current DirectX β and it worked. Arcanum running as a native Windows 10 app, decades after its original release.
His conclusion: if he could do that with Arcanum (built on TIG), anyone with the Fallout source code (built on GNW) could do the same β recompile for Windows 11, Windows 12, or whatever comes next. That was the whole point of building the abstraction layer in the first place: never having to deal with operating system upgrades again.
References
- Tim Cain. YouTube video. https://www.youtube.com/watch?v=hZEosFcqmcU