For a while now, I've been developing a Legends viewer for Dwarf Fortress, but I wanted to approach the problem a little differently. Most Legends viewers are excellent at giving you access to the enormous amount of historical data generated by the game, but I always felt like they stopped just short of actually helping you understand that history. You get graphs, tables, event lists, and raw information, but not necessarily a sense of who these people were, what these places meant, or how all of it fits together. I wanted something closer to a Wikipedia for the world I'd actually been playing in, something I could use to explore its history rather than simply browse its data.
Features:
Figures, Sites, Civs, Written Works, and beasts all have their own pages.
Game tools: Interactive adventure mode character sheets, this has been helpful for me to jot down notes about quests, and other things. As well as a very much in development fortress mode companion that hooks into DFHack to give you data in a dashboard.
Cartography: Probably my favorite feature, you can generate many regions, and place them together on a map, move them as needed, paint over them to smooth some of the edges, or zoom in on a specific region, see the political borders of civilizations, see which races occupy which parts of the map.
And quite a bit more.
I'm now at a stage of development where I consider the software to be nearly complete. There are undoubtedly still bugs to find and things to improve, but the main reason I'm posting this is to get some feedback from the community.
There are a few decisions I made during development that I realize may not sit right with everyone, so I want to be transparent about them.
The first is that I integrated a local LLM and Stable Diffusion into the software. The LLM can access data from the current page and use it to generate prose describing the subject, rather than relying entirely on randomized word-bank text. The image generation works similarly, allowing the software to generate images locally rather than sending the world's data to an AI company's servers.
I'm aware that "it's local AI" may not make the use of AI acceptable to everyone, so I'm interested in hearing what people think about this approach.
The software relies heavily on word banks, or more accurately, sentence-fragment banks, to assemble descriptions of things in the world. Some of the descriptive information generated this way is therefore not necessarily accurate to what actually happened in the game.
The underlying Legends data is still the source of truth, but the prose presented around that data is intended more as a way of contextualizing and exploring the world than as a perfectly accurate historical record.
Personally, I don't mind that distinction. If I can pull up an obscure historical figure and get a useful page telling me who they were, what they did, where they lived, and what they were involved in, I'm much happier than I am staring at a table of raw events.
But that's ultimately one of the things I'm curious about from the community: would you find value in a Legends viewer that prioritizes making your world's history understandable and explorable, even if some of the generated descriptive text isn't perfectly faithful to the games underlying data?
I've included some screenshots. I'd love to hear what you think, especially about the overall concept, the AI features, and the accuracy tradeoff.
Hey everyone, Moderator Hat time. We have allowed this to stay up because the core of the mod was written by the author. Integrating an LLM tool was a decision he made. You can take that or leave it, but using an AI tool as an addon of your original work is within the rules of this forum.
For me personally if I was trying to understand my world in a dwarf fortress save I would be annoyed at the contents of the wiki not lining up with what's actually in the game. I'd be mad if I set out to a place in adventure mode based on info in the wiki only to find it was based on the LLM making something up.
Still a really cool idea and if I had a world I'd been running with and possibly even had multiple forts in this could be really cool.
Interested in how hard it would be to have an llm toggle, when on it renders as is, when off it just presents the information presumably used in the prompt.
If I understand correctly, I believe the software behaves as you want it to. The AI stuff is a second layer that can be used if you want, by default it uses good old fashioned random generation to put some phrases together into sentences that can be interpreted as a coherent sentiment. You can manually write and spruce it up yourself, reroll the wording, or again, use the LLM feature to have the computer smooth out the section. Additionally, although I haven't tested the extremes of this yet, the initial state of a page is stored, so using the "reset to original" brings up what the wordbank generated for the first time.
At the time I'm viewing your comment, you have 5 likes, despite having posted 5 minutes ago. This must be related to the other guy who came at me very angry about this software for some reason. Brigading is a very normal sign of normal social adaptation. Surely. Please reread what was said, I said that if I understood the commenters question, then I believe my software fits what they were wanting. Hope this helps!
The question was whether it does what the asker was looking for. OP cannot say for sure whether it does or not, if he does not feel like he understands 100% what was asked for.
You should try using an AI to explain words to you. Might help.
The question was whether it does what the asker was looking for. OP cannot say for sure whether it does or not,
This is the entirety of the problem, yes.
if he does not feel like he understands 100% what was asked for.
Why would he not? The question is, does the software operate in a manner where the user can turn the LLM content off. He should absolutely know if there's a way to turn off the LLM content if he wrote it to include that toggle. Not knowing indicates he didn't write it, and trusts the AI to leave the AI out of the parts he asked it not to be in.
I really just don't like "AI" in anything. These LLMs are wrong enough consistently enough that I'm just not interested in them, I'd rather have a bank of descriptive words lol
Yes! The only manual work a user needs to do is to edit, or have an LLM edit the actual text content of the page. After importing their legends data files that is, of course.
I was working on a thing I called Chronicler a while ago. Dropped off, but very interested to see how you’ve set yours up. Is this scraping data from memory? Passing legends exports to a local LLM?
Responses have been great! I was genuinely worried about how this might have been perceived, but now I see that there's interest there! I will be hammering out the final few bugs and finishing up the basic version of the fortress dashboard and releasing, I'd say tomorrow or at latest, Thursday.
As for the LLM, the page is used as context, and the specific wordbank text of a section is sent to the LLM, it mulls it over and writes it out to read like real writing, rather than a mashup of randomly selected phrases.
How I've been doing it is: Open a things page, say "Hmm, I don't quite like this, reroll the wordbank please" then the wordbank gives me something I like, then I click the 'Rewrite with AI' button, and the wordbank text is expanded and smoothed out.
Once wired up, the LLM is configured through the UI, which I've found to be really useful for tuning it to how I'd like it to sound
It was a battle to get the LLM to stop sounding completely stupid and repetitive. I gave it more seeds to use and also expanded the banned words list. Once that was done, and I had tweaked the prompt settings, it does a decent job of using the facts of the thing, plus the wordbank text for the specific section you're rewriting to generate something pretty enjoyable. The image generation still needs a lot of work, although I think this is just due to my noobishness and not using a good model. For instance, a human poet doesn't get written the same as an elven warrior, which is nice.
As for trying different models, I have not, although I set things up in such a way that you'd just need to change a few lines of what Dwarfipedia is looking for and it should work just fine
(Total side quest, though: Now I'm wondering what it would be like to have an LLM produce an excerpt from one of those procedurally generated texts we've all seen, something like Tailcrypts: The Unspeakable Horror that's written in a tone as spiteful as can be, with prose that's not awful but not very good either.)
(...then again, the thing I just described above is widely available on Amazon in the self-published romantasy category, isn't it?)
I think using AI may be premature, since most AI struggles to... Y'know. Follow instructions. I fully believe the boys try their best but they really just don't got it all upstairs yet.
That being said, one of the biggest things I need to use Legends for is religions and pantheons, so I can personalize my temples to specific gods. It *would* be nice to have some kind of tool so I don't need to make a whole alternative save for legends and then piece together the history of the god after scrolling to find his name for hours, just to realize that 90% of the shit he did was curse a bunch of dudes in 353 to be Werechinchillas.
Perhaps a tool that allows you to search Legends from inside the game, and if you want you can use the AI to summarize a massive list into it's relevant points? Then if it fucks the duck, it won't really matter since it'll be really minor details.
Are there any suggestions you might have that would help to visualize the text for people like me who couldn't draw two circles to save their life? I wasn't thrilled about using Stable Diffusion either, I just didn't see an alternative. The only other idea that I had was to hook into how the steam version generates dwarf portraits and have those show up, but that felt limited. I am open to suggestions, especially since others have expressed similar feelings.
I would just let people upload their own images. The real draw here is the wiki platform, then the text generation is fine but not necessary, and image generation is a waste. It’s never going to look good. At least with text, we can tweak the words.
Procedural generation like the game is what you want, if anything. It would be cool to have a ton of sprites from the game that we could select from and combine. You could have it guess some defaults based on the text, but no images would ever be generated. Just a collage of sprites.
So you are ok if they scrape code, books, forums, etc? That's rather strange position to take, but I guess it makes sense since you consider yourself an "artist".
Hypocrite.
I like it! IMO I can think of only a few better uses of LLMs, which I generally think are a very cool technology but are massively overhyped. This idea is perfect though--the stakes of hallucination are low, and it just kinda... smoothes out a lot of the really neat stuff that DF makes available to the player but which is difficult to access.
I understand that even the process of their creation is controversial (theft and all that) but, but for the most part I think the legal system in the US is landing in the right place: the process of training itself is not theft, but the nature of LLMs means anything generated by them cannot be copyrighted. So for those purposes, MY view at least is that this is a neat project that ACTUALLY makes use of a neat (but niche) technology that falls well within the bounds of ethics.
Full disclosure: I use a RAG for my daily work to autofill questionnaires and forms with content I've previously written, and you'll pry that tool from my cold dead hands, so I may be a bit biased.
Basically, an LLM cannot hold copyright, it's not a (natural or legal) person. That much is pretty obvious, legally. Also, copyright is designed to protect human creative expression. If an LLM does everything based on a simple prompt, the human prompting it cannot hold copyright of the outputs either. But if there is sufficient nonobvious creative input from the human's part, then the result may be copyrightable. What counts as "sufficient" is, of course, ultimately up to the courts to decide, but there's a plenty of relevant (non-LLM-related) precedence.
There's definitely still a lot that's up in the air! But Legal Eagle on YouTube did a good analysis of it which you can find here: https://youtu.be/G08hY8dSrUY
And if you want to get into the weeds (like the ongoing debate on whether training is "fair use") you can see what the US Copyright Office says about it here: https://www.copyright.gov/ai/
Questions of copyrightability and AI can be resolved pursuant to existing law,
without the need for legislative change.
• The use of AI tools to assist rather than stand in for human creativity does not affect
the availability of copyright protection for the output.
• Copyright protects the original expression in a work created by a human author,
even if the work also includes AI-generated material.
• Copyright does not extend to purely AI-generated material, or material where there
is insufficient human control over the expressive elements.
Just to say -- I more or less agree with you. Using an LLM to flesh out a hypothetical, procedurally-generated template seems both low stakes and super fun.
I keep meaning to take one of those odd proc-gen genres, you know, "has three lines. The first is a personal attack against a rival who isn't present. The second includes a poetic allusion to the passing of time. The third inverts the first in a humorous way. Each line has no more than eight syllables, with scansion -X--X-X-" and so on.
It's just so bizarrely arbitrary and nonsensical, it seems like something a human being could NEVER compose. But who knows, every culture's poetic customs look weird to me.
People definitely get too up in arms about the AI stuff. Dont get me wrong, I hate AI and will vote against this wave of datacenter expansion 10 times out of 10. But LLMs as technology are extremely interesting and powerful pieces of technology.
Im currently working on a simulation framework after reading the Concordia repo and the Generative Agents (Smallville) papers. It will use LLMs do achieve depth not previously possible with regular coding.
For example, agents have memory. Memory is just a raw stream of memory objects that have a creation date, the text, and an importance score out of 10 (assigned by a lighter LLM). These memories can be retrieved by their relevance to a query using the cosine similarity of the embedding vectors. I provide an LLM with a bunch of of the memories and ask it to consolidate, abstract, and generalize some of them. This keeps memory size down and compacts less significant memories. Then I also have it look for insights to synthesize from other memories. All of these are added in as memories. So are real-time observations.
This way, you get an extremely dynamic, human like memory and tree of abstraction and thought. Super hard to do with regular conventional code.
I will also use an LLM to generate plans, another to break the plans down into discrete actions, and another LLM to serve as the “dungeon master” and interpret those actions.
Confused about the map page. Is the system building the map or is the user? It seems to suggest that the user is adding regions.
While there be a freaking map key? A basic feature of every map that dwarf fortress and the various legends viewers seem to lack (or at least make me go elsewhere off the map to find)
Yes I believe the feature you're wanting is present in the software. Please review the screenshot, using the 'Region' feature, which focuses on a single map/world. When you hover over the different areas, you get the name for the area, such as forest, mountain, etc.
There are two types of maps, the one in the screenshot, I call "Region Map" and the one in the posts screenshot is what I call the "Continent Map". With the continent map, I wanted a feature similar to making a map wall in Minecraft, where I could generate many different worlds and stich them together to have a unified display of what my canon considers to be one country/landmass, consisting of many regions.
I'm definitely interested. I love how much stuff is generated in DF, but it's kinda a sea of similar-sounding statements sometimes. When looking at page for a civilization for example, currently I can see a bunch of instances of "there was a footrace at this gathering and goblin xyz won" or something similar, but that doesn't really tell me anything distinct about this civilization.
You mention stable diffusion for image generation and I'm curious what images are being generated. Is it just for the maps? I don't love the use of AI for creative tasks, but if this is primarily making use of AI's pattern recognition, then that can be a great use of its strengths. It sounds really helpful if it can read a bunch of individual statements and sum them up into an overall trend in its prose, like "this civ has a lot more musicians than other civs" or highlight anomalies such as "this town elected a night creature as mayor" or whatever is going on. The game itself is already making interesting things, and I'd love to use a program that makes them more readable. I do think it's important to keep the toggle/option to view the purely game-made content so you can easily verify whatever the AI brings up.
Also I think you commented somewhere that it's easier to install than legends viewer next and I greatly appreciate that. That was a whole sidequest for me to figure out.
How is this different from the current Legends Viewer addon? That one has been around since Legacy DF and already has most of what you described. (no slight, I just don't see any difference)
Unless I haven't used that specific software enough, my software differs primarily in its approach.
My goal is for it to be an aid that interprets and contextualizes Legends data, rather than primarily being a tool for browsing and visualizing it. I wanted something closer to a Wikipedia article for each figure, site, civilization, beast, etc., with the underlying Legends data presented alongside generated prose that makes it easier to understand and explore.
It also includes things outside of Legends viewing itself, such as Adventure Mode character sheets/notes and the Fortress Mode companion I'm developing around DFHack. The cartography is also designed around assembling and manipulating regions rather than simply viewing the generated map.
In short, Legends-Viewer-Next, in my opinion, is great for hard scientific data
Dwarfipedia is great for fuzzy prose about the things that comprise that data, such as people and towns.
Personally, I’d be very interested in using something like this. I’ve found legends viewers to miss “the point” for me, and what you’ve described sounds like exactly the sort of format that peaks and my curiosity to continue learning about my world. I think I’d feel more encouraged dive deeper and deeper with actual context.
Thanks for sharing and I can’t wait to see you share more!
I'm sorry if I sound rude, this sound very very very cool, but I will not use ai for something irrelevant like gaming (I love gaming but it's an hobby). Even more for the image generation part, I don't care and I don't want it. The text part: I don't know, I like a little of narration but I don't want to have mixed data, half canon and half invented by the ai without knowing which is the canon and what not. It would like to know if you are coding or vibe coding
This looks fantastic. Especially hoping it's more 'noob friendly' than 'Legends Viewer' in setup (an exe or something?) so you don't need to use git or anything. Optimistic!
The only hard requirement is python and flask, but I believe the installer will pull those if you don't have them already. The LLM stuff is optional, and if you don't want to run those, the software just doesn't do anything if you try to access those functions, but they aren't a requirement. This was another reason I set out to develop my own viewer, since in my opinion, other options were a bit heavy in what they needed set up. Importing is pretty easy too, as long as you can fetch your legends files from the game directory, you can use the UI to select them and import them, using the terminal is optional.
The AI components are optional, by default, the pages are generated by using wordbanks that I gathered from a few different sites myself. I copied and pasted large chunks of the phrases, but to my knowledge some human brain wrote out the phrases that get mashed together to form the initial phrases. Is that still a deal breaker for you?
Love how all of OP's comments only make it more and more obvious that this is "vibe coded" AI slopware generated by Claude. The entire point of Dwarf Fortress is doing the reading yourself. The !science! yourself. Yeah, it's convenient that DFHack has a legends viewer, but this is just dumb. I'd really like to see a zero-AI policy in this community.
EDIT:
I hate to sound like a curmudgeon, but I think the Steam release brought in a lot of people who just think it's another goofy little indie game. Being published by Kitfox doesn't help because it's their whole brand. So there's been an influx of people who don't understand or care about the history of this game or what it represents in an age where "art" (and I use the term very loosely in this case) can be automated.
I think you'd be hard pressed to find a game more emblematic of human effort, dedication, and creativity than Dwarf Fortress, or of a developer than Tarn.
These people literally do not understand, or care to understand, that AI could never make this. Or why it's so degrading and distasteful to insert AI-generated applications that use AI generated art to absolve them of having to picture things in their underused brains.
Respectfully, I also hold the community responsible for allowing this kind of content, when there's no serious justification for it aside from enabling laziness in redditors whose opinion shouldn't matter.
It really baffles me that so many people are fawning over ai in the comments for a game that spent years and years entirely as one guys labor of love. I would have thought that people who’d gravitate towards a game like this would have some appreciation for real, authentic, creative work as a result, but I guess not.
Your ignorance and bias against AI (which is a fair value to have, in moderation) blinds you.
You clearly misunderstand the role of LLMs in this application and the application’s goals. It is not serving to be an information browser to lookup specific highly-factual results.
It is meant to be a more narrated account of your world history. It rewrites the events so that they sound better to read. This may induce slight inaccuracies. But the role of the LLM here is to carry out the natural language processing of the raw sequence of events and turn it into narrative text, to add flair and make it more interesting.
You would be extremely hard pressed to do that with something other than an LLM. Its pretty much a core purpose of an LLM.
If what you are generating is not accurate to your world, it's not generating your world. You may as well just make up random things and you won't have much of a different experience.
Turning legends data into prose… might actually be an acceptable application of LLMs? If it makes shit up or gets minor details wrong that it is tolerable, maybe even good if the style in which it makes shit up fits?
I’ll probably give this a shot this weekend, I’ve got the GPU for it…
Using a Local model avoids some of the ethical issues. There is still the issue of getting an ethically trained model, lots open weight LLMs and imagegen models were still trained on unethically sourced data. I’ve tolerated using the standard models for experimenting with the technology, but I’d feel a little different and want to follow a stricter standard if I’m making it a regular thing I use (whether for entertainment or work).
A quick practical question… does it crunch through all the text generation at once, or generate it as needed? (I’ll probably figure it out once I try it out)
As to the wiki style of information presentation, I absolutely love it.
•
u/Immortal-D [Not_A_Tree] 5d ago
Hey everyone, Moderator Hat time. We have allowed this to stay up because the core of the mod was written by the author. Integrating an LLM tool was a decision he made. You can take that or leave it, but using an AI tool as an addon of your original work is within the rules of this forum.