Okay. This was GOING to be a Halloween story, but ... well, you may notice it's nowhere near Halloween. I think I can say without a doubt that this is the most difficult story I've written to date, and certainly the one with the most rewrites. There'll be a more detailed author's note at the end, describing some of the plot-related reasons why it took nearly a year to finish. This story utilizes a prompt from Kodiak Bear Country ("ghost story") and a couple of prompts from the Spook Me Ficathon on LJ, which will not be revealed until the end, for fear of giving away plot twists. I'm taking a fairly ... liberal interpretation of all of the prompts, but then, it's the SGA universe, where nearly everything can be canon if you twist it enough ...
Title: Ghost in the Machine
Author: Sholio, a.k.a. Friendshipper on LJ
Rating: T for violence/language
Characters: Primarily Sheppard and McKay (of course)
Season/Spoilers: Early-to-mid season 3. General spoilers up to that point in canon.
Summary: The boys are trapped on a world with a malfunctioning Stargate, a monster ... and a mystery.

Note: This is a reposted version of this chapter.

Prologue: Sundown

Bathed in the warm shafts of sunlight slanting through the trees, the old man toiled. Even the summers on this world were cool, but between the exertion and the rare sunshine, he was almost too warm. He'd stripped off some of his furs and tied his loose leather shirt around his waist, revealing strong arms creased with scar tissue and knotted with muscle from years of physical labor.

His arms rose and fell, rose and fell, scooping the loose soil of the forest floor with a shovel that he had made himself from wood and bone. Every so often, he had to stop to tighten the leather straps holding the handle to the shovel's makeshift blade, his hands moving deftly despite two missing fingers on the left. It was during one of these breaks that he noticed the growing chill in the air, and raised his one eye to the sky. A band of fear constricted his chest when he saw the sun peeking low and red between the trees.

He whispered a soft profanity, throwing the shovel aside and clambering out of his hole. Fear made him clumsy as he gathered up his scattered furs, knapsack, and the crossbow that was never far from his reach. He'd been so engrossed in his work that he hadn't even noticed the gathering dusk under the trees. He was not a praying man; in fact, he couldn't remember the last time he'd done anything other than curse a deity. But he muttered to himself, under his breath, in fervent hope that he hadn't waited too long.

Despite his urgency, he had to pause to look back on his handiwork. He'd made a lot of progress today, but there was no telling when he'd get another sunny day and be able to come down from the hills to dig again. By that time, it might have undone everything he'd managed to accomplish, if it was so inclined. He never really knew. Sometimes, he had returned to find his efforts destroyed, while other times, everything was completely untouched -- and he had no idea why.

But there was no time to wonder about it now, not if he wanted to survive to dig again another day.

Picking up the shovel, he began to run through the trees.

He was in good shape for a man his age -- not out of choice, but necessity. However, it had been a long, hard day, and the ache in his joints grew into a dry, burning pain as he jogged down the familiar forest path. He hissed softly with each breath out, willing himself to breathe through the pain. It was going to be a restless, sleepless night -- assuming, of course, that he survived long enough to have a chance to sleep. Maybe he'd get drunk tonight. His homemade wine was harsh and dark -- matching his moods, most nights -- and had enough kick to deaden not just physical pain, but mental as well.

He had plenty of both kinds, but never enough wine.

Topping a low rise, he paused to catch his breath. The sky was awash with red and purple. He supposed it was probably beautiful, but to him, the colors meant death, because they heralded the coming of night -- and night was its domain. To his left, one of the towers was clearly visible above the trees, mocking him with its silent and inscrutable presence.

Around him, the forest lay eerily silent. He could remember when these trees rang with the calls of exotic birds, and his crude traps were rich with small furry creatures. These days, he had to hunt farther afield in order to find any sort of game at all, and the animals that he could catch were scrawny and wary, driven to the edge of starvation from constant running. Once, he had depended on the birds to warn him of its coming, because they fell silent when it was around. Maybe that was why it had killed them first.

Eventually, he could foresee a time when the only living things in the forest would be him, and the creature that hunted him.

"But it'll never get to that point if you die tonight, you idiot," he whispered to himself, and jogged down the other side of the ridge, towards the creek. He could use the running water to confuse his trail, maybe throw it off the track if it was following him.

He might be lucky. Sometimes weeks, even months went by when he didn't see any sign of the creature. It had to range far and wide in order to meet the demands of a rapid metabolism that demanded frequent, fresh sustenance. But on the sunny days, it would be nearby, because it had learned that he would be outside during the day, and perhaps it hoped that one of these days, he would be too slow returning to safety.

He wondered if it was capable of thinking on that level. Sometimes he doubted it. Other times ... he wasn't so sure.

He wasn't looking up when the sun slipped below the edge of the world, but he could tell from the sharply increasing chill in the air. Exertion helped keep him warm, but he still appreciated the warmth of the fur cloak over his shoulders.

Now that the sun was down, the creature would be abroad. He could only hope that it wasn't in this part of the forest. Wish in one hand, crap in the other, and see which one fills up first. His grandfather used to say that, long ago; and the old man's lips twisted a little at the bittersweet memory.

His leather boots splashed in the shallow waters of the creek, and he jogged swiftly upstream. He left the streambed at a little waterfall, stumbling a bit, and climbed over a field of loose rocks where he would leave few tracks.

At this point, he had a choice to make. Over the years, he'd cultivated a number of hide-holes. They weren't comfortable, but they were safe -- places where he could spend the night when darkness caught him too far from home. If he kept going up, he would come to one of them. It was closer than the modified cave that he currently called home. On the other hand, his aching joints begged for a soft bed, and his stomach growled for something more substantial than the handful of jerky that he carried in a pouch at his belt. And, at home, there was wine.

"Don't try to go home. There's no time. Use the bolt-hole instead."

He didn't flinch when the voice spoke. Didn't acknowledge it in any way. Certainly didn't take its advice. It sounded so real ... as if the speaker stood at his shoulder, as if he could just turn around and see --

A man could go mad that way.

He suspected that he was already halfway to crazy. He thought he was entitled to it, frankly. But that didn't mean he had to go gently, oh no.

"You're not real," he said, aloud, between harsh gasps for air. "And I'm not doing a damn thing you say." His voice rasped in his throat, rough and low -- his vocal cords had been damaged years ago, the larynx bruised and nearly crushed, in the same fight that had cost him the fingers on his hand.

The voice didn't speak again, and he needed no other confirmation that it was merely the product of an aged, lonely and desperate mind. It was just his subconscious voicing his own fears. But he had confidence in himself. He could make it home long before the creature picked up his trail, if it ever did.

He turned the downhill way, scrambling from rock to rock. It was faster this way, moving with gravity rather than fighting against it. All he had to do was make sure not to twist an ankle -- if he did that, his fate would be sealed. But he made it to the bottom intact, and then he ran across the pine needle carpet under the trees with a speed that belied his age.

A low mist was rising, as it always did at this time of evening. Beneath the trees, the shadows had grown deep, and he stumbled on unseen obstacles as he trotted across the rough ground.

Then behind him, far behind him, a shrieking cry rose on the cool evening breeze. It sounded a little like a hawk or eagle. But there were no birds in this forest, not anymore.

No, he thought. It had found his trail.

It couldn't track by scent -- at least, he didn't think it could. Maybe it would lose his trail at the creek. But he pushed himself from a slow trot into a run, as his creaky joints protested.

The hunting cry came again. Closer. It had crossed the creek.

No point in trying to confuse his trail now. All he could do was run. He thought he'd been at his limits before, but he dredged down deep inside himself and found a little more strength. His breath came in ragged gasps as his feet pounded the ground.

Carrying both the shovel and crossbow slowed him down. Reluctantly, he threw aside the shovel. He hated to lose it, because it was a good one and if the creature destroyed it, he'd have a hard time making a new one that worked as well. But he'd need both hands to operate the crossbow, and he had a feeling it was going to come to that. As he ran, he worked his bag of short wooden bolts around to his side where he could easily reach them.

He had fire-making supplies in his knapsack, along with a torch -- a dry stick of pine wood with a knot of flammable resin at one end. Fire would sometimes drive the creature off, though not always. But he didn't dare stop long enough to light the torch.

He was so very close. Just over the next rise.

The forest was so dark now that he almost didn't see the flicker of movement in the woods off to his right.

No. No.

It was quick and sinuous, a black darting shape, here and gone in the blink of an eye. He would never get used to how fast it could move. For an instant he caught the gleam of eyes in the dark, and then he lost sight of it again.

He was reaching the end of his strength. Red spots danced in his vision, and a searing pain split his side. For a fleeting instant he wondered if he might have managed to run hard enough to cause his aging heart to fail. Of all the possible ways to die in this forest, it would not be the worst, by far.

He came over the hill, and there was the heavy wooden door that he'd built into the cliff, half-obscured by artfully placed moss and brush. In the dusk, he almost didn't see the dark shape crouching in front of it -- wouldn't have seen it, if not for the sunset's light reflecting in its eyes, turning them to twin sparks of molten gold in the darkness. It had circled around, gotten in front of him. It was waiting for him.

He could have wept. He'd lived here for nearly a year, always careful, always hiding his tracks. Now he had led it here, yet again, and he would have to find yet another place to live, yet another temporary haven that it would find sooner or later. It always did.

No time to stop, to rest. He couldn't give himself a moment's respite. He charged down the hill, pausing only for an instant to bring up the crossbow and fire.

His aim was good, but then, he'd had lots of practice. The bolt thunked home in the creature's chest. He was already reloading as it let out a shrill cry, more of anger than pain, and leaped towards him, moving so fast it seemed to flicker in and out of his vision.

His second shot went through a leg -- clean through, the bolt penetrating so deeply that it stuck out the other side -- and it stumbled as the leg crumpled under it. A shot like that would only slow it down for a moment, but it gave him the chance he needed. He dashed the last stretch to the door, dropping the crossbow to fumble with the complex bolting system that he used to ensure the creature didn't gain access to his home while he was away.

From the corner of his eye, he saw it pick itself up for another leap. But the door was open; he threw himself across the threshold, slammed the door and flung the bar down just as the creature's body thudded into the wood. The door shook, but the heavy bar held. He'd lost the crossbow, but it wasn't the only one he had.

With violently shaking hands, he began moving the rocks that he kept inside the cave, dragging and piling them until the door was nearly blocked. The dull thudding continued as the creature threw itself futilely against the door, and then that sound was replaced by the gut-shivering scraping of long, wicked claws tearing the wooden planks into dull splinters.

Instinctively he raised a hand to his face, touching the torn flesh where his left eye used to be. He knew firsthand how sharp those claws were.

But the wood of the door was solid and heavy, several feet thick, more of an airlock than a door -- and much more resistant than fragile human flesh. He listened to the muffled sounds of scrabbling, and the high-pitched whining cries of frustration. He knew from experience that it would try all night, until either hunger or the light of dawn chased it away. The amount of damage that he'd inflicted on it with the crossbow bolts wouldn't do more than just make it more determined to reach him. It would be fully healed in a few hours.

It was pitch dark in the cave, but he didn't build a fire yet. Instead, he felt his way over to the pile of furs where he slept, and dug beneath them for the object he knew he would find there. Not the wine -- though that would come later. The thing he was searching for gave him less comfort than wine, but more courage. It reminded him of the reason why he kept fighting, why he kept running, why he kept digging day after day. It was both his shame, and his salvation.

He found it, and his fingers closed over the smooth surface, pulling it out. It was a box, about as wide as the length of one of his hands, and a hand-and-a-half long. He didn't open it, just held it to his chest.

Outside, the creature snuffled and clawed at the door, shrieking its frustration.

Inside, the old man knelt in the dark room, clutching the box like a child's doll. Eventually, despising himself for his weakness, he began to cry.