PLAY THE GAME - GitHub
I vibe-coded Voidstruck over 4 days. It's a procedural space exploration game with 150 million star systems, fitting into one 299 kB HTML file that runs in your browser.
Every planet can be landed on (except for gas giants). You can fly low over and step out to explore on foot and by jetpack. Every star, planet, moon and name is generated from a seed as the player progresses. There are no images, models, audio files or libraries.
The story: A jump drive test goes wrong and throws you 2,500 light years from home. You make your way back one jump at a time, but every jump costs years on Earth. Messages from home reach you along the way, and what you find when you land depends on your actions.
On the way you can refuel in a starâs glow, pass pulsars, white dwarfs and black holes, each with its own look and music. There are eight kinds of worlds, from ocean and lava to crystal and living ones, with plants, animals, weather, and day and night. You can also mine, build bases that earn credits while you travel, upgrade your ship at stations, and fight or flee raiders. The galaxy also features our own solar system. There are four ships to choose from and a one-life hardcore mode, and the ten music pieces are synthesised live in the browser.
The inspiration came from my obvious passion for space exploration games like No Manâs Sky and Elite Dangerous. But recently, Abyssal Garden, made by a fellow redditor, opened my eyes and gave me a huge push to actually create it.
Claude (Fable 5.2) wrote it in Claude Code, and it took me about four days and 170 commits. My part was the idea, the story, and the taste: I picked every look from mockups, sent the space stations back four times, and chose the music by ear from sketches, because the AI can't hear what it writes.
How Voidstruck was actually made:
Voidstruck is one HTML file of 299 kB. It uses no game engine, no libraries and no asset files. When you open it, there are no images, models or sound files to load, because there aren't any. Everything is computed while you play.
No libraries at runtime. The game talks to the browser directly: WebGPU for the picture, the Web Audio API for sound, plain HTML and CSS for menus and maps. The only tool in the whole project is esbuild, which bundles about 9,400 lines of JavaScript and WGSL shader code into the single file.
The galaxy is a function, not data. Every star is worked out from a seed and its coordinates, with an integer hash and a small random number generator (mulberry32). The disc is 14,400 light years in radius, cut into sectors of 4 light years, and nothing is stored: the same seed always gives the same stars, planets, moons and names. The code that makes the whole galaxy is 9 kB.
Space is drawn by shaders. Stars, planets, rings, nebulae, the black hole and the jump tunnel are fragment shaders, not textures. Each planet's surface is baked once into a small map with a colour table when you arrive. A glow pass picks out the bright parts at quarter resolution, blurs them and adds them back.
Planets are that same map, walked on. Flying down, one full-screen pass marches each ray of sight over the planet's baked surface, so the ground you land on is the planet you saw from orbit. Close to the surface the ground becomes a real mesh of seven nested grids, each twice as coarse as the last, with shadows.
Plants and animals are recipes. A tree, a fern, a fungus or a spire is a "family": a recipe with a handful of dials. Each planet rolls its own species from its seed, so no two worlds grow the same things, and the same world always grows the same ones. The shapes are built as triangles on arrival. The cities of Earth are made the same way.
All sound is synthesised. There are two music systems:
- In space, music is composed as it plays. Each star system draws a key, a mode, a chord sequence and a short tune from its seed, and each kind of star has its own arrangement, so nothing loops and no two systems sound the same.
- Ten written pieces are stored as text: melodies on a sixteenth-note grid ("E5:4" is E5 for four sixteenths) over chord symbols, played by instruments built from oscillators.
The instruments are FM synthesis (one oscillator bending the pitch of another, for bells and electric pianos), detuned saw waves through filters for plucks and pads, and filtered noise for engines, fire and explosions. Even the reverb is synthetic: the "room" is a burst of generated noise that dies away, used as an impulse response.
The rules are separate from the picture. Flight, heat, fuel, jumps, trade, combat and the story are plain functions with no drawing in them, stepped at a fixed rate. That makes them testable outside the browser: 192 automated tests run through them, including whole journeys home.
Where the kilobytes go (roughly):
- Drawing space: stars, planets, rings, the ship, the jump tunnel: 75 kB
- Menus, maps, the flight display and every line of text: 60 kB
- Planet surfaces: terrain, plants, animals, cities: 50 kB
- Music and sound: 45 kB
- The rules of the game and its story: 40 kB
- Input, saving, the main loop: 17 kB
- Making the galaxy: 9 kB
It works best in Chrome or Edge on a desktop, full screen, with sound on.
Itâs free, with no ads and no account, and you can play it offline. If something breaks or feels off, please tell me.