Jan 22th, 2014

Reverse Engineering Strike Commander

I love you Hoi-En.

Back in the early 90s, one company was on the bleeding edge of PC gaming: Origin Systems. Their motto was "We Create Worlds" and boy did they deliver: With the Ultima series, Crusader series and Wing Commander series, they consistently took gamer's breath away.

One of them took four years and more than a million man hours to complete: Strike Commander. The famous flight simulator had its own 3D engine called RealSpace which pioneered many of what we take for granted today: Texture Mapping, Gouraud Shading, Level of Details and Dithered colors.

My old dream was to play the game with a Virtual Reality device. With the Oculus Rift that fantasy came one step closer to reality. But when it turned out the source code had been lost and would never be released, I decided to reverse engineer it.

As of the publication of this article, the project is not yet completed but I want to share the techniques that have so far allowed this :



to become that :



... and maybe inspire some people to join the adventure.


TABLE OF CONTENT :

Part 1: Introduction
Part 2: Game Architecture
Part 3: Reverse Engineer Assets
Part 4: Play the game again
Part 5: Oculus Rift

Before Strike Commander

Early 90s flight simulators were good but like Falcon 3.0 or Flight simulator 4.0 they focused mostly on accurate flying models than beautiful rendition :



There were many fight simulator on the market and few people noticed the 1990 Origin Systems announcement for a new game. But things changed after Chicago CES 1991 where a demo could be seen in action : Nobody could believe the game could feature things only seen in military flight simulator so far: Texture Mapping, Gouraud Shading, Haze and more. Screenshots demonstrated a technology far ahead any competitors :




After 1991 the game became highly anticipated. Not only the engine was gorgeous and the story captivating, RealSpace also supported exceptional hardware out of the box: The very expensive and fragile accessories that every flight simulator enthusiast wanted were the THRUSTMASTER WEAPON CONTROL SYSTEM and the THRUSTMASTER FLIGHT CONTROL SYSTEM:



And you could even connect the THRUSTMASTER RUDDER:



Still, there was more: The game also supported a Virtual Cockpit. The 4-way 'hat switch' on the ThrustMaster allowing to move the pilot's head and follow ground objects/enemy jets without the need for a Virtual Reality HeadSet :



1993: First Contact

The game and its 3D engine were mind blowing but required an impossibly powerful machine :

Adjusted to today technological inflation the recommended configuration would be :

And purchasing the game was not enough, you also had to survive the installation ! Upon opening the box you would be faced with 8 floppy disks ( +3 for the Speech Pack):

Trivia : Notice the poster announcing a Christmas 1991 release. The game would not be completed until 1993 after a long process that Chris Robert labeled "The Apocalypse Now of computer games".

Decompressing the game from floppies to hard-drive and swapping the 13 flopping disk took a good 30 minutes. And when you thought you were done, the game proceeded to generate all the maps. The size of the game would blow up from 24MB to 38MB: Four times the size of any game back them.



Trivia : A map was generated from a single "seed" (an integer number) that was injected in a pseudo-random numbers generation algorithm. This was a clever technique that avoided shipping data by generating the map after installation. If you are curious about this technique, go read The Backroom Boys and the chapter about Frontier Elite game.

The maps generation step took ONE hour on a 386 PC. But Origin Systems had the good idea to ship with the box a superb 100 pages magazine set in the dystopian 2012 world of the game. Sudden Death made the entire process less painful ( notice the fake advertisement on page 38 promising the release of Strike Commander for Christmas 2013).

Strike Commander !

Finally after all those steps, players were able to enjoy the game....in April 1993 ! Despite being 2 years late, the game was everything Origin promised and it sold very well. Many spent nights after nights dogfighting even if for most what was supposed to look like this :



...ended up looking like that on minimum settings :



Overall the game was enough to captivate pilots and generate fond memories.

The Lost Source Code

With the Oculus Rift release, my interest in Strike Commander peaked again: The hardware was ready. Since it was a 20 years old game, I expected the source code to have been released but I quickly found out the sad story of Origin Systems decline.

Origin Systems was acquired by Electronic Arts in September 1992 and all projects were canceled circa 1999 following poor sales of Ultima 9. The company was to refocus on an other field they pioneered: MMORPG Ultima Online. Most people assume the source codes and gold versions of all finished games were stored in a Vault somewhere at EA. But after getting in touch with people at Wing Commander CIC, it appeared that all the source code was lost when the company closed.

It is something hard to believe today but back then developers and companies were more focused on the next title instead of preserving "old things", there was not nostalgia factor, no huge fan base and no market like Good Old Games today. Many stories could illustrate how "primitive" source control was but the best is probably the "ZAP SC" story at 15m14s :


On his first day one developer managed to delete the full 900MB of Strike Commander source tree. The IT team spent 72 hours recovering everything from developers machines. The interview also mention that Wing Commander 1 and 2 code was exchanged via floppy disks: They did not have a network until SC !

Trivia : In a surprising turn of event, some of the source code re-emerged recently via ex-Origin developers: Wing Commander CIC maintains an off-line archive which features the source codes of Wing Commander I Wing Commander III and people working on Ultima 8 were offered (but turned down) the source code of "Ultima 8: Pagan" by an anonymous source. As for Strike Commander, I have never heard of someone having it.

Reverse Engineering: Can it be done ?

Over the years many teams had done work on Origin Systems game and reached great results:

How long and how hard would it be ? After chatting with Gregory Montoir who did most of the reverse engineer on Another World I learned that working one hour per evening allowed to reverse 10KB of assembly to C each month. There are many executable in Strike Commander and the initial discouraging time estimate was :



  INSTALL.EXE       7,793 bytes :  2 weeks
  MKTERR.EXE      203,744 bytes :  1.5 years
  SC.EXE           20,000 bytes :  1 month
  MKGAME.EXE      131,696 bytes :  1 year
  OPTTEST.EXE     870,528 bytes :  7 years
  STRIKE.EXE      746,304 bytes :  6 years
  =============================================

                                  15 years, 7 months and 2 weeks. Ouch.

That was upsetting: If someone had started back in 1993 then he would have finished six years ago and I would just have had to git clone it :( ! But after starting up IDA and taking a quick look it turned out that not all of it would have to be reverse engineered: The 3D engine is fully contained within STRIKE.EXE and a small team could do it in a reasonable amount of time.

Road Map

The road-map I initially drew in order to reverse engineer Strike Commander was as follow :

  1. Gather as much documentation as possible.
  2. Understand the Global Architecture of Strike Commander.
  3. Reverse-Engineer the Game Assets.
  4. Document step 3 and extrapolate (Visual Surface Determination method, Level Of Detail, ...)
  5. Re-implement the 3D engine and build NEO_STRIKE.EXE
  6. Add support for VR device Oculus Rift.

And then I got busy.

Next

Architecture and Documentation

Comments

 

Fabien Sanglard @2014