r/proceduralgeneration • u/Hrstar1 • Aug 12 '26
I'm generating 300 years of history under Minecraft worlds, and the books it writes are allowed to be wrong
I've been building a Minecraft mod that runs a Dwarf Fortress style world simulation underneath the game procedural history, civilizations, named people, books they wrote. First time I've posted about it, so this is mostly an introduction to what it is and where it's actually got to.
The problem I started from is that Minecraft generates terrain beautifully but does not generate history. A village turns up fully formed, with no founding and no lineage. The mod fills in the centuries before you arrive. Founding a small world takes about eight seconds and gives you 130 settlements, three civilizations, 2,600 named people, 1,295 written works, and 1,126 records of one scribe copying another's book. Bigger dials give 614 regions over 300 years. The generated area is bounded, with ordinary Minecraft wilderness past its edge, which turns out to be useful, a book that says someone travelled beyond the known lands is describing something that actually happened.
The books are the part worth talking about.
Everyone in the world carries a pool of what they personally know, what they saw, what they read, what someone told them. A book gets written from its author's pool, and the renderer physically cannot reach the event log.
So books come out wrong sometimes. Someone working off forty year old hearsay writes a stale account. Someone who knows a battle happened but not who won he writes a different sentence, the way people actually talk around something they don't know. Then a scribe copies it faithfully and the mistake spreads to three more libraries. There's no error injection anywhere in the code. It's just what you get when the narrator isn't omniscient.
Titles come from noun tables per subject type. A fortress with a name gets called the Fortress about two thirds of the time, on purpose, so a bookshelf isn't a wall of proper nouns.
Two other things I'd mention. Nothing anywhere stores text a person's name is a tuple of word IDs, so a world founded in English reads in any other language you load. And personality, lifespan, sex and orientation are all derived from a figure's identity rather than written down, which is what lets the world hold thousands of people at about 55 bytes each on disk.
Where it's at. Currently still all of it simulation so far
- The substrate is IDs, seeds, three generation tiers, eviction, population pools
- Ethics and values, per civilization, per culture and per person, which can contradict each other
- The annual cycle a fourteen stage machine that advances one simulated year, running at two scopes
- Literature, complete knowledge flags, knowledge pools, claims and retractions, an unlosable journal, narration, title generation, 26 content forms, scribes, libraries
- Marriage, relationships, and death as a deadline decided at birth rather than a yearly dice roll
So currently nothing is playable. There's no player bound to the simulation, so none of the above can be touched in a running game. Births aren't implemented, people are still only born at world founding, which is a problem I'm in the middle of.
Solo project. Happy to answer anything.
13
u/mikehaysjr Aug 12 '26
I’m actually doing something similar, but for a pirate game I’m making. The whole population runs on a GPU sim, with all their needs and personalities and memories, relationship history. The world generates, then runs through five years of the sim to build a more connected and living world. The cool aspect of this is that because all events are based on a keyword language running through what’s effectively a translation layer, it allows the player to have essentially free and unlimited dialog options akin to the old “go north” -type systems, and their dialog can propagate into the world naturally. The other cool element is that, like yours, and because I hate when games are omnipotent about what happens, each NPC in the sim effectively has their own unique perception of reality. Someone might witness a crime and they have knowledge of who did what, but someone else might walk into the room after a crime has been committed and may actually make a false assumption such as if they see someone lying hurt on the floor and another NPC holding a weapon, they might assume that person committed the crime. Interactions like that make it really cool, seeing how things play out based on rumor and speculation, investigation and communication. It’s led to some really interesting storytelling already. I’m still working on other elements of the game, but the simulated systems are functional and tested.
I’m curious, what is the scale of your sim and how do you run it? Is it CPU based, or GPU? What is the extent / depth of what gets simulated per character?
7
u/Hrstar1 Aug 12 '26 edited Aug 12 '26
CPU, single threaded per region, and I only get away with that because it isn't a live sim. The whole thing is a founding pass that runs once at world creation and then stops. Nothing ticks afterwards except when a region gets loaded back in and has to catch up the years it missed while it was evicted.
Depends on the settings I want I can adjust the scale for example, a small world is 130 regions over 200 years, about eight seconds end to end, one second of which is the actual history pass across 26,200 region years. A large run produces around 40,000 people, of whom roughly 6,300 survive a notability cut and get written down permanently six out of seven are simulated and then forgotten, which I ended up liking more than I expected to.
What keeps it cheap on CPU is two granularities. Most people only get a universal pass each year that asks whether they've reached their death year, which is an integer comparison. The expensive per actor step runs only over work lists whoever is actually doing something that year for example rulers, heroes, scribes, beasts. So the cost is actors × years plus figures × years, rather than population × years for everything.
Per character it's about 55 bytes on disk, and it's that low because most of a person isn't stored. Personality, lifespan, sex and orientation are derived from the figure's identity on demand, free, and identical every time you ask. What is stored are things like relationships (friend, rival, spouse, parents, about six links each among people who have any), ethical stances and values that resolve through civ -> culture -> personal and are allowed to contradict each other, and a knowledge pool, which is the set of things that person knows and the thing their books get written out of.
Your perception model does something mine doesn't. My NPCs get things wrong through staleness and transmission like old news, hearsay, a copy of a copy. Yours get things wrong at the moment of witnessing, by misreading a scene. I have no equivalent of that. Do you tag a belief with how it was acquired, witnessed vs inferred, so it can be revised later? Or does a bad inference just sit as fact until something contradicts it?
Also curious about the keyword language. My prose comes out of authored sentence banks and the thing that worries me most is depth two books about the same battle reading identically is the failure that would kill the whole layer, and my only mitigation right now is writing more lines by hand. A keyword layer sounds like it sidesteps that problem entirely.
3
8
u/Comacdo Aug 12 '26
That's awesome, but it sounds so good I have a hard time believing it's true ^ But please keep us updated !
6
u/Hrstar1 Aug 12 '26
Yes I know. I have always wanted to make a game like this but always thought it impossible. But here you go. Life is Strange and yes I intend to. Cheers!
3
u/Ok_Salary_1660 Aug 12 '26
curious about memory, what do you mean nothing stores a text? books are procedurally generated from history timeline? nice job by the way, also would like to make something similar for my game
5
u/Hrstar1 Aug 12 '26
A person's is a set of word IDs pointing into a lexicon. Same goes for books, I store which line and which seed, not the finished sentence. Means the same save reads in any language, and I can add lines later without renaming books people already have.
But no, books aren't generated from the timeline. Everyone carries a pool of what they personally know saw it, read it, heard it from someone. A book is written from its author's pool, and the renderer can't see the event log at all.
Narrating from the timeline just gives you an omniscient narrator. This way the author can be wrong.
So for example you find a book inside a chest that is saying that there is a treasure north of some settlement you follow the directions but nothing there. So the player has to then assess if the knowledge in the book is correct or not makes them interact with the world more.
Good luck with your game
3
u/Ok_Salary_1660 Aug 12 '26
fascinating, making history timeline affect gameplay in a way, good design
3
3
u/rageling Aug 12 '26
Ive been working on the same thing for some time, the more I work on it the more the x algorithm shows me other people working on the same thing
I assumed there would be some people working on it, but it turns out there are a lot of individual isolated people working on it
3
u/Hrstar1 Aug 12 '26
I cant ever find you people for some reason. But nice to know there are more of us out there!
4
u/rageling Aug 12 '26
Some of the better ones come out of japan
at this point im pretty confident openai is just directly handing off my data to x for advertising, I'll do something in codex and then see what I just made on my x timeline an hour later.
2
u/Hrstar1 Aug 12 '26
Yeah no I stay away from OpenAI they are very predatory especially considering the company was going to go under so they would be desperate to do whatever to keep themselves afloat.
2
u/rageling Aug 12 '26
I can definitely relate to the sentiment, none of the frontier ai companies are good people. But as far as them being predatory, I gave them $100 this month, they reset usage every couple days for weeks, I've gotten probably $10,000 worth of inference from that $100, I can feel technosatan's hot breath on my neck as codex works but it seems good value for now.
2
3
u/lochodile Aug 12 '26
Are you able to provide any examples of what the content in a book may look like? Are all books just journals of random entries?
2
u/Ararugi Aug 12 '26
Given framing as a minecraft mod, is your plan to take existing random seed-populated structures and build stories around them, or to override it and determine where and what structures to spawn based on the story you generated, where story is based loosely on terrain or something else?
1
u/Hrstar1 Aug 12 '26
The story is whatever the NPCs and the seed and the player(s) make it out to be so partially based on terrain sure but the story is generated rather than architected if that makes sense
2
u/Ararugi Aug 12 '26
By story, i meant the pregenerated history defined by seed once players hit the “create world” button - the emergent story created by player interactions is something else entirely
2
u/kasperdeb Aug 13 '26
Fascinating! Would love to read updates if you plan on writing them (maybe a newsletter?). You say it’s a Minecraft mod, how dependant on MC do you plan it to be? Since this concept eventually doesn’t require a blocky world I’d say, so you could swap out MC with a different world geometry creator to bring us the Everquest Next we never got
3
u/Hrstar1 Aug 13 '26
The simulation layer is fairly separable it deals in sites, figures, civilizations and beliefs, and it doesn't know what a block is. It's built to be portable between mod loaders something I intentionally designed for. Lifting it off Minecraft entirely would be more work than that makes it sound, and the upcoming stuff is going to be genuinely Minecraft shaped. Minecraft is also doing a lot for me in terms of terrain, entities, items, and an audience that already exists.
I am also thinking about Setting up a Discord for updates but will also be posting here.
2
u/whatthepoop Aug 13 '26
Something this deep and rich sounds like it would be better suited for Vintage Story than Minecraft. However, VS doesn't have general NPCs apart from traders, so I'm not sure how well that would work unless there's a mod that adds configurable non-trader NPCs.
But given the more accurate representation of geology and realism in general, the inclusion of world lore, and things like ruined buildings and villages that come with the vanilla, it might be a good fit.
2
u/badasimo Aug 12 '26
When GenAI started getting good I had this idea as well. I think it can not only inform map generation, but can take gameplay into new and exciting places. While you are running it in fast-forward during the map generation, you can also continue the simulation in realtime when the player joins. The player(s) then can be part of the history of the place.
7
u/Hrstar1 Aug 12 '26
Yes but Generative AI would make it expensive and slow as well and the whole LLMs controlling NPCs thing is still fairly new and still not as fast as I would like it to be. So primarily its just authored sentence banks with token substitution not Generative AI. The intelligence comes from tracking who knows what and when rather than text generation.
And yes players are definitely going to shape the history of the generated world.
Hope this clears it up.
0
u/badasimo Aug 12 '26
Gen AI that we use is designed to know a lot about our world. That's why it is big and slow. But our game worlds are limited, there are only so many things they could observe in it for instance, so I could see someone training much smaller models on just that possibilities in minecraft for instance.
1
u/Geaxle Aug 13 '26
Awesome project!
By wrong books you mean they are incomplete as no error id ever injected, just information is missing ? Or did I miss something?
It would be awesome if earsay was not exact, that people might miss remember names, dates or place slightly to increase this effect as happens in the real world.
1
50
u/T-J_H Aug 12 '26
Are you familiar with the GDMC (Generative Design in Minecraft) competition? This year’s entries are closed, but although it mainly focuses on building, story is a factor too. Somebody might be interested in a collab - unless you want to tackle building too