WILL THEY HACK THEIR WAY BACK HOME?

Situational Programming — The Icarus Project

A Deep Space Adventure

Hector Gray
Situational Programming
11 min readOct 23, 2013

--

Part One: Anti-matter

“IT’S COLD, DAMN IT! Yes the climate system’s on the fritz… Fritz?! Screw it, Jack messed it up big time, but with out him we would of been frozen dead 3 weeks ago!”
— Captain Sterling

Captain Sterling was trying to calm us down with facts again, setting expectations as realistically as he could but we all figured that we were pretty much damned. An elite crew, sure but we were five people on a sixty-three day voyage drifting that-a-way through space, and it was really starting to feel as if everyone was losing faith…

“FAITH!?!“
— Captain Sterling

Did I say that out loud???

“You have two options here soldier, either believe in yourself or go ahead and think that you’re destined to be another speck of dust lost forever in space…”
— Captain Sterling

He floated towards me the entire time he was talking, almost assuredly to be in the best position to shout in my face…

”AND IF THAT’S THE CASE, I NEED YOU LET ME KNOW RIGHT HERE, RIGHT NOW! HELL, LET ME KNOW EVERYTHING THAT MIGHT CAUSE IT IN THE FIRST PLACE SO I CAN STAND UP AND BE THE HERO YOU’LL NEVER BE!”
— Captain Sterling

I f**king knew it. The good thing is, shouting in zero gravity means the spit doesn’t always end up in your face, but his point was clear, he could be as much of a jackass as he wanted right now, because I’d be the one wearing that badge if I started giving up now or bringing this crew down in anyway. I shouted back, “WEAPONS & ENGINES, CAPTAIN STERLING SIR.” Which is exactly what I’ve been working on for the last month. Jack’s on climate, Susan’s on health systems and Steve is handling navigation, with the Captain we’re all that’s left of the EX-Type spaceship Icarus, and hell if the name wasn’t enough to scare you, look at us now…

A half destroyed spaceship, one light year from earth, spinning awkwardly through space, with some promise that at our current velocity we might make it home before dying of old age. The good news? Any power we could generate if we hit any more anti-matter, though this all just reinforces my feelings that this could be the worst test flight… ever, but I guess “Airman First Class — Field Test Division” beats being a Helium farmer on Mars or shuffling Earth dirt to the Moon, though my little cousin Robbie swears he’s a millionaire in the lunar colonies.

Icarus was designed to be the most advanced spaceship ever made, sporting a modular and open design that’s also controlled by a single operating system: HALOS GAMMA EX-OS. The ship is made up of seven detachable chambers with bunks and an infirmary in the rear chambers, a few general work areas in center of the ship and the control room in the front . That’s also where all of us were when a stream of solar wind slammed head straight into us, and every single interface in the control room immediately went blank…

There was mild physical damage to the outside of the front of the ship but we saw how f**ked we really were after all the controls shutdown completely and the systems they controlled went into an emergency state. Suddenly the fuel cells attached to the outside of the control room chamber burst into flames and the plasma residue surrounding the ship started glowing bright orange, we had to move even faster to get hold of the situation. It didn’t seem nearly fast enough but we managed to evacuate and dispatch the control room chamber in less than twenty-seven seconds, beating the academy record by half.

The whole crew floated in awe as an explosion engulfed the control room. I was breathing frantically, desperately trying to remember every difference between an anxiety attack and a stroke. I also had to keep reminding myself that this… even crazy shit like this, was exactly what I signed up for.

“In the case of an emergency remain calm and retain control of the ship, an emergency beacon will broadcast while available healthy crew members ensure the health and safety of others.”
— The Manual

I remember those words being a lot more assuring in the mission briefing, but even then we knew we wouldn’t always have the luxury of help throughout the entire mission. This was the virgin journey and final proof of concept of the extreme-distance spaceship Icarus, wildly acclaimed as the best spaceship that Earth could put into outer space. We still had to be ready for any edge event that might pop-up, that’s what they called it… an edge event was a worst-case natural event that could put the Icarus out of commission, and if one did occur it would be up to us, to do what it takes to get back home.

Now the Icarus is one chamber down and we’ve been working night after night to get control back of the ship, our tablets allow us to log in to each systems console but it’s going to take some time to regain control of the systems we lost after the explosion. Steve has automated a path for the ship to start following the solar wind that hit us, our plan-b is to keep absorbing any anti-matter that’s left in its trail, allowing us to stay powered while we get all the systems back online, and the ship headed back home at the same pace we got here in, or at the very least continue absorbing enough power to just, stay alive…

Icarus has laser energy cannons on both wings of the ship and directional rockets underneath the chambers, so far it seems only the rocket power regulation system in the last chamber is working at all and we’ll need all of them if we want to keep up with that solar wind trail. I am going through the sixth chambers code and updating it to send power to the rockets in the other chambers as well. I confirmed the ships power grid can handle the distribution but these chambers just aren’t that integrated out of the box, thankfully all the ships components are on a network, so at least they can talk to each other.

THERE IT IS! I think this might be the code I can update to send power to the rockets in the other chambers…

//@info:The power regulation functions must properly control the rockets power to ensure a safe flight.  
function RocketPowerRegulationSystem(current_chamber, peer_chambers) {
var self = this;
self.regulate = function () {
var failure = false;
peer_chambers.forEach(function(peer_chamber) {
//@info: DO NOT FIRE CHAMBERS IN DIFFERENT DIRECTIONS!!!
if(peer_chamber.direction!=current_chamber.direction){
failure = true; // catastrophic failure
return true;
}
});
if(failure) {
current_chamber.direction=GEO_SPACIAL_LOCATIONS.HOME;
current_chamber.power = 0;
return false;
}
//@info: if no power issues, continue increasing power.
if(!current_chamber.power_notifications && current_chamber.power < current_chamber.requested_power) {
current_chamber.power++;
} else if(current_chamber.power_notifications || current_chamber.power > current_chamber.requested_power) {
current_chamber.power--;
}
}
}

I opened a communication line with Captain Sterling to let him know we have a chance here.

“Step me the through how the system works, I don’t want to see any changes that could put us in a place colder than what Jack already has us in.”
— Captain Sterling

I told him what I saw… when the power regulation system is created it’s passed control of the current chamber and all connected chambers (the peer_chambers). The code checks the direction of the connected chambers to make sure they don’t start firing in opposite directions, that would cause the chambers to detach and then we’d really be toast. The original programmer added a safety check, so when it occurs the rockets are powered down and the direction is set back towards home instead of actually allowing it to happen. The next lines of code simply increase or decrease the power until it reaches what the controls have requested or power notifications in the chamber start firing off. I’m sure the code embedded on the actual rocket device is much more complicated but I sure am glad this API is usable.

“What’s the patch solider!?”
— Captain Sterling

I took a deep breath as a drop of sweat floated away from my forehead, this wasn’t exactly rocket science but our lives were on the line. The patch I had to write seemed simple enough, this function had to send power to all of the chambers instead of just this one. I decided on using a nested function and some Array hacking to get the job done.

“It doesn’t sound like it’ll blow us up into too many smithereens but don’t get my hopes up too high, let me know when it’s tested and I’ll apply the patch to the ship.”
— Captain Sterling

First things first, let me wrap the power regulation logic in a function so I can use it to regulate the power in the chambers throughout the rest of the ship.

//@info:The power regulation functions must properly control the rockets power to ensure a safe flight. 
function RocketPowerRegulationSystem(current_chamber, peer_chambers) {
var self = this;
//@info: nested function to handle any power regulation.
var actually_regulate = function(current_chamber, peer_chambers){
var failure = false;
peer_chambers.forEach(function(peer_chamber) {
//@info: DO NOT FIRE CHAMBERS IN DIFFERENT DIRECTIONS!!!
if(peer_chamber.direction!=current_chamber.direction){
failure = true; // catastrophic failure
return true;
}
});
if(failure) {
current_chamber.direction=GEO_SPACIAL_LOCATIONS.HOME;
current_chamber.power = 0;
return false;
}
//@info: if no power issues, continue increasing power.
if(!current_chamber.power_notifications && current_chamber.power < current_chamber.requested_power) {
current_chamber.power++;
} else if(current_chamber.power_notifications || current_chamber.power > current_chamber.requested_power) {
current_chamber.power--;
}
};
self.regulate = function (current_chamber, peer_chambers) {
actually_regulate(current_chamber, peer_chambers);
};
}

OOOUCH!!! — The communication piece in my ear squelched in what’s gotta be the best clarity I’ve heard from it yet, it’s the Captain and it sounds like we are in another emergency state all together…

“Looks like more bad space weather headed our way, awall of plasma is headed for impact in five minutes and thirty-two seconds, let’s get those rockets patched!”
— Captain Sterling

I have to get the actually_regulate logic distributed to the other chambers before it’s too late.

The code shows that peer_chambers is an array, so it’s pretty much a list of the connected chambers in the ship. I also know an array has two functions I can use to help me call the actually_regulate function easily, shift & push. Shift will give me an item from the beginning of an array and Push will let me add an item to the end of an array. I should be able to shift a chamber from the bottom of the list, and pass it to actually_regulate function using the array of other chambers as the value for peer_chambers,when that completes I would push the same chamber to the end of the list and shift another chamber from the bottom, continuing to do this all in one loop for all of the other chambers…

This just might be enough to save us, DAMN! Only four minutes -fifty-two seconds left.

//@info:The power regulation functions must properly control the rockets power to ensure a safe flight. 
function RocketPowerRegulationSystem(current_chamber, peer_chambers) {
var self = this;
//@info: nested function to handle any power regulation.
var actually_regulate = function(current_chamber, peer_chambers){
var failure = false;
peer_chambers.forEach(function(peer_chamber) {
//@info: DO NOT FIRE CHAMBERS IN DIFFERENT DIRECTIONS!!!
if(peer_chamber.direction!=current_chamber.direction){
failure = true; // catastrophic failure
return true;
}
});
if(failure) {
current_chamber.direction=GEO_SPACIAL_LOCATIONS.HOME;
current_chamber.power = 0;
return false;
}
//@info: if no power issues, continue increasing power.
if(!current_chamber.power_notifications && current_chamber.power < current_chamber.requested_power) {
current_chamber.power++;
} else if(current_chamber.power_notifications || current_chamber.power > current_chamber.requested_power) {
current_chamber.power--;
}
}
self.regulate = function (current_chamber, peer_chambers) {
actually_regulate(current_chamber , peer_chambers); //@info: regulate the power for this chamber.
var last_chamber = current_chamber;
//@info: regulate the power for the other chambers also.
for(var i =0; i<peer_chambers.length; i++) {
//@info: add last chamber to the end of the list of peers.
peer_chambers.push(last_chamber);
//@info: get and remove the first chamber in the beginning of the list from the list entirely.
var chamber = peer_chambers.shift();
//@info: regulate the power for the chamber we just removed.
actually_regulate(chamber, peer_chambers);
}
};
}

I’ve let the Captain know that I have a patch ready to go, now the text on the monitors are flashing red… we only have three minutes and eight seconds left until impact with the plasma stream.

“You get a chance to test that Soldier?! Or is there something else we should be praying doesn’t happen?”
— Captain Sterling

My code was sound and I was sure of it, not to mention we don’t have time to write tests that would do as good as proving space still has zero gravity. I have to own up to this kind of decision though, it’s a brave move to go untested but it’s everybody’s life that’s in danger if my code fails.

“Great, was writing it in half the time with twice the number of tests out of the question? Jack get over there and review the code while I apply the patch, better late than never but — I REALLY DON’T LIKE BETTING THE LIVES OF THIS CREW ON STANDARDS THAT LOW SOLDIER!”
— Captain Sterling

I wonder if being a dick is something they teach you in Officers School…

I committed my updates to the system and tossed Jack my console to review the changes. I then went over to the Captain to let him know he could restart the Power Regulation System, staring directly into his eyes while I gave him the okay. I wanted him to be sure of how confident I was about my code, I knew it would get us out of this but ultimately the decision was still up to him. Captain Sterling was the only one with permissions to actually apply any patch that gets committed to the ships code branch.

The Captain looked back at his console and began the restart process,this was the most dangerous part of all, I could hear half the crew hold their breath just as he started. After the solar wind hit us we noticed a few systems behaving especially fragile, a restart could mean none of the rockets coming back online at all, and this was our last chance to escape.

“IT’S HERE!!!”
— MSgt Susan Carpenter

Every siren & warning light was going off through out the ship, it’s the two dminute point and the Captain is going to need another thirty seconds to finish initiating the restart. I floated to the window to see the huge stream of plasma heading our way, it was wide as the window itself and from the best I could tell at least three miles high…

“WTF?!”
— SrA Jack Fox

The power finished shutting down in the sixth chamber and it sounds like Jack just about lost his marbles when it happened, with a huge stream of death heading our way my heart skipped a few beats as well. Jack tossed me the tablet and signed off on my updates just as I started to hear more of the generators starting to hum. It sounds like the sixth chamber has almost regained all of its power which means the rocket power regulation system should be kicking in any millisecond now, I grabbed on to one of the handrails bolted on the wall and communicated to the team to brace for quick acceleration, this was going to be a rough ride.

“Attention crew... If we do manage to stay in it path, we’ll have fifty-eight seconds until impact. Now is the time to be ready for anything.”
— Captain Sterling

As the Captain finished his sentence the Icarus started tipping forward in space, at least this meant the rockets in the sixth chambers were still working. As the other rockets reached peak thrust we pushed ourselves above the path of the plasma stream. Now that we were cleared of any of danger the crew turned in amazement to watch the plasma that passed below us, it was almost as if being able to watch the spectacle was our reward for surviving it.

Suddenly it looks like it’s getting pretty crazy, and fast. The trail from the Icarus to the location we had left behind began glowing in a streak of blinding white, that was also spiraling straight towards us. The crew all faced each other looking more and more frightened and confused by the phenomena headed our way, well everyone except for… Steve!?

To Be Continued…

Next on The Icarus Project: Gremlins & Gamma Rays

If you enjoyed this story, please recommend it to other readers below & thanks for reading! :)

--

--