Hacker News new | ask | show | jobs
by dsr_ 2867 days ago
We Were Gods, by Alex Feinman. Among other things, it contains an amazing scene describing an attack on a race condition from inside a fantasy game's magic system.

Here's part of it:

Giggling a little from the alcohol, the four points began the slow juggling routine I'd sent them; just a simple ball passing, in rhythm. Pass, pass, pass. Throw and catch in the same instant; the balls went round and round until all four were landing in palms at the same time, four little smacks merging into one sound. Their avatars were better at this than they were. After a moment I threw another ball in, then another, until there were eight in the circle: four in the air, four in the hand. Faster and faster they went round, until there were little streaks of light behind them, until the streaks almost formed a complete, rippling circle.

Around us the world leaned in, currents of energy creating a field of magic potential. Rhythmic motion always attracted the attention of the underlying world routines as they struggled to incorporate it into the ebbs and flows of the wind and water; a vortex here, at one of the two hearts of the world, drew a lot of processing power. And each point of the cross was a magic-using engine; those strands of energy consumed a surprising amount of resources. But the real trick was the synchronization: slight imperfections in the coding routines for distribution and rationing of magical energy made them susceptible to a timing attack. It was a matter of chance, though; each time the circle tossed and caught, quanta of energy were requested at nearly-identical times. Sooner or later the system would try to service two at once and--ah.

One of the balls vanished momentarily, lost to accounting for a brief instant before the system found it again. It left a tiny kink in the circle of light as it passed: an opening, into the collection routines. This was what my watch-spell was waiting for: a chance to insert my own instructions into the information transmission stream: instructions that said 'open', 'open'.

https://www.smashwords.com/books/view/396337