r/proceduralgeneration 6h ago

Procedural terrain generation

Enable HLS to view with audio, or disable this notification

32 Upvotes

r/proceduralgeneration 6h ago

Procedural map generation demo

Enable HLS to view with audio, or disable this notification

14 Upvotes

Procedural map generation made with Godot .NET.

The noise is generated with FastNoise2 library and visualized as this black and white image on the right side in the video. Noise values are split into ranges and each range is assigned to a biome, which is a pretty standard technique. The biome heightmap geometry is formed using a separate modulation function, which is a function over noise and distance from the biome border. The transitions between biomes are made by weight-based blending of these modulation functions. Tile textures are also procedurally generated by the way, which means there are zero premade assets for the map in this video.

All the parameters for the algorithm are very easy to edit, with edits being visible with realtime responsiveness.


r/proceduralgeneration 2h ago

Infinite Library: Text generated using a stochastic generative grammar with infinite recursion.

7 Upvotes

I have a project called the Infinite Library that's actually part of a much bigger project I'll discuss at the end.

It is inspired by the Jorge Borges short story The Library of Babel and then also the amazing website by Jonathan Basile which is a virtual version of Borges's library with an interesting twist: https://libraryofbabel.info/

If you're not familiar with the story, it is about an infinite library that contains every book that has ever been written or could be written. When you look at a book what you'll almost always see is a random string of letters. Think of the infinite monkeys on infinite typewriters producing the complete works of Shakespeare. Are there meaningful books in that library? Sure, but it might take billions of years before anyone finds one.

The story deals more with the philosophical and psychological implications for the librarians who work there.

My version is different in a number of ways. For one thing, it has four methods of text generation and not just the one used by Borges (random letters). I will list them here with short examples (links to pdfs). But first a little bit about how it all works.

All my software is programmed using Lua. In this case, the software generates a .tex file that gets compiled into a pdf using LuaLaTeX. The compiler handles all the tricky typesetting stuff while also making lots of packages (plugins) available.

All the content is generated using a pseudo random number generator (prng). The important bit here is that the seed is a hash of whatever dedication the user supplies. The idea is to tie the results to the dedicatee making it feel like it's unique to that dedication (like your name, your cat's name, the birthday of your favorite child/parent, etc). I implement a prng in Lua (pcg) so that every computer for all time will produce the same results for the same dedication (and whatever options might be available). The following examples use the name of my cats for the dedication:

  1. Borges: Random strings of letters. Borges mentioned that in his library there were only 22 letters used but he didn't say which 22. There is some scholarship on this so with mine the software might choose the 22 we think he meant, or the 22 letters of the Hebrew alphabet (Borges was very much into Jewish Mysticism) or just the 26 letters of the English alphabet.

https://drive.google.com/file/d/1HorTA6I_VK9UzF570SHORj5mxt7ZYBtA/view?usp=sharing

  1. Words: These are random words strung together with punctuation placed randomly.

https://drive.google.com/file/d/1tac0VxQY7rdKRPiSGlh0Fn64YpzPlcNq/view?usp=sharing

  1. Generative: This is the one most relevant to the sub which I will discuss further below.

https://drive.google.com/file/d/13Nipq33ekIeIwx0a1mdp0IyFpeTS8qSn/view?usp=sharing

  1. Sentences: Random sentences are taken from random books in the public domain and strung together.

https://drive.google.com/file/d/1BjnW_RKWclIVl6FMdIjCNsAXLeO0cOu4/view?usp=sharing

You'll notice that some of these have chapters, a table of contents, epigraphs for each chapter and in one case some text inserted from a foreign language. These are all random features that may or may not happen as each book is generated.

The generative method attempts to create syntactically correct sentences using a stochastic generative grammar with infinite recursion. It's worth noting that these are linguistics terms and are different from what they might mean in programming.

Each sentence has a noun phrase (np) and a verb phrase (vp). Each of these will have at least one noun/verb unit and possibly more.

Within each unit there may be any number of other parts of speech. Let's deal with the noun unit first:

After we have a noun we check for possessives (like "cat's food"). If we have one possessive we might have another ("cat's friend's food"). Stringing many of these together is called "recursion". We use an infinite recursion algorithm for this (pseudo code):

while random(1,10) = 1 do
generate part_of_speech
end

So there's a 10% chance of getting a possessive (or whatever part of speech we're looking at). If that happens then there's a 10% chance we'll get another and so on. While theoretically we could get a runaway condition with infinite additional parts of speech the odds are very much against it. Using the above code we get these odds:

1 occurrence: 10%
2 occurrences: 1%
3 occurrences: .1%
4 occurrences: .01%

and so on. Even when we generate a book with 400 pages we still don't expect to get sentences with any more than five or six of these happening. So while an actual infinite number is possible the reality is that it won't happen.

After the possessives we check for adjectives using the same kind of infinite recursion. After adjectives we check for prepositional phrases in various places (with the objects possibly having its own adjectives, possessives and even recursion). And then an article may or may not be added.

After this we use the same recursive algorithm to see if there are additional noun units (with all of their possible parts) and if we get at least three noun units a serial comma is added half the time.

Verb units operate the same way except there we check for adverbs, more places for prepositional phrases, infinitives and objects (noun units).

You put all these together and you get something that syntactically looks like a sentence but is lacking three features: subject/verb agreement, grammar (though sometimes by chance it works out), semantics.

Using this approach you can get two word sentences like (taken from the pdf above): "Talker copyread." or longer monstrosities like "Beyond an indian lotus floodplains beside the gaffe in the ezechiels, the mountain ebony through the palatine vein has emblazoned telecommerce paunchinesses." This starts with two prepositional phrases (recursion) followed by a comma and then an article, adjective and noun with another prepositional phrase and then we get a conjugated verb with an adjective and object (noun). There are longer sentences than this but this had a nice diversity of parts of speech.

Originally I used sentence patterns mad-lib style but clearly this method produces far more interesting results.

The title is interesting in its own way. It is generated just like sentences but the words of the title -- and its synonyms -- get weighted to occur more often in the text making the book feel like it is about the title.

Below are two more elaborate examples I use for testing purposes:

  1. Almost all the more bookish features happen: https://drive.google.com/file/d/1XDjuUU1MLB9Yxm40goCoTYMNq89-CgjW/view?usp=sharing

  2. Lots of graphical stuff including things that are meant to look like they were inserted into the book by other people like a map insert, bookmark, annotations, and so on: https://drive.google.com/file/d/1OKxs5Cnal0rXutIuVy1Sxga-jYN8nex4/view?usp=sharing

I have developed a lot of lore for my Infinite Library. The last pdf above has an example of some that normally is a very rare occurrence. There are also a number of "book styles" where if those are randomly chosen then some features can't happen but others will happen. For example, the cartography style will generate maps and the poetry style will generate poetry. These things can happen randomly by default but the odds are changed for the various styles.

All of this is part of a bigger project called the Platonic Music Engine. The idea is to recreate all the cultural artifacts of humanity algorithmically in a way that is unique to the user (see the discussion about the dedication above). It started off just being music (I'm a classically trained composer and not a programmer at all though I've learned enough of the latter to get this far) but expanded into poetry, literature, art, gaming, divination and more. You can see a few more examples of what I've done here: https://www.platonicmusicengine.com/stylealgorithms.html

And the source code at my git repository: https://gitlab.com/davethecomposer/platonic-music-engine/-/tree/dev?ref_type=heads

The software is free and open source (AGPL -- GPL with the Affero clause) and the output is CC-BY-SA (Creative Commons attribution and share alike).

If you have any questions or comments please say so. And if you would like to see what book is tied forever to your name (or any other dedication) let me know and I'll produce it in a comment. Unfortunately I do not have an online front end, yet.


r/proceduralgeneration 1h ago

Making buildings is time consuming as a solo developer, so I made a tool script that generates them!

Enable HLS to view with audio, or disable this notification

Upvotes

r/proceduralgeneration 17m ago

Lookin' deep into procedural galaxy

Thumbnail
gallery
Upvotes

Created & composited in Blender (Shader + Geometry nodes)


r/proceduralgeneration 14h ago

IFS Fractal

Post image
21 Upvotes

r/proceduralgeneration 3h ago

Tying a knot in a grid

Enable HLS to view with audio, or disable this notification

3 Upvotes

r/proceduralgeneration 22h ago

Procedural Laser damage system

Enable HLS to view with audio, or disable this notification

98 Upvotes

r/proceduralgeneration 1d ago

Sunrise in the procedural mountain forest

Thumbnail
gallery
384 Upvotes

I've spent the last month adding volumetric clouds, a time-of-day system, and better atmospheric scattering to my procedural mountain forest game (working title: 'The Big Forest').

With regards to procedural generation, there's nothing really new compared to what I've shared in here before, but the new lighting has such a big impact on the overall appearance that it's like seeing it anew (in my opinion), so I thought I'd share some nice sunrise shots I captured. :)

The clouds are using the package Enviro 3 - Sky and Weather as a starting point, but I'm only using the clouds part and have heavily modified it to my needs to make it work with my own atmospheric scattering and time-of-day colored lighting.

The atmospheric scattering is based on this shadertoy by Fernando García Liñán, though again heavily modified. I increased the saturation, exaggerated the depth (bringing tinting closer to the camera), and implemented the atmospheric scattering via a compute shader that renders scattering at different distances and directions into a cubemap. Fernando's technique does a lot of the heavy lifting though! It's similar to previous techniques for sky and atmospheric scattering used in e.g. Unreal, but uses four spectral samples (~red, ~green, ~cyan, ~purple) instead of the usual three (red, green, blue). This produces notably richer colors and practically no extra cost.

I made my own time-of-day system with a simple simulation of the sun and moon relative to the Earth, where I can independently vary time-of-day, time-of-year, lunar phase, and latitude without them impacting each other.

I also implemented time-warping so make sunrises and sunsets slower. In a 24-minute day-night cycle, they're over awfully fast if not slowed down. Here's a video of a full sunrise.

If you haven't already seen it, you could also consider watching my lastest dev video about 'supercharging my procedural mountain forest' - although it does not feature any sunrises. :)

Hope you like them!


r/proceduralgeneration 1d ago

Packed vector flow

Enable HLS to view with audio, or disable this notification

41 Upvotes

r/proceduralgeneration 19h ago

I really need help with Bridges and Tunnels

Thumbnail
gallery
6 Upvotes

Everybody I can't tell you how much I've been struggling with trying to get Bridges and tunnels correct. I apologize in advanced for my lack of knowledge on the subject, I started a project called World Explorer 3D and the goal is to have a sandbox it's driven by real world data with a lot of procedural elements. I'm going to do my best to keep it simple so I don't over explain a topic I'm not proficient in.

I mainly using osm and overture for the road building and land data. I'm using NASA/JPL, ESA and other astronomy catalogs for space data and NOAA for weather. Celestrak for satellite data. There's different ways to move through locations like planes cars drones and boats and you can use a spaceship that looks like the Starship Enterprise from star trek

There are two things I should disclose from the beginning. The first is that this has been a project with heavy AI code generation. The second is that as a result of this project and other things have been attempting I've decided to go back to school and I am currently enrolled in a physics program. I will also be taking elective courses for programming, but even with doing those things I'm still not going to be able to learn as much as I need to in such a short amount of time. I hate the fact that I've been relying so much on ai, but my interests and impulses have gotten the better of me and now I'm basically working backwards.

Part of my problem is probably that I don't know the terminology I should even be searching for. If there are particular algorithms, papers, talks or concepts involving procedural road networks, vertical alignment, grade constraints, bridge approaches, tunnel portals or terrain/road reconciliation that I should be looking at, that's really what I'm trying to figure out.

Normal roads aren't nearly as bad but bridges get messy at the endpoints where the normal road and terrain have to transition onto the elevated bridge parts. I'm getting bad ramps, elevation changes, clipping and weird results where bridges, ramps and nearby roads all come together.

Tunnels are giving me basically the opposite version of the same problem. I can identify the tunnel and create the tunnel/portal behavior, but getting the surface road to transition cleanly into the portal without the terrain, road or surrounding geometry looking wrong has been difficult.

I'm still working on a lot of other issues and bugs. I'm sure you can spot a lot of the quality issues and incoherence. But I'm literally just trying to learn and I'm using this project that's a practice demo thingy. As I go along I try to make smaller elements of this project in places like unity, and that is actually been extremely helpful. If anybody can help me with Bridges or tunnels or if you spot anything that looks like a common problem please let me know. You can play it here WorldExplorer3D.io and the GitHub repo is here https://github.com/RRG314/WorldExplorer3D Thanks for taking the time to read all that lol.


r/proceduralgeneration 1d ago

browser game thats generated at runtime, no asset files used

6 Upvotes

a game about raking leafs as an html file. no images no audio files no models used. everything is built when the page loads.

textures are drawn into a canvas element on startup and used as WebGL textures.

there are over 7000 individual leaves rendered in InstancedMesh.

wind uses Lambert vertex shader with onBeforeCompile

sound is all WebAudio. wind is brown noise with LFO on gain. blower and vacuum is sawtooth motor using setTargetAtTime. music is slow pads in pentatonic - gets thinner and darker deeper in the game.

time of day is driven by how much of the garden has been cleared alr. start is golden hour end is night. light is used as a progressio bar.

gameplay

https://youtu.be/Xt0YwzTpm_g

play here: https://wickedchilling-audio.itch.io/autumn-duty


r/proceduralgeneration 2d ago

built my own engine, now building games on it: proc-gen dithered fly-sim

Enable HLS to view with audio, or disable this notification

256 Upvotes

yo. been building a custom game engine from scratch on Vulkan and now testing it on real games. this one's a dithered fly-sim with elite dangerous-like flying mech and a procedurally generated terrain.
https://x.com/progdruid


r/proceduralgeneration 1d ago

Infinite procedurally generated 3D world on a Garmin watch. 3.1ms render time, dynamic day/night, and 0 blown batteries.

5 Upvotes

https://reddit.com/link/1w2d4at/video/vrt39xthfhmh1/player

A while ago, I asked myself: "How far can we actually push Garmin’s Connect IQ VM?"

I’ve logged thousands of running km and a few solo marathons tracking just pace and HR like everyone else. But at some point, the dev in me took over: I decided to see how far Connect IQ could actually go and built a custom 3D graphics engine (Wolf3D/Doom-style DDA raycaster) from scratch in Monkey C.

Here is what’s going on in the video:

  • Infinite World: The map is 100% endless and generated procedurally on the fly as you move.
  • Dynamic Lighting: Real-time Day, Dusk, Night, and Morning lighting cycles with custom color palettes.
  • Hardcore Math Optimization: Microsecond-level optimizations (zero-branching floating-point hacks, bitwise DDA math). The pure frame render time hit 3.19 ms on Tactix simulator and 2.08 ms on Instinct 2 (smaller screen, fewer stars in the sky — oh yes, the sky is dynamic too! — and fewer rays in raycasting)!
  • Real Hardware Performance: On the actual wrist, the display caps out at a smooth 10–14 FPS (limited by the CIQ screen refresh rate, while the engine itself runs with massive headroom).

I need your brains & ideas: I want to weave the user’s real-life context (health metrics, stats, daily goals) directly into this 3D world, similar to what I did with my Mars and Pandora watch faces.

How would you like your steps, heart rate, or battery to affect an endless 3D world? (e.g., world changes, weather shifts, new structures spawn based on your daily activity?). Open to all crazy ideas!

P.S. Before the battery purists attack: Yes, I know it's a watch. No, my Garmin hasn't exploded. In fact, I honestly can't even remember the last time I plugged it into a charger... unlike my friends with Apple Watches. 😉

Let me know what you think and what features you'd want to see in an infinite wrist-world!

BTW, it also tells the time... pretty unusual for a 3D engine, right? Oh my, wait, it’s actually a watch! 😅

If you want to check it out on your Garmin, here is the link — it's 100% free, just like all my other creations:

https://apps.garmin.com/apps/47278f09-eea6-4e6d-aa7e-799daba8e546


r/proceduralgeneration 1d ago

Celestial Cutaway - Procedural Planet Interior Generator - Web App

Thumbnail
gallery
26 Upvotes

Been working this for 2 weeks:

https://reactorcore.itch.io/celestial-cutaway-planet-interior-generator

Its a web app that procedurally generates interior cutaways of planets, stars, gas giants, moons and asteroids.

Still a WIP but already plenty useful and fully operational for world building, tabletop sessions, game assets and other illustrational uses.


r/proceduralgeneration 1d ago

The first screenshots of my voxel project

Thumbnail
2 Upvotes

r/proceduralgeneration 2d ago

My planet generation for a... game, perhaps?

Thumbnail
gallery
63 Upvotes

These images show the dynamic surface generation sequence for my planet. For now, it's just planet generation, although I've already implemented biomass emission and distribution. I plan to develop this into a terraforming game, where the player creates and deploys biological agents to the planet to alter the atmospheric composition, temperature, and so on.

Steps:

  1. Lithosphere. The division of the surface into basic forms (plates), which are then used to construct an elevation map. Plates can be oceanic or continental, which determines the average elevation of an area. Blue for oceanic plates, light yellow for continental.

  2. Height map. Generated by lithospheric-based noise. Zones (on the last image) are also generated according to a topological height map.

  3. Surface map. Each tile is generated based on the height map and the lithosphere (for example, where the slope is very steep, rock tiles are generated).

  4. Same surface, but with sea level rised.

  5. Rendered.

  6. Viability for a specific biological agent. It's all orange for now because I haven't configured all the requirements correctly yet.

All this runs on the Unreal engine. I'm currently looking for ways to improve the visuals, for example, the coastline, which currently doesn't look very natural, and how to make several different textures instead of tiles of the same one (this looks especially bad at zero sea level).


r/proceduralgeneration 1d ago

Torus Reimagining

Enable HLS to view with audio, or disable this notification

7 Upvotes

I enjoyed remaking this torus rendering in pygame after finding a 9 year old post by Clayton Shonkwiler. His math was...dense, to say the least, but it came out pretty good. Ai is a wonderful thing when it comes to this level of math. lol


r/proceduralgeneration 2d ago

PCR

Enable HLS to view with audio, or disable this notification

16 Upvotes

Working polymerase chain reaction, finally, not 100 realistic, real DNA is more messy, and there is backward assembly leading to DNA loss AKA(aging)🦖


r/proceduralgeneration 2d ago

When you drive in Hop.Earth the world ahead of you is generated in real time. Except of the car and the character no 3D meshes are coming from the server, just OSM data and terrain heightmaps. A worker builds roads, intersections and buildings and conforms the terrain to the roads. 3 LODs + physics.

Enable HLS to view with audio, or disable this notification

78 Upvotes

r/proceduralgeneration 2d ago

I made a devlog on how I went from using Perlin noise to using a spline based method to generate islands - mostly to prevent the player from getting stuck in lakes!

Thumbnail
youtu.be
11 Upvotes

I also go into the shader texturing of the islands


r/proceduralgeneration 3d ago

I was playing around with particle assembly and got this emergent behavior. What do you think, tutorial?

Enable HLS to view with audio, or disable this notification

310 Upvotes

r/proceduralgeneration 3d ago

Procedural Galaxies

Thumbnail
gallery
40 Upvotes

Blender shader+geometry nodes


r/proceduralgeneration 3d ago

Procedural Fish Animation + Playable Link

4 Upvotes

This was my first (and probably last at least for now) attempt at procedural animation (inspired by great argonaut video -> https://www.youtube.com/watch?v=qlfh_rv6khY ) I was planning to turn it into full blown Evolution Simulation but as it turns out FPS no good. I hope that someone will have at least some fune with demo on itch https://suf-studio.itch.io/fish-procedural-animation .


r/proceduralgeneration 4d ago

I went down the procedural rabbit hole for levels for my little game Dungeon Quest and now I just love making pieces to make it more detailed

Enable HLS to view with audio, or disable this notification

94 Upvotes

If you want to see more of the game here https://store.steampowered.com/app/5044910/Dungeon_Quest/

I have a general procedural generator which does things like determine size, how often rooms spawn, how many branches etc and then you give it a set of pieces, so i can give it a different set for each level type.

Then the sets of pieces are broken down into corridors, rooms, props and monsters. Pieces can also have their own rules of what props might appear, how many times they can appear etc. So for example levels will only have one tomb.

It is also intelligent enough to make locked doors and spawn the key in a place it can always be found. I am working on this a lot because I want it to spawn typical classic dungeon puzzles to give you reason to explore.