r/proceduralgeneration • • 11h ago

467M stars, billions of planets, all from one seed and every one of them can be visited. How I generate the galaxy for my space game

79 Upvotes

I'm making a space game about exploration, resources and combat, and the galaxy it all happens in is fully procedural. I've spent most of the last months on it so I figured this sub would be the right place to show it and explain a bit how it works.

Everything comes from one seed. From there you get 467,561,373 stars, about 4.9 billion planets and 8.2 billion moons, with their orbits, atmospheres, chemistry, geology and terrain. Nothing is stored on disk. It's not a skybox with a few handmade systems either, you can fly to any star, go into its system and visit any planet or moon, it gets generated when you arrive and anyone who goes there sees exactly the same thing, bit for bit. I ran a full census walking the whole galaxy star by star with the same code the client uses (no extrapolating from a sample) so those numbers are the real ones. Only about 1 star in 100 has no planets at all, around 185 million planets have liquid water oceans, 1,852,531 have life, and theres 281,081 neutron stars and 186,578 black holes, because a galaxy without weird stuff to hunt for is boring.

Planets aren't random rolls. The chemistry comes from the rock/metal/ice mix the planet formed from, and its calibrated so Earth comes out within about a point of its measured composition. The first version had something like 16% nonsense planets, frozen oceans at 200 °C and that kind of thing. Now the generator works out the final state for every candidate surface and throws away the ones that contradict themselves. Zero contradictions in the census, which honestly took way longer than I'd like to admit.

Terrain height at any point is just a function of its 3D position: improved Perlin plus a ridged multifractal (Musgrave style), with every octave rotated so the mountains don't line up with the noise axes. Because it's a function, zoom is basically free, the whole globe and a bit of coastline are the same function sampled at different resolution. Small moons aren't spheres either, there are nine shape families based on real bodies like Phobos or Arrokoth.

Determinism was the hardest part by far. Same algorithm isn't enough, it has to be the same bits. Mono in the editor does float math at double precision and rounds whenever it feels like it, IL2CPP and .NET round after every operation, so roughly 7 in 25,000 stars had a different temperature depending on where it ran. The fix is ugly but it works: an explicit (float) cast after every single operation in the generator, no Math.Pow or any library function whose last bit depends on the platform. I also reimplemented Unity's RNG and checked it draw by draw against the real one, and the density maps are read with my own PNG decoder because Unity was compressing them on import and changing 36% of the pixels.

Rendering was the other big one. The first version had a GameObject per star and flying around ran at about 19 fps. Now all loaded stars live in a single GPU buffer drawn with one draw call per camera, a background thread sorts them back to front, and new sectors get generated in the background while you fly. When you travel to a star the camera doesn't actually move, the universe moves around it, so everything stays close to the origin where floats keep their precision. From 19 to around 400 fps.

On the game side every world gets a 0-10 rating for minerals, rare earths, energy, water, food and jump fuel, plus hostility, all from its actual data. The world map at the end of the video splits the surface into 32 cells and each one gives resources based on the real terrain under it, coast gives water, a volcanic slope gives geothermal, an icy moon over an ocean gives water and not much else.

The video is captured straight from Unity, still in development. I'd really like to hear what you think, and if you've built something similar, how did you approach it and what gave you the most headaches?


r/proceduralgeneration • • 16h ago

A night in the necropolis: 1-bit isometric heroes vs undead (made together with mmorwynn)

151 Upvotes

This is a co-op bundle I made with mmorwynn. He draws the 1-bit isometric tilesets: the necropolis in the picture, plus a cathedral, ruins, a prison, a dead forest and nature. I made the animated characters that walk around in them: 20 heroes and 16 undead.

Everything is pure black and white, so the sprites sit on his tiles without any colour fixing. Each character has 8 directions and idle, walk, run, attack, hit and death animations. The undead also have a rise animation for climbing out of the ground.

My characters are rendered from 3D poses by a pipeline I built with Claude. The design, the poses and the checking are mine. The tilesets are mmorwynn’s.

I’m happy to answer questions about how the 1-bit shading works.


r/proceduralgeneration • • 11h ago

New look for the simulated snow in my snowplow prototype

50 Upvotes

New look for the snow: instead of round beads it is now drawn as small blocks, each turned and shaped a little differently, and lit by the shape of the drift they lie in. Loose snow tumbles, packed tracks stay smooth (early prototype)


r/proceduralgeneration • • 8h ago

My Crashing Waves attempt

22 Upvotes

WIP on my crashing waves, going to add proper foam but It turned out pretty well so just wanted to share so far.


r/proceduralgeneration • • 1h ago

Some procedurally animated monstrosities made in our game

Thumbnail
gallery
6 Upvotes

All of these little guys are made from simple modular parts snapped together by the player.

Unreal's native attachment system came with some peculiar overheads (collisions being recalculated for every child part at every step) so we reworked it in C++ as a flat hierarchy, and this gave us a massive overhead - on my PC performance starts tanking at ~1000 parts, but one playtester reported 5000 as that limit!
Parts define how they move, and depth in the tree structure affects the phase and scale of their oscillation. The player can also make each part more or less rigid.
The big kicker was the follow through rotation which juiced everything up tenfold. We only added this recently and we're obsessed now.

The next challenge will be figuring out how to give the creatures decent NPC behaviours and "global" animations... Any advice pointers or resources there would be deeply appreciated, we've got a few ideas but it's all on the table right now!

If you're interested in following the project, it's called Molec


r/proceduralgeneration • • 2h ago

The entire ecological regrowth in this game is procedurally generated, after an AC-130 shoots seed shell towards the ground.

5 Upvotes

In an alternative timeline, the AC-130 gunship was created as an ecological swiss army knife.
It can help out farmers in trouble by firing nitrogen filled shells which enriches the soil. You can also fight forest fires by firing retardant shells into the forest surrounding the fire as well as triggering rain over the fire by using silver iodide shells.
One of the missions in this game is that you prevent a swarm of locusts from destroying an entire farm, by setting up decoy grassfields / food supplies as well as causing rain over where the swarm will be, when it arrives.

In one mission, there is the task of protecting a village from a haboob, by setting up fast growing grass, and setting up rain.

I am also thinking of adding real historical scenarios such as these:

Wolf DropYellowstone, 1995Airdrop wolvesElk leave the riverbanks, willows return, rivers change shape. The real story already went viral once.
ShelterbeltOklahoma, 1935 (Dust Bowl)Plant tree rows to stop the dust stormsBlack storms turn into green farmland
Tunguska ResetSiberia, 1908Replant about 2,000 km² of forest flattened by an air blastThe butterfly-shaped blast zone fills in
Pumice PlainMount St. Helens, 1980Drop lupines and pocket gophers (both helped the real recovery)Gray ash turns purple
Free the RiverElwha River, USA, 2011Use your guns to remove a dam, the biggest dam removal in US historySalmon swim upstream. This is your dam mission in reverse.
Saxaul LineAral Sea, 1990sPlant saxaul trees on the dry seabed to stop toxic dustThe salt desert turns to scrub
Dung SquadronAustralia, 1960sAirdrop dung beetles (a real CSIRO program)Cow pats vanish, pasture and fly counts recover
Otter StrikePacific coastDrop sea otters (not firing them from the cannon, lmao), which eat the urchins that destroy kelpAn underwater kelp forest grows back
Mangrove ShieldIndian Ocean, 2004Plant (fast growing) mangroves before the tsunami arrivesThe wave hits, and the village behind the mangroves survives
Red ForestChernobyl, 1986Replant the dead pine zoneWolves, horses and bison move in
Marram WallDutch coast, 1953Drop sand and marram grass to build dunesThe storm surge hits the dunes, not the towns

Some other include, rebuilding coral reefs, helping a city to cool down by firing light reflective cooling paint over its most heated up rooftops ( Source: NighthawkinLight Youtuber - Look at his light cooling paint videos), rerouting rivers to prevent existing settlements from being flooded and so on.

Currently I am working on developing the engine more and figuring out a game mechanic which will actually work.

Find flaws in it, point out potential angles I am not seeing and give me your blunt feedback.

Yes I know this is very utopian thinking, but as a game, I feel like there has yet to be a game which can channel existing war machines into machines which actually facilitate life.

What other mechanics can I add?


r/proceduralgeneration • • 8h ago

Organic Zombie web- Procedural system

11 Upvotes

r/proceduralgeneration • • 1d ago

bismith.dev - a free procedural texture generator that runs in your browser.

138 Upvotes

r/proceduralgeneration • • 1h ago

Catan on aperiodic tiles

Post image
2 Upvotes

r/proceduralgeneration • • 11h ago

Growing voxel rocks at runtime, then carving through them with a laser

9 Upvotes

- Every rock grows from a single voxel to a random size when it spawns, either filling in or pushing out arms, so no two match. The see-through preview shares the rock's seed, so you place exactly the shape you saw.

- The surface is Naive Surface Nets (one vertex per boundary cell, then smoothed).

- The laser picks voxels with a DDA ray march through the grid instead of physics, and the mesh rebuilds at most once per frame.

- Big walls are many small blobs, so a cut only re-meshes the blob it hits.


r/proceduralgeneration • • 31m ago

v1.0 Released - Possibly the best pixel-art planet procgen ever made!

Thumbnail
reactorcore.itch.io
0 Upvotes

Planet X Surface Generator is deliberately pixel-art first and goes a bit further beyond than just making maps and globes of the higher level. You can actually zoom in and it will procgen-invent details (accurate to the location) the closer you zoom in.


r/proceduralgeneration • • 4h ago

seaweed rhubarb #touchdesigner #generativeart

Thumbnail
youtube.com
2 Upvotes

floating seaweed rhubarb i made in touchdesigner while messing around


r/proceduralgeneration • • 1h ago

Infinite Planet Seeds for RTS warfare

Thumbnail
youtu.be
0 Upvotes

Focusing on interesting terrain for planetary battles in CounterMind. Would love to hear what you think.


r/proceduralgeneration • • 1d ago

Voronoi borders are too straight, so I bend them with 3 octaves of value noise before the nearest-site lookup

137 Upvotes

r/proceduralgeneration • • 18h ago

I made a free, procedural nebula shader for Blender (Cycles & Eevee) with fast volumetric rendering!

Thumbnail
gallery
15 Upvotes

This fully procedural shader is designed to make creating beautiful nebulae easier, faster, and more accessible than ever. It works with both Eevee and Cycles, allowing you to create detailed, colorful nebula formations with fast render times (Even with Cycles).

The nebula's lighting is generated within the shader itself. No actual light sources are required to illuminate it!

These nebulae don't interact with lights. Their appearance and illumination are controlled directly by the shader.


r/proceduralgeneration • • 9h ago

Génération procédurale du monde dans Godot

Thumbnail gallery
3 Upvotes

r/proceduralgeneration • • 4h ago

islands that grow around my Mac desktop icons, metaballs plus a cartoon palette shader

0 Upvotes

each desktop icon gets a land blob, the field is the sum of (1 - d²/r²)² kernels and anything above 0.35 is land, so icons that sit close together merge into one island

the blobs follow the icons on a spring, so when you drag a file the land walks after it, a smaller raft blob sits under the file while it's in the air

one full screen shader maps the field to cartoon bands, deep to shallow water, waves rolling into the shore, foam rings, the land's shadow on the sea and hill light from the field slope

boats wander the water and turn away when the field ahead goes over 0.25

it's a live wallpaper for macOS I've been building, happy to go deeper on any part of it


r/proceduralgeneration • • 1d ago

From a moon to a city on a 1:1 Earth-scale planet, in one take: two more weeks of plate tectonics, river networks, climate and moons

98 Upvotes

Two weeks ago I shared my planet engine here: a childhood dream from 2012, an Earth-sized planet you can fly down to from orbit, with no loading screen and no popping. Your comments were generous and full of ideas, plate tectonics first among them. So I kept going. Here is where it stands.

What the planet is made of now:

• Plates: simulated at startup, in under a second. Each boundary gets a type: collision, subduction, rift, ridge or transform. The large landforms are profiles of the distance to those boundaries, and volcanic arcs, hotspot chains and atolls come from the same map.

• Rivers: a drainage network is computed once for the whole planet, so every river ends in the sea or a lake. Valleys and river beds are then carved per point on the GPU, like noise, so nothing is simulated in tiles and nothing streams.

• Climate: prevailing winds carry moisture inland. Windward slopes get the rain, rain shadows turn into deserts. Vegetation, snow and the cloud weather map all read from it.

• Vegetation: more species, placed by the climate, with undergrowth and moss under the forests.

• Moons: three airless bodies, 1,800, 700 and 260 km in radius. Fractured highlands and impact craters in nine size bands, from hundreds of kilometres down to a few metres. They share the planet's landable terrain stack, so you can land on each of them.

• Light: the orbital view tuned against the Apollo 17 Blue Marble photo, clouds placed by the climate, moonlit nights.

The rule is the same as in 2012: the geometry the view needs is rebuilt every frame, and everything global, from the plates to the weather, is computed once at startup. Nothing is streamed, so the camera can go anywhere in the system in a single frame.

The video is one continuous take, rendered frame by frame by the engine's cinematic mode. A ship takes off from a moon, passes a second one, comes down on the planet at dawn along a snowy range, skims a sea of clouds and lands at the spaceport of a small hill city. The city is a first game layer on top of the terrain: its pads and earthworks are graded into the procedural relief, the buildings are assets.

Does it make you want to play? And where does it still give itself away as procedural?


r/proceduralgeneration • • 13h ago

Postcards from a procedural planet (free demo)

Thumbnail
gallery
3 Upvotes

Hi all, I haven't posted here for a while so just wanted to share progress on the procgen based side-project engine / game (C++/OpenGL/GLSL). A free demo is here if it's of interest, many thanks: https://store.steampowered.com/app/2223480/Infinicity/


r/proceduralgeneration • • 22h ago

World Generation for stylized flying video game.

Thumbnail
gallery
11 Upvotes

Making progress in my terrain generation tool for video games. Its still a test map, and the biomes dont have different features yet but im hoping to make a tool that helps game devs build world for games instead of just random terrain using noise. Its still a bit rough but starting to produce some nice results. Red and Orange are settlements, they is probably too many right now. but im just testing with a very connected network.


r/proceduralgeneration • • 1d ago

Infinite procedurally generated coastline with trains, boats and underwater exploration. Every building can be entered.

Thumbnail markhammond.me
75 Upvotes

A single seed string is used to render the entire world. The only nondeterministic elements are the wildlife.

I made it open source including all of the test benches for the various subsystems.

Please feel free to ask questions!

https://github.com/invertedworld/coast


r/proceduralgeneration • • 1d ago

Isometric Subterranean Cartographer

Post image
12 Upvotes

Claude.ai and I collaborated on the Isometric Subterranean Cartographer. Generate your own adventure maps.
https://daoneil.github.io/Procedural/Isometric_Subterranean_Cartographer.html


r/proceduralgeneration • • 1d ago

My games ecosystem grows in realtime

84 Upvotes

Every plant grows procedurally based on what's around it, so like a branch will weave around an obstruction etc.

seeds drop and some grow new plants, at the moment there is a pretty hard cap on the amount of plants though because performance is not very great.

How does it look? Still very early and needs lots of work but hopefully it will be able to simulate any full eco-system paired with my creatures.

It was also sped up about 100x at the start so that the trees would grow quickly, which is why so many leaves fell.


r/proceduralgeneration • • 9h ago

I gave a creature in a claw. Within two minutes it had eaten its own children.

0 Upvotes

I make DELFS, a petri-dish evolution sim. This week I tried to give my creatures a claw. Oh boi that was an adventure.

Entry 1. The predator dies of... nothing.

I took one of my basic organisms — a mild scavenger species that lives on what other delfs leave behind — and added two new limbs: one to strike, one to hold. Ten of them go into a dish with forty prey.

All ten are dead in five minutes. They never landed a blow.

I assume the arms are too expensive to grow. I make them a third of the size. All ten are dead in five minutes.

Entry 2. The log is lying to me.

My tools say that not one strike has ever missed. In the whole history of the dish. Sounds fishy.
The counter was attached to an event that never happens, ofc accuracy is 100%. It would have read zero even during a massacre. Counted properly, a strike misses eight to fifteen times for every hit, because the prey travels further in one tick than the arm is long. Okaaay, so my predators were shadowboxing.

Entry 3. The claw lets go of things that are running toward it.

Now I can see the claw working: it holds about half of what gets hit. I go looking for a weak grip and find a stupid one. The rule was simple: a grip breaks if the victim moves fast. Turns out I forgor about the direction. Including straight into the predator's face. A delf could escape a claw by charging it.

Fixed. Grips now break only when the two bodies are actually pulling apart. Breaks fall from half to about one in eight.

All ten predators are dead in five minutes.

Entry 4. Cause of death: could not poop.

A genome has room for exactly 24 processes and the scavenger uses all 24. To teach it to strike I had to overwrite something, and my helper code picked a vent. Specifically the vent for tissue material, a compound that is only good for building flesh.

So here is what happened to every predator I had made so far. It was born. It ate. Its flesh finished growing. It kept eating, because food was there, and the one compound it could no longer excrete piled up inside it until there was no room left for anything else. It starved to death, completely full, standing on dinner.

To be sure, I built a delf with the vent removed and no arms at all. Dead in five minutes. The arms had been innocent the entire time.

It turns out the scavenger can spare exactly one process. One arm, one skill. I give it that. It lives. It hunts. It breeds. I go to bed pleased.

Entry 5. The scoreboard.

Eight different runs, twenty minutes each, survivors on average:

  • unarmed delf: 18

  • delf with a gentle pincer: 15

  • delf with a proper striking arm: 7

Being armed is worse than not being armed, and the better the weapon, the worse it goes. The pincer comes second because it hits a third as often, and a good share of everything these animals hit turns out to be... their own relatives. Delfs can't see family. They can only smell it.

Meanwhile hundreds of prey are dropping dead of natural causes all around them. Based.

Entry 6. I make it worse.

Three changes, to make killing worth something. Bodies now rot five times slower, so there's a reason to tear a carcass open instead of waiting. A strike can now land on both remains and eggs. And delfs get a mild reluctance to hit anything that smells like themselves.

Survivors: 7 becomes 0.2.

Eggs and corpses do not dodge. A predator that finds one simply never stops hitting it. Ten animals delivered between 350 and 900 blows to eggs in the first two minutes. Their death rate was perfectly normal. Their birth rate was zero. I split the counter to find out whose eggs.

40% were their own.

I had built an animal that walks to its nest, lays an egg, and then beats it to pieces, at industrial speed, while slowly starving, surrounded by meat it had personally tenderised. The "mild reluctance" stood no chance against the overwhelming urge to beat a perfectly accessible egg into pulp.

Entry 7. Manners.

My first fix was to forbid it from outside: a penalty added to the brain's decision after the brain had made it. That's a leash, not an instinct. It can't be inherited, it can't mutate, and nothing can ever evolve past it.

So I put it in the brain instead. Every species now starts life with two manners wired in: don't strike what smells like you, and eat before you fight when you're running low (duh). After that they're just weights in a neural net, passed to the children with the usual copying errors. Some lineage will lose them eventually. I would like to be there when it does.

Entry 8. The eggs don't smell right.

One last problem. To spare its own eggs, a delf has to tell they're its own, and I had quietly let it read the answer out of the egg's genome. That's a kin detector, and this game has one hard rule about perception: no creature gets to know who its relatives are.

So I made it honest. Judge an egg by how the shell smells. But a fresh egg doesn't smell like a grown delf. Survivors: 0.9. They were back at the nest with the claw, urging for a bloodbath.

The real answer was already in the game. Eggs carry their own inherited scent, which parents already use to find the eggs they feed. A strike now asks the same question a parent does. It works. It also means that if a stranger's egg happens to smell like yours, you will guard it like your own, and that's a cuckoo.

Where the dish stands tonight

  • unarmed scavenger 11, striker 7, pincer 4. Slow rot was hard on everybody who lives off the dead.

  • blows landed on family: down from as much as 46% to about 10%. On their own eggs: from 40% to 5%.

  • an armed delf now spends 96% of its violence on corpses and eggs and almost none on anything that can run.

  • a colony of identical armed delfs used to beat itself down to about 200. It now holds near 450, same as the peaceful control. They have stopped hitting each other. This is the one thing that clearly got better.

  • the claw has not paid for itself once. Not as a second hand, not as a pincer, not at any size.

So after two days of work I have a predator that is polite to its family, careful with its eggs, eats before it fights, and still loses to an animal that does nothing but wait for things to die.

I'm calling that progress.

The claws should make it into the next DELFS update (hopefully). The game is already on itch.io, and I'm working on getting it onto Steam too. If Valve ever finishes verifying me, that is.