r/proceduralgeneration • • 14h 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

85 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 • • 19h ago

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

156 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 • • 14h ago

New look for the simulated snow in my snowplow prototype

52 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 • • 10h 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 • • 4h ago

Some procedurally animated monstrosities made in our game

Thumbnail
gallery
7 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 • • 4h ago

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

6 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 • • 10h ago

Organic Zombie web- Procedural system

15 Upvotes

r/proceduralgeneration • • 2h ago

Opaline Nursery

Post image
3 Upvotes

r/proceduralgeneration • • 46m ago

Chrysalis

Post image
2 Upvotes

r/proceduralgeneration • • 4h ago

Catan on aperiodic tiles

Post image
3 Upvotes

r/proceduralgeneration • • 1d ago

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

142 Upvotes

r/proceduralgeneration • • 14h 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 • • 2h ago

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

Thumbnail
reactorcore.itch.io
1 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 • • 6h ago

seaweed rhubarb #touchdesigner #generativeart

Thumbnail
youtube.com
2 Upvotes

floating seaweed rhubarb i made in touchdesigner while messing around


r/proceduralgeneration • • 1d ago

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

139 Upvotes

r/proceduralgeneration • • 20h 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 • • 12h ago

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

Thumbnail gallery
3 Upvotes

r/proceduralgeneration • • 6h 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

101 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 • • 16h 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 • • 1d 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
76 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
13 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

85 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.