The Original Code For System Shock Mac Is Now Open Source

Nightdive Studios has released the Mac source code for the original System Shock under GPL. Recovered by OtherSide Entertainment, helmed by LGS’ very own Paul Neurath, all and sundry can now check it out on GitHub and even create their own versions. Not that this is likely to happen, given how ancient it is, but hey, at least it’s possible.

Although Nightdive recently put the brakes on its high-def remaster after losing its way, it hasn’t stopped the developer following through with its plan to punch out the code for 1994’s System Shock, which introduced us to SHODAN, the creepy AI with a fetish for meat bags.

[referenced url=”https://www.kotaku.com.au/2018/02/decompiled-tomb-raider-source-code-reveals-loads-of-vulgar-commentary/” thumb=”https://www.kotaku.com.au/wp-content/uploads/sites/3/2018/02/439TR6043-768×432.jpg” title=”Decompiled Tomb Raider Source Code Reveals Loads Of Vulgar Words (NSFW)” excerpt=”Imagine you’re a programmer, working on a video game almost two decades ago. No one outside the studio is ever going to see your code, so you can name methods and write comments however you like, right?”]

Unfortunately, you can’t just grab the code, make some changes and play away. System Shock‘s Mac version is native to the Power Mac platform, so you’ll need to run an emulator to get it working (among other details).

If you’re not particularly keen to dig into the code yourself, Nightdive has already had a poke around:

  • The game uses fixed point for all the math instead of floating point. However, some blitting functions, after being optimized in the Macintosh version, use floating point registers and operations to speed up copying stuff.
  • System Shock uses the rendering-with-unique color trick (similar to http://www.opengl-tutorial.org/miscellaneous/clicking-on-objects/picking-with-an-opengl-hack/) to detect object clicks and shooting targets. This same trick is used to show nearby objects when online help is on.
  • In order to draw outline fonts, System Shock draws the same string 10 times. First they are rendered in black with a 1-pixel displacement into each of 9 directions, and then the desired color at the center.
  • There are various pieces of code commented out or disabled (using the preprocessor’s conditional compilation) meant to deal with a level editor and play testing.
  • Internally, the game usually treats the screen resolution as if it were 320×200 in order to achieve resolution-independent code.
  • The game is mostly written in C, except for the physics library written by Seamus Blackley (EDMS, the Emetic Dynamics Modeling System) and the fixed-point library it uses, which are written in C++, and some Assembly modules.

For those of you who just want to see funny comments, well, you’ve been catered for, thanks to this /r/programming thread. A few gems:

// oh oh oh baby oh baby oh self modify height delta step baby now baby please
// really, this wants to become the threaded nightmare assembler point coder from hell

// Although this seems a very stupid way to do this, it’s actually not…
// woo hoo, watch me pull odds out of my butt
// don’t ask me why i have to do this – but i do

Well. Yes. If only we could all pull odds from our butts, the world would be a better place.

[referenced url=”https://www.kotaku.com.au/2017/08/zork-source-code-is-a-master-class-in-game-developer-trolling/” thumb=”https://www.kotaku.com.au/wp-content/uploads/sites/3/2017/08/zorki-768×432.jpg” title=”Zork Source Code Is A Master Class In Game Developer Trolling” excerpt=”When I think about retro games, forget Mario, Sonic or even Tetris. I think Zork. The quirky text adventure, published by Personal Software (and then Infocom) back in 1980, screwed with players in many, many ways (when it wasn’t sending grues after them).”]

System Shock (PowerMac version / Official GPL Release) [GitHub, via Reddit]


The Cheapest NBN 1000 Plans

Looking to bump up your internet connection and save a few bucks? Here are the cheapest plans available.

At Kotaku, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments


2 responses to “The Original Code For System Shock Mac Is Now Open Source”

Leave a Reply

Your email address will not be published. Required fields are marked *