
System Shock 1 source code released under GPL - jsheard
https://github.com/NightDiveStudios/shockmac
======
hguhghuff
For context this is the outcome of a failed Kickstarter.

It’s disappointing that they didn’t stick to the goals of the Kickstarter
which was a straight update of the original.

[https://www.google.com.au/amp/s/www.polygon.com/platform/amp...](https://www.google.com.au/amp/s/www.polygon.com/platform/amp/2018/2/16/17016744/system-
shock-reboot-hiatus-nightdive-interview)

[https://www.kickstarter.com/projects/1598858095/system-
shock...](https://www.kickstarter.com/projects/1598858095/system-
shock/posts/2115044)

This is probably the next best thing to completing the Kickstarter since
clearly they’ve run out of funds.

I’m not angry that the money is gone but it is s classic software engineering
error for scope to blow out and the budget to disappear as a result with
inevitable project cancellation.

So it’s my money, and the money of the other Kickstarter backers, that gives
you this source. You’re welcome.

To the credit of Nightdive, this is the most likely path through which system
shock 1 will be cleaned up and updated, hopefully with usable controls as
opposed to the flat out unusable controls of the original.

~~~
movedx
> "As the budget grew, we began a long series of conversations with potential
> publishing partners."

Really? You need a publisher? Sigh. What year is it again?

~~~
stevenwoo
PC/Mac only you are right. I haven't worked in the industry in a while but I
vaguely recall one had to purchase production time and essentially predict
your sales for Sony/Nintendo if the system was hot in the marketplace. If you
aimed too low, one had customers without product for an extended period (most
traditional game sales are in the first weeks), if you aimed too low, you had
to eat those DVDs/carts at a loss after the retailers returned them. Also with
consoles, the devkits for each were priced ridiculously at something like 3000
for PS3 and more for XBox360 (and those things red-ringed like crazy, went
through three in three years), and there were test versions and special
development versions one had to use to debug, I remember there was one special
PS3 that was I want to say 10000 that was the size of a desktop computer that
our resident graphics guru got. So deciding to add on console support for a PC
game like they did is a huge commitment for a AAA game, it is not simply a
matter of using an engine that works on all the platforms, all the QA has to
be repeated and there are different extra steps for every platform but they
didn't even get to that step.

~~~
bluedino
$3,000 dev kit is pretty cheap. Just think of the cash a N64 developer had to
drop on an SGI...$100k+

~~~
stevenwoo
True, I remember there was also something of a shortage of Wii kits for a long
time at least for my developer shop we were low on the priority list so we
only had on Wii developer box for the US branch for at least a year after the
Wii came out.

------
dfan
This is a trip, seeing code I wrote 25 years ago. It's actually kind of scary
how identifiable my style is; in a lot of ways I am still the same coder,
although I tend to work at a much higher level of abstraction now. There was a
certain craft to weaving all sorts of linked lists back and forth all the time
and maintaining invariants that looking at my old code makes me a little
nostalgic for, but I can't say I really miss it much.

~~~
angersock
What was the EDMS business? Also, any good stories from your origin days?

~~~
hacoo
According to a Kickstarter update from Nightdive, EDMS was the physics system,
written by Seamus Blackley. It stands for 'Emetic Dynamics Modeling System'...
Possibly a reference to the way discarded items would go flying out the center
of the viewport :)

Edit: EDMS/SOLITON.CC confirms above is correct (speculation about origin of
the name is still speculation, however)

~~~
dfan
Oh, that EDMS! I had totally forgotten its code name.

Seamus's physics system was really ahead of its time, but unfortunately a ton
of the work of getting a physics system to work in a real game is dealing with
edge cases, numerical stability, etc., and we had huge problems getting
everything to an industrial-strength state. (You will probably not be
surprised if you look at the code.) Terra Nova: Strike Force Centauri's full
biped physics eventually had to be replaced by run-of-the-mill sphere physics
just to make sure that things worked 100% of the time instead of 95%. Flight
Unlimited was the real culmination of Seamus's physics work.

------
steinuil
Nice! I can only hope the same will be done for Thief 1 and 2 (and SS2)
someday.

The Thief games still have a very active community that regularly produces
high quality fan missions, and one of the original engine developers has
started releasing unofficial patches to make the games run on modern systems a
few years ago. I'd love to read the games' full source code and to be able to
play them on Linux without bothering with Wine

~~~
PyroLagus
There is a really good Thief clone called The Dark Mod, but unfortunately,
it's not compatible with the original games.

[http://www.thedarkmod.com/main/](http://www.thedarkmod.com/main/)

~~~
steinuil
The community hasn't really warmed up to The Dark Mod as I thought it would. I
guess everyone's more comfortable with how the original games look and feel,
and I can't say I don't understand it. Thief still plays great thanks to its
minimal controls and UI (much unlike System Shock 1, which feels horribly
outdated) and looks nice thanks to its amazing art direction (just look at
some of the screenshots in here
[https://twitter.com/thiefbsp](https://twitter.com/thiefbsp)), so I don't
think people would feel the need to move on to a clone unless it was that much
better.

~~~
sparq_beam
Thief controls are still great, they feel "crisp". I think System Shock is
fine too, I even like using a mouse pointer to aim and interact with the
world. Ultima Underworld I find a bit harder to play.

~~~
khedoros1
In Underworld, I use wasdzxc keys for gross movement, and the mouse for finer
control. 1, 2, and 3 can control looking up and down. Using the control
scheme, rather than relying exclusively on the mouse, makes the game more
playable for me.

------
tibbon
I wish more older games would have their source released, even if not under
the GPL. I worry that for many games the source is simply lost forever. At
least put it out there for preservation in some way!

~~~
krychu
Agree, it’s been always surprising to me that companies don’t just release
sources after say 10 years.

I wish for Fallout 1 and 2 sources. I think there would be strong community
interest in hacking it.

~~~
openbasic
[http://flarerpg.org/](http://flarerpg.org/)

~~~
krychu
Great, thanks for sharing. I’m definitely gonna take a closer look at these.
Now imagine that the effort went into advancing the original sources rather
than rewriting things from scratch.

I think that many companies would agree to release sources of abandonware
games upon appropriate request from a fan base community, with the goal of
preserving, maintaining and advancing the original title. In fact this is
strategically beneficial action for the company, not from a financial
perspective, but you can imagine some extra attention and buzz being created
if the game was to be revived.

It’s possible that many companies are not even aware of devoted communities
around their older titles.

------
arnioxux
I hope [http://fabiensanglard.net](http://fabiensanglard.net) will do a code
review for this!

~~~
deaddodo
I'm not quite the programmer ~fabynou is, but I have been contemplating
following his example for awhile. This might be the right project for it.

------
damck
Dunno if just mobile problem, but most code has ^M instead of linebreaks; hard
to browse oneline source

~~~
jsheard
It's because the code was written on classic Mac OS, which used CR newlines
rather than the LF or CRLF styles used today.

~~~
shmerl
Well, they could just apply a minimal cleanup for end lines before posting.

~~~
pvg
Then the people who want to compile it rather than complain about it would
have to go through an extra hoop to fix it again. They published it the right
way.

~~~
Skunkleton
Plus, if they replaced the ^Ms, what would we have to complain about? This
truly is the best way. People can complain, and people can compile.

~~~
pvg
That is an excellent point although I suspect your question is going to be
answered in spades when people notice who the developer posting the code is.

~~~
Skunkleton
I don't know anything about this developer?

------
pete23
I can’t believe Github’s renderer fails on ^M.

~~~
mrpippy
I sent a feature request in 2016 to GitHub to support Mac line endings, it was
"passed to the team for future improvements". Not holding my breath.

~~~
ClassyJacket
This doesn't bode well for my wish to list file sizes...

------
opencl
There's also a fan remake that's been in progress since before the
kickstarter.

[https://github.com/JosiahJack/Citadel](https://github.com/JosiahJack/Citadel)

------
bananarepdev
"This source release does not contain any game data". Can somebody explain
what they mean by that?

~~~
khedoros1
It just has the game engine itself, without any of the images, sounds, maps,
etc that make it System Shock.

GOG has a System Shock: Enhanced Edition, which also includes the original
version of the game. I have no idea if that version of the data would work
with this version of the engine, though. The engine is for the PowerPC Classic
Mac OS version of the game.

~~~
Kristine1975
>I have no idea if that version of the data would work with this version of
the engine, though.

IIRC the Mac version doesn't use the original data files, but converted them
to use the Mac's resource file format. And judging from a quick look at the
source code it doesn't contain support for the original data files.

So: no, you'll have to use the Mac version's data files.

~~~
khedoros1
Thanks. I suspected as much, but haven't had the time to actually look at the
source code.

Looks like another bump in the road in getting this thing running on e.g.
Linux. It'll be interesting to look at reverse-engineered System Shock file
format info, and see if anything but the data-loading functions would need to
be changed, to use the more widely-available PC data.

From other comments, the sections in PPC asm and the actual I/O APIs would
have to be dealt with too.

------
chimeracoder
I haven't played System Shock 1, but this sounds like great news - I'm excited
to check it out.

System Shock 2 is the precursor to the more recent Bioshock franchise
(Bioshock, Bioshock 2, Bioshock Infinite). They're not part of the same
universe, but they share some of the same lineage, and the themes of the game
are similar.

To be honest, I didn't know there was still interest in System Shock 1.
Normally, Bioshock fans say to skip System Shock 1 and go right to System
Shock 2, but maybe that's just because the themes of the first wouldn't appeal
as much to Bioshock fans.

~~~
jandrese
The timelines are so different they could be in the same universe. Assume
plasmids died out when those sea slugs were harvested to extinction or
something.

------
anonfunction
Love this comment:

// yeah yeah, goddamn, gotta fix this.....someday....soon....i
promise....really

------
seany
Glad to see GPL3

------
amatecha
Nightdive has posted an update[1] which talks about the source code and
clearly says they are back to development. Most notably:

"We have been able to re-use the majority of work we’ve done over the past
year and we’re making significant progress in a very short amount of time.
With that said we’ll be inviting our highest tier backers to privately test
the game beginning in September at which point we estimate that the game will
be fully playable, from start to finish."

[1]: [https://www.kickstarter.com/projects/1598858095/system-
shock...](https://www.kickstarter.com/projects/1598858095/system-
shock/posts/2135868)

------
sandov
How difficukt would it be to port it to linux?

~~~
duskwuff
Nontrivial. There's a significant amount of Mac-specific code in the
application, including some PowerPC assembly.

------
elipsey
Awesome. I've been wanting to finish that, but I scratched my CDROM. True
story. Also, I don't have Windows 95 or an optical drive anymore. Is this one
of those deals where the art assets are removed?

~~~
amatecha
If you scratch a CD, as long as the scratch didn't scrape off the "label"/data
side, you can just buff the surface of the disc with Brasso (brass polish) and
a lens cloth. I'm not even joking -- you basically smooth away the scratches.
I've done this to restore so many scratched discs. Just make sure it's the
clear/thick side of the disc you're buffing, NOT the label (as the data layer
is just underneath the label).

------
mrpippy
Ooh more source code for classic Mac games! Most of the big PC games that have
source releases (like the id engines) just came with DOS/Windows source, not
the Mac ports.

------
TheForumTroll
Yet another reason I'm not backing on Kickstarter any more. Only good thing to
say about Kickstarter these days is that at least it isn't fig.co

------
Kristine1975
[https://github.com/ToxicFrog/shockmac/blob/master/ShockMac/G...](https://github.com/ToxicFrog/shockmac/blob/master/ShockMac/Game%20Src/BlitLargeAlign.s)

    
    
        inslwi   r0,r10,16,8
        insrwi   r11,r10,16,8
        rlwimi   r0,r10,16,24,31
    

How I missed this!

------
xedarius
I like is the fact the game is written in fixed point maths.

It's easy to forget that when this game was written computers either a) didn't
have an FPU or b) the FPU was so slow it was useless.

I bet if I searched through the code long enough I'd find a sin/cos lookup
table too :)

------
latte
Wow!

One question I have wanted to ask for a long time - why is the source code for
old games often released under a free license, but artwork and other assets
are not?

What are the incentives of the publisher in this case and why are they
different for the source code and for the asset?

------
Tloewald
I have a copy of _System Shock_ for Mac somewhere. I played it on the PC but
never finished it and picked up the Mac version later at a discount. I was
very disappointed to discover it had a crashing bug mid-game for which I could
find no workaround.

~~~
wlesieutre
Now that the source is published you can go back and fix it! ;)

~~~
Tloewald
Which sounds like a lot of work.

Oh, … and find an old mac to run it on …

Oh, and a copy of the right version of CodeWarrior.

------
DINKDINK
CodeWarrior, now there's something I haven't thought about in ages.

------
megaman22
Is there a particular reason this is only the Mac source code?

~~~
MrRadar
It's quite possible that's the only version of the original source code that
still exists. Many game studios didn't use source control even through the 90s
and once a game was considered "done" there wasn't much perceived value in
keeping the source code or original assets around. Consequently, many games
from that period only exist in release form.

Edit: I stand corrected on Starcraft.

~~~
duskwuff
> For example, Blizzard only has the source code to Starcraft because someone
> found a backup CD on eBay and returned it to them

This is a myth. Blizzard was already well on their way to releasing
_StarCraft: Remastered_ when that CD was found -- it's very unlikely that the
found CD contained anything unique.

[https://us.battle.net/forums/en/starcraft/topic/20757605637#...](https://us.battle.net/forums/en/starcraft/topic/20757605637#post-5)

------
DominoTree
This is probably my favorite game of all time and I really hope somebody does
something cool with this!

------
anc84
How can they be "Copyright 2015-2018, Night Dive Studios, Incorporated."?

------
skandl
Too bad you can't read any of it with the garbled ^M rendering on GitHub.

~~~
Kristine1975
Use this fork with changed line endings:
[https://github.com/ToxicFrog/shockmac](https://github.com/ToxicFrog/shockmac)

------
shmerl
Very interesting. So native Linux version is possible?

Thanks Nightdive!

------
fwip

      // We need a hack for inner bridge.  Inner bridge?  But I just met her!
    

The best part is always the comments.

~~~
ChoGGi

      // Returns whether or not in the humble opinion of the
      // sound system, the sample should be politely obliterated out of existence
    
      // look around at all my playthings
      // eighteen percent a year, for nothing
    
      // when all the leaves have fallen and turned to dust
      // will we remain entrenched within our ways
      // indifference, the plague that moves throughout this land
    
      // not in any way the right way to fix this bug, except
      // that it is the fastest way.  Doug says go.  Ask TJS.

------
BlindGod
Love SS1.

Will never forget the elevator music after relief after being chased by some
monsters.

------
kelvin0
Codewarrior => worse IDE I've ever had to use. You literally want to break
something/someone once you've used it for any extended period of time (PS2
Game console developement).

~~~
hoistbypetard
Really? I never did PS2 development, but I liked it for Mac stuff in the '90s
and Palm stuff a little bit after that.

My recollection is that it was much nicer to use than Think C, and absolutely
blew the doors off Visual C++ 1.5 and 4.0, which were the other IDEs I had to
deal with at/around the time I first picked up CodeWarrior.

The Apple Code Fragment Manager (PPC dynamic loader) made me want to break
things sometimes, but for its day CodeWarrior was a breath of fresh air, as I
recall.

~~~
kelvin0
We were shipping the games on 3 different consoles, shipping on the original
XBOX with it's superb integration to Visual Studio was such a breath of fresh
air, and allowed you to debug directly and step through your code on the
console.

Not so much for PS2 and Code Warrior, which was a pain to use and was
integrated as an after thought to the PS2 SDK. So maybe using CW on Mac worked
well (at the time), but targeting some other machine than the one running the
compiler was painful at best with CW.

Sorry to ruffle any CW fans out there, but until you've used it to do PS game
dev, you won't know the atrocities our team went through.

