Bay 12 Games Forum

Dwarf Fortress => DF Modding => Topic started by: Xrazlyn on February 07, 2023, 09:40:18 am

Title: AI Generated Raws
Post by: Xrazlyn on February 07, 2023, 09:40:18 am
Has anybody tried making AI generated Raws using such things as Chatgpt?
I'm curious and want to compare some of the design choices with existing raws.

Follow-up question: What would you think of such creations going forward?
Personally I feel the same about it as I do about AI art: it devalues human made materials, and shouldn't be accepted in place of real effort and skill, and at best the AI generation of the assets should be disclosed to the user.

Title: Re: AI Generated Raws
Post by: Putnam on February 07, 2023, 03:39:21 pm
I do not expect ChatGPT to generate correct raws. It does not generate correct code except the very most trivial, either. It doesn't generate correct text, if you require "says true things" as a prerequisite for correctness. So to talk about design choices is a bit of a category error.
Title: Re: AI Generated Raws
Post by: Mohreb el Yasim on February 09, 2023, 12:55:46 pm
Yes I found it :D
http://www.bay12forums.com/smf/index.php?topic=42059.0
It was a fun thread back in the days, there were also some "serious" project but those were not able to do much...
Title: Re: AI Generated Raws
Post by: Xrazlyn on February 10, 2023, 07:48:39 am
Had to wait until just before sunrise to actually use Chatgpt, but here is the response to:
"create raw for a dwarf fortress, version 50.07, for mithril"

Dwarf Fortress is a complex game that allows players to create and manage their own dwarf fortresses in a procedurally generated, fantastical world. In Dwarf Fortress version 50.07, mithril is a valuable and rare resource that players can use to craft powerful weapons, armor, and other items.

Here's a basic raw for mithril in Dwarf Fortress version 50.07:


[MATERIAL:MITHRIL]
Metal
 Material Material Size:1
 Material Hardness:40000
 Material Density:8000
 Material Fracture Toughness:30
 Material Melting Point:1850
 Material Boiling Point:3000
 Material Solid Density:8000
 Material IMPACT_YIELD:7000
 Material IMPACT_FRACTURE:10000
 Material STRAIN_AT_YIELD:8000
 Material MAX_EDGE:30
 Material MIN_EDGE:1
 Material MIN_TOUGHNESS:7000
 Material MAX_TOUGHNESS:10000
 Material MIN_DUCTILITY:6000
 Material MAX_DUCTILITY:9000
 Material MIN_TEMPER:7500
 Material MAX_TEMPER:8500
 Material HEATDAM_POINT:1750
 Material HEATDAM_EDGE:30
 Material COOL_TEMPER:1500
 Material SPEC_HEAT:300
 Material IGNITE_POINT:2000
 Material ENTWINED:NO
 Material SPARKS:NO
 Material NONE_STONE:NO
 Material BEND_RADIUS:200
 Material CRACK_FILLER:YES
 Material METALLIC:YES


So, it doesn't look like it can form functional raws, as it creates a bunch of fake tokens, but it might be a source of data points for specific values of some tokens. Regardless, I still dislike the separation of human processing from the creative process...
Title: Re: AI Generated Raws
Post by: Sockmit2007 on February 10, 2023, 09:19:58 am
My five second result
[CREATURE:IRONBEAK_CHIRPER]
[DESCRIPTION:A small bird with metallic-looking feathers and a dense iron beak.]

[NAME:ironbeak chirper:ironbeak chirpers:ironbeak chirper]

[CASTE_NAME:ironbeak chirper:ironbeak chirpers:ironbeak chirper]
[CREATURE_TILE:'b'][COLOR:7:0:1]
[CREATURE_CLASS:BIRD]

[LARGE_ROAMING]
[FREQUENCY:100]

[NATURAL_SKILL:CLIMBING:3]
[NATURAL_SKILL:FLYING:7]

[BODY:BIRD:2WINGS:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:THROAT:NECK:SPINE:TAIL:2LEGS:2ARMS]
[BODY_DETAIL_PLAN:STANDARD_MATERIALS]
[BODY_SIZE:0:0:2000]
[REMOVE_MATERIAL:FEATHER]
[BODY_SIZE:1:0:7500]
[BODY_APPEARANCE_MODIFIER:LENGTH:90:95:98:100:102:105:110]
[BODY_APPEARANCE_MODIFIER:HEIGHT:90:95:98:100:102:105:110]
[BODY_APPEARANCE_MODIFIER:BROADNESS:90:95:98:100:102:105:110]
[USE_MATERIAL_TEMPLATE:FEATHER:FEATHER_TEMPLATE]
[MATERIAL_TEMPLATE:FEATHER_TEMPLATE:0:0:0:0:0:0:0:10:10:0:0:0]
[STATE_NAME_ADJ:ALL_SOLID:iron]
[STATE_NAME_ADJ:LIQUID:molten iron]
[STATE_NAME_ADJ:GAS:boiling iron]
[STATE_NAME_ADJ:PLASMA:fiery iron]

[DIURNAL]

[CARNIVORE]
[EAT_VERB:pecks at:pecks at:NA]
[FEED_PER_ITEM:100]
[FOOD_TYPE:MEAT]

[OVIPAROUS]
[EGG_MATERIAL:LOCAL_CREATURE_MAT:EGG:SOLID]
[EGG_SIZE:20]

[PREFSTRING:graceful flight]
[PREFSTRING:dense iron beak]
[PREFSTRING:metallic feathers]
Title: Re: AI Generated Raws
Post by: Eric Blank on February 10, 2023, 05:57:02 pm
These things, like the travestificator, are great for generating random nonsense that can be inspirational for actual implementation by a human, but not for generating something functional. Toady's current procedural creature generation is actually way ahead of them for creating critters that actually work in context. If Toady was willing to divulge how that works, then someone could do something equally productive for users, but at this point I bet that's as much a trade secret as how worldgen functions.

Maybe the best suggestion is actually, have user difineable raws that tell the game "generate something random here in this object class, using this object ID," such as nightmares or bogeymen or experiments, which the mod can then call upon elsewhere. Right now i can't do that for my necromancers or nightmare bringers, have to invent every weirdo myself, which is exhausting, and they'll be the same in every world.

[Edit]

I made a suggestion explicitly for that
Title: Re: AI Generated Raws
Post by: Pillbo on February 12, 2023, 02:17:53 pm
I was curious so I just tried this prompt

> create dwarf fortress raws for a hobbit creature

Quote
Here's an example of how you could create raws for a hobbit creature in Dwarf Fortress:

    Create a new entry for the hobbit in the creature_raws file:

    [CREATURE:HOBBIT]
    [DESCRIPTION:A small, quick-footed humanoid with curly hair and pointed ears.]
    [NAME:hobbit:hobbits:hobbit]
    [CASTE_NAME:hobbit:hobbits:hobbit]
    [ALL_TRIGGERS]
    [CREATURE_TILE:'h'][COLOR:6:0:0]
    [BASIC_SIZE:500]
    [ADULT_SIZE:700]
    [GENERAL_CHILD_SIZE:400]
    [BODY:QUADRUPED:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:NECK:SPINE:BRAIN:SKULL:4FINGERS:4TOES:MOUTH:TONGUE:TAIL:GENERIC_TEETH_WITH_LARGE_CANINES:RIBCAGE]
    [MAXAGE:70:100]
    [LIFE_STAGE:CHILD]
    [LIFE_STAGE:ADULT]
    [SELECT_CASTE:ALL]

    Define the physical attributes of the hobbit in the creature_variation file:

    [CREATURE:HOBBIT]
    [BODY_SIZE:0:0:500]
    [BODY_SIZE:1:0:700]
    [CHILD:BODY_SIZE_MULTIPLIER:1]
    [ADULT:BODY_SIZE_MULTIPLIER:1.4]
    [BODY_DETAIL_PLAN:STANDARD_MATERIALS]
    [BODY_DETAIL_PLAN:STANDARD_TISSUES]

    Define the skills and abilities of the hobbit in the creature_standard file:

    [CREATURE:HOBBIT]
    [SKILL:STANCE_STRIKE:1]
    [SKILL:BITE:1]
    [SKILL:GRASP_STRIKE:1]
    [SKILL:WRESTLING:1]
    [VISION_ARC:50:310]
    [MEANDERER]
    [NATURAL_SKILL:BITE:2]
    [NATURAL_SKILL:GRASP_STRIKE:2]
    [NATURAL_SKILL:STANCE_STRIKE:2]
    [NATURAL_SKILL:WRESTLING:2]
    [PREFSTRING:curly hair]
    [PREFSTRING:pointed ears]

Note that these raws are just an example and may need to be tweaked based on your specific vision for hobbits in your game. You can find more information on creating raws in the Dwarf Fortress Wiki.

That's kinda cool. I tried asking for an entity file and it did a lot worse
Title: Re: AI Generated Raws
Post by: Pillbo on February 12, 2023, 03:49:45 pm
I thought it might be useful for generating language files, I'm getting closer but haven't figured out how to get it to do a full file yet.

Spoiler (click to show/hide)
Title: Re: AI Generated Raws
Post by: brewer bob on February 12, 2023, 09:47:21 pm
"...these raws are just an example and may need to be tweaked..."

Quite the understatement there, but who am I to judge if the AI's vision of a hobbit is a quadruped with canine teeth. :D

I thought it might be useful for generating language files, I'm getting closer but haven't figured out how to get it to do a full file yet.

Maybe just use it to generate a bunch of gibberish fantasy words and use those as a base for DFLang (http://www.bay12forums.com/smf/index.php?topic=47332.0)?
Title: Re: AI Generated Raws
Post by: Sean Mirrsen on February 21, 2023, 11:01:01 pm
Speaking of the Travestificator, Google informed me that the old Drive link in the Travesties thread no longer works.

So here's a new one (https://drive.google.com/file/d/0B-dH7h5-e_uQWTdnNXlhS2xjUkk/view?usp=sharing&resourcekey=0-73AYsqG1eGe-q0WIn9gEWQ). Hope it works.
Title: Re: AI Generated Raws
Post by: KittyTac on February 23, 2023, 11:59:34 pm
These things, like the travestificator, are great for generating random nonsense that can be inspirational for actual implementation by a human, but not for generating something functional. Toady's current procedural creature generation is actually way ahead of them for creating critters that actually work in context. If Toady was willing to divulge how that works, then someone could do something equally productive for users, but at this point I bet that's as much a trade secret as how worldgen functions.

Maybe the best suggestion is actually, have user difineable raws that tell the game "generate something random here in this object class, using this object ID," such as nightmares or bogeymen or experiments, which the mod can then call upon elsewhere. Right now i can't do that for my necromancers or nightmare bringers, have to invent every weirdo myself, which is exhausting, and they'll be the same in every world.

[Edit]

I made a suggestion explicitly for that
I think it just has several slider variables, like size, and a bunch of modifiers that can be applies, like taking away the creature's skin or adding horns or adding a special attack. Pretty sure it's not super sophisticated but it works. Someone could make a script to emulate it.
Title: Re: AI Generated Raws
Post by: Deon on February 25, 2023, 11:12:21 am
I mean, randomly generated forgotten beasts in the original DF are exactly that: a set of rules that can make variations of bodies, tokens and properties.

AI is awesome when it's trained on a huge varied database and produces fantastic results. DF doesn't really have many raws to train on, and also there's no inherent explanation that would tell AI which raws mean what, so it's similar to "making AI text on signs", a bunch of semi-coherent gibberish without much value.
Title: Re: AI Generated Raws
Post by: dikbutdagrate on February 28, 2023, 09:23:48 pm
I really like the idea of generating a bunch of raws, pruning them for fake tokens, and then generating a world composed entirely of AI generated materials and creatures. That sounds like an enormous amount of fun. Although you'd really have to smudge things together, in order for it all to work correctly. Like for instance, with figuring out which procedurally generated body plan token to add to a creature, because theres no way the AI is keeping track of the body plans its made, lol.
Title: Re: AI Generated Raws
Post by: Timeless Bob on June 30, 2023, 10:15:43 pm
Chatgpt would be better at creating the actual text of books, based on the description and being tweaked to reference the history files of whichever world you're using.  Chatgpt's strength is in creating readable bullshit: given that the description of each book describes not only the subject matter and quality of the text, but also its "voice" and number of pages, these qualities become the boundary conditions that constrain the program's output.

Given the correct data on poetic forms, it could probably also churn out actual examples of a World's poetry and musical styles as well.
Title: Re: AI Generated Raws
Post by: Putnam on June 30, 2023, 11:59:22 pm
Yeah, though I think it might be better for people to just do that on their own instead of building that in, haha.
Title: Re: AI Generated Raws
Post by: AIArtificialIdiot on July 01, 2023, 09:53:35 pm
As many have said, there isn't really much of a reason to make a text generator create raws unless you're just doing it for fun. Which I valid reason I guess.

Though on the other topic, I think AI generation is fine mostly like a lot of people (as with all mediums) use it to make art lazily, but also there's a lot of neat stuff you can do with it by combining it with other mediums, heavily altering the result, and creating/using models specifically made to give a specific effect. As a 3D modeler, if I were to denounce AI generation for automating large parts of the artistic process, using others' work in a transformative way, and having a large subsection who use it for low-quality content, I would be a hypocrite; 3D modeling is full of that kind of stuff. In relation to DF specifically, I don't think AI raws are at all a concern, I doubt many people will seriously use them other than modders who have gotten bored and want to scrub through an AI output for errors. Some AI tilesets might be neat but that honestly seems like more effort than just making one the old-fashioned way for a generally worse result so I imagine it will only be done for the sake of novelty if at all.